-
Notifications
You must be signed in to change notification settings - Fork 5
Update Basic Autocomplete to use gmp-map #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Here is the summary of changes. You are about to add 1 region tag.
You are about to delete 1 region tag.
This comment is generated by snippet-bot.
|
810aeb3
to
41346d0
Compare
41346d0
to
5d96c14
Compare
)) as google.maps.MapsLibrary; | ||
|
||
// Get the initial center directly from the gmp-map element's property. | ||
const center = gmpMapElement.center; | ||
|
||
// Set the initial location bias for the autocomplete element. | ||
placeAutocompleteElement.locationBias = center; | ||
|
||
// Create the map object with specified options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Create/Update/
const mapDiv = document.getElementById('map-container') as HTMLElement; | ||
const center: google.maps.LatLngLiteral = { lat: 40.749933, lng: -73.98633 }; // New York City | ||
|
||
const gmpMapElement = document.querySelector('gmp-map') as any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/any/google.maps.MapElement/
ditto others (generally, let's try to avoid any
)
const advancedMarkerElement: google.maps.marker.AdvancedMarkerElement = new AdvancedMarkerElement({ | ||
map: map, | ||
}); | ||
const advancedMarkerElement: google.maps.marker.AdvancedMarkerElement = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one the any
s are gone above, I think you can strip out all the : type
type decls?
<gmp-place-details-compact orientation="horizontal"> | ||
<gmp-place-details-compact | ||
orientation="horizontal" | ||
style="width: 400px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be good to comment why inline styles are being used here (esp noting because this element will be moving inside the DOM once JS loads).
No description provided.