Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions samples/place-class/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ let centerCoordinates = { lat: 37.4161493, lng: -122.0812166 };

async function initMap() {
const { Map } = await google.maps.importLibrary("maps") as google.maps.MapsLibrary;
const { Place } = await google.maps.importLibrary("places") as google.maps.PlacesLibrary;

map = new Map(document.getElementById('map') as HTMLElement, {
center: centerCoordinates,
Expand All @@ -20,11 +19,12 @@ async function initMap() {
// [END_EXCLUDE]
});

getPlaceDetails(Place);
getPlaceDetails();
}

// [START maps_place_class_fetchfields]
async function getPlaceDetails(Place) {
async function getPlaceDetails() {
const { Place } = await google.maps.importLibrary("places") as google.maps.PlacesLibrary;
const { AdvancedMarkerElement } = await google.maps.importLibrary("marker") as google.maps.MarkerLibrary;
// Use place ID to create a new Place instance.
const place = new Place({
Expand All @@ -50,4 +50,4 @@ async function getPlaceDetails(Place) {

initMap();
// [END maps_place_class]
export { };
export { };