Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fluter - Google Maps, is it possible to use a Material Icon as a map marker?

Is it possible to use the Material Icons in Flutter as Markers in a Flutter app with the GoogleMap widget?

like image 531
Codered Avatar asked Oct 25 '19 15:10

Codered


People also ask

How do I set a marker icon on Google Maps Flutter?

Using an asset Then, just add it to your map using the right descriptor: final Uint8List markerIcon = await getBytesFromAsset('assets/images/flutter. png', 100); final Marker marker = Marker(icon: BitmapDescriptor. fromBytes(markerIcon));

How do you add a marker dynamically in Flutter?

In Flutter Maps, you can dynamically update the markers by following these steps. Step 1: Add Syncfusion Flutter Maps package to your dependencies in the pubspec. yaml file and initialize the Maps with the necessary properties. Please refer to this documentation for initializing the tile layer with markers.


1 Answers

If it's not too late: Yes, it is possible - but requires some steps: You draw an icon (which is basically a character within an icon font) on a Canvas, write the Canvas's content to PNG data and then instantiate a Marker with it. I actually wrote an article on how to do it.

like image 199
jbxbergdev Avatar answered Nov 15 '22 07:11

jbxbergdev