Skip to content

[google_maps_flutter] Support Widgets as markers #24213

Description

@kunit1

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)

Activity

  1. added this to the milestone on Nov 11, 2018
  2. csjames commented on Dec 5, 2018

    @csjames

    +1

    Has anyone gone down the route of rendering the widget to a bitmap and providing this to the add marker method?

  3. miguelpruivo commented on Mar 11, 2019

    @miguelpruivo

    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.

  4. GregorySech commented on May 13, 2019

    @GregorySech

    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.

  5. amorenew commented on Jun 30, 2019

    @amorenew

    I was able to use user avatar inside a marker in this repo if anyone needs it
    https://github.com/amorenew/Flutter_avatar_maps
    image

  6. kunit1 commented on Jun 30, 2019

    @kunit1
    Author

    @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.

  7. amreniouinnovent commented on Jun 30, 2019

    @amreniouinnovent

    @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.

  8. victorbucutea commented on Jul 20, 2019

    @victorbucutea

    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?

  9. victorbucutea commented on Jul 26, 2019

    @victorbucutea

    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 ?

  10. victorbucutea commented on Jul 26, 2019

    @victorbucutea

    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.
    ScreenRecording2019-07-26at2

    The only way to go in my humble opinion is with png to byte array

  11. PoojaB26 commented on Sep 6, 2019

    @PoojaB26
  12. 50 remaining items

  13. added
    P3Issues that are less important to the Flutter project
    and removed on Jun 28, 2023
  14. Navil commented on Jul 26, 2023

    @Navil
  15. luketree1 commented on Aug 18, 2023

    @luketree1

    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:

    1. Bottleneck caused by 60 events/sec on the Flutter and native channels.
    2. 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.

    Has anyone try this?

  16. changed the title [-]Feature Request: Google Maps Widget Markers[/-] [+][google_maps_flutter] Support Widgets as markers[/+] on Jan 4, 2024
  17. JaffaKetchup commented on Jul 4, 2024

    @JaffaKetchup
    Contributor

    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).

  18. Miqueas commented on Jul 13, 2024

    @Miqueas
  19. Rishyash commented on Aug 26, 2024

    @Rishyash
  20. YukiAttano commented on Mar 18, 2026

    @YukiAttano

    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.

  21. stuartmorgan-g commented on Mar 18, 2026

    @stuartmorgan-g
    Contributor

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.p: mapsGoogle Maps pluginpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions