Sitelet https://github.com/flutter/packages/pull/11966
Skip to content

[google_maps_flutter_web] Fix AdvancedMarker anchors on web - #11966

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
3ph:fixes-marker-anchor-on-web
Sep 25, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:mainfrom
3ph:fixes-marker-anchor-on-web

Conversation

@3ph

@3ph 3ph commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Fixes AdvancedMarker anchor handling in google_maps_flutter_web.

Previously AdvancedMarker.anchor was not applied on web, so custom advanced marker content was positioned as if it used the default anchor. This caused markers with non-default anchors to appear offset from their intended map coordinates.

This PR converts Flutter marker anchor offsets into the Google Maps JavaScript Advanced Marker anchorLeft and anchorTop CSS offset properties when creating marker options, and reapplies those properties when an existing advanced marker is updated.

Adds integration test coverage for creating and updating an AdvancedMarker with custom anchors.

Addresses flutter/flutter#80578.

Pre-Review Checklist

@google-cla

google-cla Bot commented Jun 23, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@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 implements AdvancedMarker anchor handling for the Google Maps Flutter Web plugin. It introduces helper functions to convert anchor offsets to CSS percentage strings and apply them as anchorLeft and anchorTop properties on the underlying AdvancedMarkerElement and its options. Additionally, an integration test has been added to verify that anchors are correctly set and updated. I have no feedback to provide.

@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 fixes the anchor handling for AdvancedMarker on the web platform by introducing helper functions to convert anchor offsets to CSS percentages and apply them to AdvancedMarkerElementOptions and AdvancedMarkerElement. It also adds an integration test to verify anchor positioning and updates, and bumps the package version to 0.6.2+4. There are no review comments, and I have no feedback to provide.

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Thanks for the contribution! There are two email addresses associated with the commits in this PR, and only one has a CLA on file. You'll need to either sign the CLA for the second address, or if using it was unintentional, amend your commits and re-push. Once that's done, please mark as Read for Review.

@stuartmorgan-g
stuartmorgan-g marked this pull request as draft June 30, 2026 18:28
@3ph
3ph marked this pull request as ready for review June 30, 2026 22:59

@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 implements AdvancedMarker anchor handling on the web platform by converting anchor offsets to CSS percentage strings and applying them to the marker options, supported by new integration tests. Feedback suggests addressing potential floating-point precision issues in the percentage calculation to prevent verbose CSS output.

Comment thread packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md Outdated
@stuartmorgan-g
stuartmorgan-g requested a review from mdebbar August 6, 2026 18:28
@stuartmorgan-g stuartmorgan-g added the triage-web Should be looked at in web triage label Aug 6, 2026
@3ph
3ph force-pushed the fixes-marker-anchor-on-web branch from d2244aa to 71d7353 Compare August 11, 2026 04:46
@mdebbar mdebbar added the CICD Run CI/CD label Aug 13, 2026

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

Looks good to me!

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2026
@auto-submit

auto-submit Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/packages/11966, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2026
@stuartmorgan-g

stuartmorgan-g commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

@3ph Are you still planning on updating this PR to address the test failures showing in CI?

@3ph
3ph force-pushed the fixes-marker-anchor-on-web branch from 71d7353 to e76fcaa Compare September 22, 2026 22:44
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 22, 2026
@mdebbar mdebbar added the CICD Run CI/CD label Sep 23, 2026
@@ -1,6 +1,7 @@
## NEXT

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.

This needs to be updated to a new version.

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.

This needs to be updated to a new version.

@3ph
3ph force-pushed the fixes-marker-anchor-on-web branch from e76fcaa to 0c5b9e7 Compare September 25, 2026 01:16
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 25, 2026
@stuartmorgan-g stuartmorgan-g added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Sep 25, 2026
@auto-submit
auto-submit Bot merged commit 756c474 into flutter:main Sep 25, 2026
14 checks passed
github-merge-queue Bot pushed a commit to flutter/flutter that referenced this pull request Sep 28, 2026
flutter/packages@e55e7ac...ba0364a

2026-09-26 stuartmorgan@google.com [google_maps_flutter] Indicate that
default iOS impl is discoraged (flutter/packages#12872)
2026-09-26 36861262+QuncCccccc@users.noreply.github.com [material_ui]
Add Material 3 Expressive IconButton (flutter/packages#12832)
2026-09-25 jessiewong401@gmail.com Plugin example apps to 9.3.1
(flutter/packages#13019)
2026-09-25 36861262+QuncCccccc@users.noreply.github.com [material_ui]
Don't clip MenuItemButton.leadingIcon (flutter/packages#12986)
2026-09-25 36861262+QuncCccccc@users.noreply.github.com [material_ui]
Migrate M3 ExpansionTile template to use new gen_defaults
(flutter/packages#12920)
2026-09-25 149176071+m1roxx@users.noreply.github.com
[two_dimensional_scrollables] Exclude trailing pinned spans from the
non-pinned range (flutter/packages#12666)
2026-09-25 36861262+QuncCccccc@users.noreply.github.com [material_ui]
Migrate M3 Drawer template to use new gen_defaults
(flutter/packages#12916)
2026-09-25 36861262+QuncCccccc@users.noreply.github.com [material_ui]
Migrate M3 Divider template to use new gen_defaults
(flutter/packages#12915)
2026-09-25 instantni.med@gmail.com [google_maps_flutter_web] Fix
AdvancedMarker anchors on web (flutter/packages#11966)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com 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 CICD Run CI/CD p: google_maps_flutter platform-web triage-web Should be looked at in web triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants