Skip to content

[google_maps_flutter_web] Omit styles when cloudMapId is set - #9869

Merged
auto-submit[bot] merged 29 commits into
flutter:mainfrom
WillBLogical:fix-maps-web-style-conflict-v2
Sep 4, 2025
Merged

auto-submit[bot] merged 29 commits into
flutter:mainfrom
WillBLogical:fix-maps-web-style-conflict-v2

Conversation

@WillBLogical

@WillBLogical WillBLogical commented Aug 22, 2025 •

Copy link
Copy Markdown
Contributor

When cloudMapId is set, styles must be omitted to avoid conflicts. Now we set MapOptions.mapId and leave styles null in that case.

Tests: add cloud_map_styles_test (web integration) to verify:

  • cloudMapId present ⇒ styles omitted, mapId set
  • no cloudMapId ⇒ styles applied

Fixes flutter/flutter#161951

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3

When `cloudMapId` is set, styles must be omitted to avoid conflicts.
Now we set `MapOptions.mapId` and leave `styles` null in that case.

Tests: add `cloud_map_styles_test` (web integration) to verify:
- cloudMapId present ⇒ styles omitted, mapId set
- no cloudMapId ⇒ styles applied

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses an issue where using cloudMapId for cloud-based styling on the web would fail if the style property was also present. The change correctly omits setting styles on the map when a cloudMapId is provided. New integration tests are added to verify that styles are omitted when cloudMapId is present, and applied when it's not. The implementation is correct, but my feedback points out the use of a deprecated cloudMapId property, suggesting to use the current mapId property instead. This is to adhere to the project's style guide, which recommends following Effective Dart style, including avoiding deprecated members.

Comment thread packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart Outdated
WillBLogical and others added 8 commits August 22, 2025 05:17
Linux analyze_downgraded stableFailing after 6m — Linux analyze_downgraded stable
  error - lib/src/convert.dart:103:21 - The getter 'mapId' isn't defined for the type 'MapConfiguration'. Try importing the library that defines 'mapId', correcting the name to the name of an existing getter, or defining a getter or field named 'mapId'. - undefined_getter

1 issue found.
When `cloudMapId` is set, styles must be omitted to avoid conflicts.
Now we set `MapOptions.mapId` and leave `styles` null in that case.

Tests: add `cloud_map_styles_test` (web integration) to verify:
- cloudMapId present ⇒ styles omitted, mapId set
- no cloudMapId ⇒ styles applied
Linux analyze_downgraded stableFailing after 6m — Linux analyze_downgraded stable
  error - lib/src/convert.dart:103:21 - The getter 'mapId' isn't defined for the type 'MapConfiguration'. Try importing the library that defines 'mapId', correcting the name to the name of an existing getter, or defining a getter or field named 'mapId'. - undefined_getter

1 issue found.
@WillBLogical
WillBLogical force-pushed the fix-maps-web-style-conflict-v2 branch from e65b28e to 08c8c84 Compare August 22, 2025 21:07
@stuartmorgan-g stuartmorgan-g added the triage-web Should be looked at in web triage label Aug 26, 2025
@mdebbar
mdebbar requested review from mdebbar and removed request for ditman August 27, 2025 18:07

@mdebbar mdebbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@mdebbar
mdebbar requested a review from stuartmorgan-g August 27, 2025 22:19
@WillBLogical
WillBLogical force-pushed the fix-maps-web-style-conflict-v2 branch from c98003a to b9b4b66 Compare August 29, 2025 17:40
Comment thread packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart Outdated
Comment thread packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md Outdated
WillBLogical and others added 5 commits September 3, 2025 17:26
….5.14+1

- Revert the unnecessary code move; keep the logic in its original location.
- Update pubspec and CHANGELOG to 0.5.14+1 (pre-1.0 bugfix).
- Update pubspec and CHANGELOG to 0.5.14+2

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stuartmorgan-g stuartmorgan-g added autosubmit Merge PR when tree becomes green via auto submit App and removed triage-web Should be looked at in web triage labels Sep 4, 2025
@auto-submit
auto-submit Bot merged commit 0e22076 into flutter:main Sep 4, 2025
80 checks passed
github-merge-queue Bot pushed a commit to flutter/flutter that referenced this pull request Sep 4, 2025
flutter/packages@42bb347...98580c6

2025-09-04 [email protected] [mustache_template] Initial import
(flutter/packages#9944)
2025-09-04 [email protected]
[google_maps_flutter_web] Omit styles when cloudMapId is set
(flutter/packages#9869)
2025-09-03 [email protected] [go_router_builder] Fix unnecessary
whitespace in generated `RelativeGoRouteData` (flutter/packages#9875)
2025-09-03 [email protected] [google_maps_flutter_web] Stop
listening to map events when disposed (flutter/packages#9250)
2025-09-03 [email protected] [flutter_svg] loader buffer fix
(flutter/packages#9898)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
flutter/packages@42bb347...98580c6

2025-09-04 [email protected] [mustache_template] Initial import
(flutter/packages#9944)
2025-09-04 [email protected]
[google_maps_flutter_web] Omit styles when cloudMapId is set
(flutter/packages#9869)
2025-09-03 [email protected] [go_router_builder] Fix unnecessary
whitespace in generated `RelativeGoRouteData` (flutter/packages#9875)
2025-09-03 [email protected] [google_maps_flutter_web] Stop
listening to map events when disposed (flutter/packages#9250)
2025-09-03 [email protected] [flutter_svg] loader buffer fix
(flutter/packages#9898)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
flutter/packages@42bb347...98580c6

2025-09-04 [email protected] [mustache_template] Initial import
(flutter/packages#9944)
2025-09-04 [email protected]
[google_maps_flutter_web] Omit styles when cloudMapId is set
(flutter/packages#9869)
2025-09-03 [email protected] [go_router_builder] Fix unnecessary
whitespace in generated `RelativeGoRouteData` (flutter/packages#9875)
2025-09-03 [email protected] [google_maps_flutter_web] Stop
listening to map events when disposed (flutter/packages#9250)
2025-09-03 [email protected] [flutter_svg] loader buffer fix
(flutter/packages#9898)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
danferreira pushed a commit to danferreira/packages that referenced this pull request Oct 22, 2025
…#9869)

When `cloudMapId` is set, styles must be omitted to avoid conflicts. Now we set `MapOptions.mapId` and leave `styles` null in that case.

Tests: add `cloud_map_styles_test` (web integration) to verify:
- cloudMapId present ⇒ styles omitted, mapId set
- no cloudMapId ⇒ styles applied

Fixes flutter/flutter#161951

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
flutter/packages@42bb347...98580c6

2025-09-04 [email protected] [mustache_template] Initial import
(flutter/packages#9944)
2025-09-04 [email protected]
[google_maps_flutter_web] Omit styles when cloudMapId is set
(flutter/packages#9869)
2025-09-03 [email protected] [go_router_builder] Fix unnecessary
whitespace in generated `RelativeGoRouteData` (flutter/packages#9875)
2025-09-03 [email protected] [google_maps_flutter_web] Stop
listening to map events when disposed (flutter/packages#9250)
2025-09-03 [email protected] [flutter_svg] loader buffer fix
(flutter/packages#9898)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…#9869)

When `cloudMapId` is set, styles must be omitted to avoid conflicts. Now we set `MapOptions.mapId` and leave `styles` null in that case.

Tests: add `cloud_map_styles_test` (web integration) to verify:
- cloudMapId present ⇒ styles omitted, mapId set
- no cloudMapId ⇒ styles applied

Fixes flutter/flutter#161951

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Nakiha pushed a commit to Nakiha/VoidPlayer-Flutter that referenced this pull request Sep 28, 2026
flutter/packages@42bb347...98580c6

2025-09-04 [email protected] [mustache_template] Initial import
(flutter/packages#9944)
2025-09-04 [email protected]
[google_maps_flutter_web] Omit styles when cloudMapId is set
(flutter/packages#9869)
2025-09-03 [email protected] [go_router_builder] Fix unnecessary
whitespace in generated `RelativeGoRouteData` (flutter/packages#9875)
2025-09-03 [email protected] [google_maps_flutter_web] Stop
listening to map events when disposed (flutter/packages#9250)
2025-09-03 [email protected] [flutter_svg] loader buffer fix
(flutter/packages#9898)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: google_maps_flutter platform-web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google Maps cloud-based styling (map ID) not applied on the web

3 participants