Skip to content

Commit 421ab36

Browse files
authored
fix: Update index.ts (#296)
Adds marker collision behavior to markers, so the underlying POI is hidden when the place is selected.
1 parent e4d3eb9 commit 421ab36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samples/ui-kit-place-details/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ async function initMap(): Promise<void> {
3131
let adjustedCenter = offsetLatLngRight(placeDetails.place.location, -0.005);
3232
map.innerMap.panTo(adjustedCenter);
3333
map.innerMap.setZoom(16);
34-
3534
marker.position = placeDetails.place.location;
3635
marker.style.display = 'block';
36+
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
3737

3838
/* [START maps_ui_kit_place_details_event] */
3939
// Add an event listener to handle map clicks.
@@ -71,4 +71,4 @@ declare global {
7171
}
7272
window.initMap = initMap;
7373
/* [END maps_ui_kit_place_details] */
74-
export {};
74+
export {};

0 commit comments

Comments
 (0)