How to change the icon size of Google Maps marker in Flutter?

前端 未结 14 756
不知归路
不知归路 2020-12-07 12:32

I am using google_maps_flutter in my flutter app to use google map I have custom marker icon and I load this with BitmapDescriptor.fromAsset(\"images/car.

14条回答
  •  隐瞒了意图╮
    2020-12-07 13:09

    A simple way I found to solve this is simply

    BitmapDescriptor get deliveryIcon {
      bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
      if (isIOS)
        return BitmapDescriptor.fromAsset('assets/icons/orange_pin.png');
      else
        return BitmapDescriptor.fromAsset(
            'assets/icons/3.0x/orange_pin.png');
    } 
    

    Simply put, supply the android the larger asset.

提交回复
热议问题