You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[google_maps_flutter] Support Widgets as markers #24213
It would be very handy to allow markers on the google maps to be flutter widgets. I know that currently there is already a method to load an image from assets but this is a static marker.
Overlaying a widget as a marker allows for dynamic generation of markers (example: rating of location on the map)
There is already a PR for this (see flutter-team-archive/plugins#815) which allows a Uint8List to be used as a marker. This allows not only widgets but also "anything" else that can be encoded into a png.
Seems a restrictive and sub-optimal workaround. If you wanted a ScrollView to be part of the marker how would you handle it? Or in general any animated marker?
Encoding every frame seems wasteful at best.
Reacted by Eugene Pisotsky, Pooja Bhaumik and Joshua Fletcher
@amorenew Thank you for sharing your code. This issue is for using a flutter widget as a marker. From a quick glance, I don't see how the code you shared solves this issue.
Reacted by Amr Abdelwahab, Javier Benitez, Gregory Sech and Suh Fang
@kunit1 It will not solve all cases and for sure a widget marker is a better solution.
I just want to share my solution for avatar on the marker until the flutter team considers your feature request on a short term milestone.
Reacted by KF, Renato Burton and Volodymyr Kartavyi
I'm going to implement this in a custom app using the Projection API. The markers will not be native, but absolutely positioned widgets. Is it acceptable if I submit a PR with it?
Reacted by Yuri Araújo, Jeremy Kolb, Gregory Sech, Jason Perfetto and Anthony Aniobi
Reacted by Pablo Rocha, Gregory Sech, Helio S. Junior and Jason Perfetto
I'm quite in the dark as how to implement the Marker Widget. I'm thinking of adding it to the examples, right next to the icon marker. Now, making the current Marker class a widget seems not the way to go as it's only a bridge between Dart ggl maps plugin and underlying platform plugin.
I was thinking of adding a new class MarkerWidget which can be used similarly. It should be able to reposition for the basic drag map and zoom in/out scenario . Any other scenarios I'm missing ?
Ok, turns out the projection API is not the way to go. In order to reposition the widget, you need to get notified of camera movement which is not smooth at all.
Hello. Our team requires widget markers to draw various animations on the map. We placed custom layers and placed widgets on them, but as extensively discussed before, there is a slight delay.
Furthermore, such delays in low-power mode appear to deviate from the trend and seem quite peculiar. I can't speculate on why this might be happening.
I'm wondering if this phenomenon is due to:
Bottleneck caused by 60 events/sec on the Flutter and native channels.
Or simply due to delays in the channels.
If it's 1), it seems possible to try reducing the update interval in the native code or explore other methods to eliminate the bottleneck.
@YukiAttano The Google Maps SDK has its own internal rendering thread, so even if all of the plugin communication is made synchronous (which thread merging makes possible, but doesn't do automatically), workarounds for this issue that overlay widgets may still not be able to synchronize exactly with map movement.
Activity
csjames commentedon Dec 5, 2018
+1
Has anyone gone down the route of rendering the widget to a bitmap and providing this to the add marker method?
miguelpruivo commentedon Mar 11, 2019
There is already a PR for this (see flutter-team-archive/plugins#815) which allows a
Uint8Listto be used as a marker. This allows not only widgets but also "anything" else that can be encoded into a png.GregorySech commentedon May 13, 2019
Seems a restrictive and sub-optimal workaround. If you wanted a ScrollView to be part of the marker how would you handle it? Or in general any animated marker?
Encoding every frame seems wasteful at best.
amorenew commentedon Jun 30, 2019
I was able to use user avatar inside a marker in this repo if anyone needs it

https://github.com/amorenew/Flutter_avatar_maps
kunit1 commentedon Jun 30, 2019
@amorenew Thank you for sharing your code. This issue is for using a flutter widget as a marker. From a quick glance, I don't see how the code you shared solves this issue.
amreniouinnovent commentedon Jun 30, 2019
@kunit1 It will not solve all cases and for sure a widget marker is a better solution.
I just want to share my solution for avatar on the marker until the flutter team considers your feature request on a short term milestone.
victorbucutea commentedon Jul 20, 2019
I'm going to implement this in a custom app using the Projection API. The markers will not be native, but absolutely positioned widgets. Is it acceptable if I submit a PR with it?
victorbucutea commentedon Jul 26, 2019
I'm quite in the dark as how to implement the Marker Widget. I'm thinking of adding it to the examples, right next to the icon marker. Now, making the current Marker class a widget seems not the way to go as it's only a bridge between Dart ggl maps plugin and underlying platform plugin.
I was thinking of adding a new class
MarkerWidgetwhich can be used similarly. It should be able to reposition for the basic drag map and zoom in/out scenario . Any other scenarios I'm missing ?victorbucutea commentedon Jul 26, 2019
Ok, turns out the projection API is not the way to go. In order to reposition the widget, you need to get notified of camera movement which is not smooth at all.

The only way to go in my humble opinion is with png to byte array
PoojaB26 commentedon Sep 6, 2019
50 remaining items
Navil commentedon Jul 26, 2023
luketree1 commentedon Aug 18, 2023
Hello. Our team requires widget markers to draw various animations on the map. We placed custom layers and placed widgets on them, but as extensively discussed before, there is a slight delay.
Furthermore, such delays in low-power mode appear to deviate from the trend and seem quite peculiar. I can't speculate on why this might be happening.
I'm wondering if this phenomenon is due to:
If it's 1), it seems possible to try reducing the update interval in the native code or explore other methods to eliminate the bottleneck.
Has anyone try this?
[-]Feature Request: Google Maps Widget Markers[/-][+][google_maps_flutter] Support Widgets as markers[/+]JaffaKetchup commentedon Jul 4, 2024
Google Maps Platform now offers Raster Tiles through an official endpoint (although the unofficial against-ToS endpoint still exists): https://developers.google.com/maps/documentation/tile/2d-tiles-overview?hl=en.
It is now viable to use Google Maps with flutter_map (https://docs.fleaflet.dev/) which supports this feature and is 100% Dart+Flutter, if you're willing to accept other tradeoffs of raster over vector tiles (https://docs.fleaflet.dev/getting-started/explanation/raster-vs-vector-tiles).
Miqueas commentedon Jul 13, 2024
Rishyash commentedon Aug 26, 2024
https://medium.com/wheelseye-engineering/flutter-a-new-way-to-create-custom-info-window-in-google-map-47a6336ba1fc
Have tried it by forking the repo and redesign it for our usecase
YukiAttano commentedon Mar 18, 2026
This might be solved with the thread merge of Flutter which is currently ongoing.
https://www.youtube.com/watch?v=miW7vCmQwnw
Edit:
Flutter v3.29 - Android & iOS
Flutter v3.35 - MacOS and Windows
Flutter v3.39 - Linux
Source: https://docs.flutter.dev/release/breaking-changes/linux-merged-threads
If Web has no separate threads, the merges are done as far as I can tell.
stuartmorgan-g commentedon Mar 18, 2026
@YukiAttano The Google Maps SDK has its own internal rendering thread, so even if all of the plugin communication is made synchronous (which thread merging makes possible, but doesn't do automatically), workarounds for this issue that overlay widgets may still not be able to synchronize exactly with map movement.