Reputation: 338
I might have skipped some documentation about flutter_map
plugin, but I could not find any way to use a simple .png
image as a custom icon for a Mapbox
marker?
Should I maybe use another plugin
? Or is there a way to do what I attempted to do?
Upvotes: 3
Views: 1398
Reputation: 56
You can do that with the mapbox_gl plugin by calling
MapboxMapController.addSymbol(
SymbolOptions(
geometry: LatLng(latitude, longitude),
iconImage: iconImage,
);
You can use the name of one of your asset images as iconImage or the name of one of the icons included in your style (e.g. 'defaultMarker' should be included in every style).
There is also an example of this in the place_symbol.dart file of the plugin's example project.
Upvotes: 3