Skip to content

Scaling custom marker icon via BitmapDescriptor ImageConfiguration argument doesn't seem to work for android #22

Closed
@fbazbo

Description

@fbazbo

This code works fine for IOS and the icon gets scaled to a size I'm happy with for my marker assets (png at 177x240px):

Future<BitmapDescriptor> getAssetImage(String path, BuildContext context) {
      double dpr = MediaQuery.of(context).devicePixelRatio;
      ImageConfiguration config = ImageConfiguration(devicePixelRatio: dpr*2.0,);
      return BitmapDescriptor.fromAssetImage(config, path);
}

For Android, no matter what I pass for the devicePixelRatio, I always get the same size marker icon.

Note, that this might be a bug in the google map implementation since there seem to be similar issues - flutter/flutter#24865

Also, there are some alternative suggestions to size a marker via stackoverflow, but your version of BitmapDescriptor does not implement the fromBytes static method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions