Skip to content

Commit 502a062

Browse files
bloveclaude
andauthored
fix(ag-ui): advanced markers ignore clicks — set gmpClickable (#749)
Regression from the AdvancedMarkerElement migration: the legacy google.maps.Marker was clickable by default, but AdvancedMarkerElement is NOT — without gmpClickable it never fires click/gmp-click, so the wrapper's (mapClick) output stays silent and the marker info window (focus + Remove) never opens. Pass { gmpClickable: true } via the marker [options]. Found by Brian during live review; verified live in Chrome — markers report gmpClickable=true and clicking opens the info window. (The "use gmp-click" console hint was this bug's symptom, not noise.) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent b1332d2 commit 502a062

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

examples/ag-ui/angular/src/app/map-canvas.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const PARIS_CENTER: google.maps.LatLngLiteral = { lat: 48.8566, lng: 2.3522 };
4545
[position]="m.position"
4646
[content]="m.content"
4747
[title]="m.stop.place"
48+
[options]="advancedMarkerOptions"
4849
(mapClick)="onMarkerClick(m.stop)"
4950
/>
5051
}
@@ -95,6 +96,12 @@ export class MapCanvasComponent {
9596
zoomControl: true,
9697
clickableIcons: false,
9798
};
99+
// AdvancedMarkerElement is NOT clickable by default (unlike the legacy
100+
// Marker) — without gmpClickable it never fires click/gmp-click, so the
101+
// wrapper's (mapClick) output stays silent and the info window can't open.
102+
protected readonly advancedMarkerOptions: google.maps.marker.AdvancedMarkerElementOptions = {
103+
gmpClickable: true,
104+
};
98105

99106
private readonly googleMap = viewChild(GoogleMap);
100107
private readonly infoWindow = viewChild(MapInfoWindow);

0 commit comments

Comments
 (0)