2

I use custom icons in my google_maps_flutter widget. No matter what size I choose in the creation process, the icons are way too big.

pubspec.yaml

google_maps_flutter: ^1.0.6

widget

void _createBitMaps() async {
  for (String cat in categories) {
    String path = 'lib/assets/categorie_icons_location/' + cat + '.png';
    try {
      // > > > I resized the icon here, but I has no effect to the final icon. < < <
      BitmapDescriptor bitmap = await BitmapDescriptor.fromAssetImage(ImageConfiguration(size: Size(8, 8)), path);
      setState(() => bitmaps[cat] = bitmap);
    } catch(e) {
      print(e.toString());
    }
  }
    }

//...

Widget build(BuildContext context) {
  print('BUILD');
  return GoogleMap(
    myLocationEnabled: true,
    onMapCreated: _onMapCreated,
    initialCameraPosition: CameraPosition(
      target: LatLng(53.553672, 9.997715),
      zoom: 12
    ),
    markers: _markers,
  );
}
Chris
  • 41
  • 5

0 Answers0