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
Commit 756c474
Browse filesBrowse the repository at this point in the historyBrowse files
[google_maps_flutter_web] Fix AdvancedMarker anchors on web (#11966)
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
Copy file name to clipboardExpand all lines: packages/google_maps_flutter/google_maps_flutter_web/example/latest/integration_test/advanced_markers_test.dart
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -480,6 +480,32 @@ void main() {
480
480
expect(icon.style.height, '30px');
481
481
});
482
482
483
+
testWidgets('markers with anchor work', (WidgetTester tester) async {
484
+
const markerId =MarkerId('1');
485
+
const anchorOffset =Offset(0.14, 0.75);
486
+
const updatedAnchorOffset =Offset(-0.6, 1.6);
487
+
488
+
final markers =<AdvancedMarker>{AdvancedMarker(markerId: markerId, anchor: anchorOffset)};
0 commit comments