Skip to content

Conversation

@ejhaselden
Copy link
Contributor

No description provided.

@snippet-bot
Copy link

snippet-bot bot commented Jan 26, 2026

Here is the summary of changes.

You are about to add 4 region tags.
You are about to delete 4 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

<gmp-place-details-compact orientation="horizontal">
<!--[START maps_ui_kit_place_details_compact_request]-->
<div class="container">
<!-- map-id is required to use advanced markers. See https://developers.google.com/maps/documentation/javascript/map-ids/mapid-over. -->

Choose a reason for hiding this comment

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

Suggested change
<!-- map-id is required to use advanced markers. See https://developers.google.com/maps/documentation/javascript/map-ids/mapid-over. -->
<!-- map-id is required to use Advanced Markers. See https://developers.google.com/maps/documentation/javascript/map-ids/mapid-over. -->

The gmp-place-details-compact element is styled inline because it is
conditionally rendered and moved into the info window, which is
part of the map's shadow DOM.
-->

Choose a reason for hiding this comment

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

Suggested change
-->
-->

<!-- map-id is required to use advanced markers. See https://developers.google.com/maps/documentation/javascript/map-ids/mapid-over. -->
<gmp-map
center="47.759737, -122.250632"
zoom="16"

Choose a reason for hiding this comment

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

suggest leaving off the center and zoom, as the fitBounds() call later will cover that (and that would avoid a transition post-load)

'maps'
)) as google.maps.MapsLibrary;
// Request needed libraries.
await Promise.all([

Choose a reason for hiding this comment

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

Suggested change
await Promise.all([
Promise.all([

I think we can tweak this to avoid strictly blocking on all these things up front

)) as google.maps.MarkerLibrary;
gMap = new Map(mapContainer, { mapId: 'DEMO_MAP_ID' });
marker = new AdvancedMarkerElement({ map: gMap });
// Set the map options.

Choose a reason for hiding this comment

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

Suggested change
// Set the map options.
await window.customElements.whenDefined('gmp-map');
// Set the map options.

placeDetailsRequest.place = event.placeId;
updateMapAndMarker();
} else {
// Fire when the user clicks the map (not on a POI).

Choose a reason for hiding this comment

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

Suggested change
// Fire when the user clicks the map (not on a POI).
// When the user clicks the map (not on a POI).

if (event.placeId) {
console.log('clicked on POI');
console.log(event.placeId);
// Fire when the user clicks a POI.

Choose a reason for hiding this comment

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

Suggested change
// Fire when the user clicks a POI.
// When the user clicks a POI.

} else {
// Fire when the user clicks the map (not on a POI).
console.log('No place was selected.');
marker.style.display = 'none';

Choose a reason for hiding this comment

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

Suggested change
marker.style.display = 'none';

// Fire when the user clicks the map (not on a POI).
console.log('No place was selected.');
marker.style.display = 'none';
infoWindow.close();

Choose a reason for hiding this comment

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

Suggested change
infoWindow.close();

should happen automatically because it's attached to the marker

console.log(event.placeId);
// Fire when the user clicks a POI.
placeDetailsRequest.place = event.placeId;
updateMapAndMarker();

Choose a reason for hiding this comment

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

Suggested change
updateMapAndMarker();

I think remove this here, and just let gmp-load on the details view trigger it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants