Skip to content

[google_maps_flutter] Background color for unloaded tiles #142520

Open
flutter/packages
#12357

Description

@Gabarsolon

Use case

When using a dark style for the google map, a white background is being shown for the unloaded tiles.

Proposal

It would be a good idea to have at disposal a variable like backgroundColor defined in the MapConfiguration class which can be used to change the color for the unloaded tiles depending on the app theme.

I've seen that on android, there is a variable like this defined in the GoogleMapOptions class:
https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMapOptions#backgroundColor(java.lang.Integer)

Also for ios:
https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_map_view_options#a929091a8ea8a162385cf7f0dfe0a666f

Activity

  1. darshankawar commented on Jan 30, 2024

    @darshankawar
    Member

    @Gabarsolon
    Thanks for the report. Can you take a look at this issue and check if it resembles your case or not ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 30, 2024
  3. Gabarsolon commented on Jan 30, 2024

    @Gabarsolon
    Author

    Hi, thanks for the response
    The attached issue doesn't really resembled my case
    There are situations when some tiles are loading and staying white for some miliseconds when moving around map

    Or sometimes for tiles that are out of bounds
    9E927D9A-154F-4CC8-A9F1-B052FBFDBCA6

    The simpliest solution, in my opinion, would be to change that backgroundColor variable

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 30, 2024
  5. added
    c: new featureNothing broken; request for a new capability
    p: mapsGoogle Maps plugin
    packageflutter/packages repository. See also p: labels.
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Jan 31, 2024
  6. BQLCODE commented on Jan 31, 2024

    @BQLCODE

    In my case, a white screen appears in release on some devices, for example Android 6.0.1, but running on Android 6.0.1 in development mode

  7. added
    P2Important issues not at the top of the work list
    on Feb 6, 2024
  8. stuartmorgan-g commented on Feb 6, 2024

    @stuartmorgan-g
    Contributor

    This is related to a common use case for #66207, which is avoiding flashes of white/light grey in dark mode.

  9. natsuk4ze commented on Mar 14, 2024

    @natsuk4ze
  10. stuartmorgan-g commented on Mar 14, 2024

    @stuartmorgan-g
  11. natsuk4ze commented on Mar 14, 2024

    @natsuk4ze
  12. stuartmorgan-g commented on Mar 14, 2024

    @stuartmorgan-g
  13. natsuk4ze commented on Mar 14, 2024

    @natsuk4ze
  14. hishamnabi commented on Apr 24, 2026

    @hishamnabi

    Was there ever a resolution to this issue? I am trying to use a dark style for the google maps widget in my app and I can see the tiles before they are loaded in are white which is causing a jarring white flash. Not sure how to get around this.

    I've tried using the cloud-based styling as well which allows you to set a background color, but changing the background color there doesn't seem to effect anything in the widget.

    Edit: It seems like the background color when using cloud-based styling works on android, but it doesn't work on iOS

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

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: mapsGoogle Maps pluginpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions