diff --git a/samples/place-autocomplete-element/index.ts b/samples/place-autocomplete-element/index.ts index da78965b5a..43e613e5cd 100644 --- a/samples/place-autocomplete-element/index.ts +++ b/samples/place-autocomplete-element/index.ts @@ -15,7 +15,8 @@ async function initMap(): Promise { // Create the input HTML element, and append it. const input = document.createElement('input'); const pac = new google.maps.places.PlaceAutocompleteElement({ inputElement: input }); - document.body.appendChild(pac.element as HTMLElement); + //@ts-ignore + document.body.appendChild(pac); // [END maps_place_autocomplete_element_add] // Inject HTML UI. @@ -29,7 +30,8 @@ async function initMap(): Promise { // [START maps_place_autocomplete_element_listener] // Add the gmp-placeselect listener, and display the results. - pac.addListener('gmp-placeselect', async ({ place }) => { + //@ts-ignore + pac.addEventListener('gmp-placeselect', async ({ place }) => { await place.fetchFields({ fields: ['displayName', 'formattedAddress', 'location'] }); selectedPlaceTitle.textContent = 'Selected Place:'; diff --git a/samples/place-autocomplete-map/index.ts b/samples/place-autocomplete-map/index.ts index 123f2fed88..b3a02b76c1 100644 --- a/samples/place-autocomplete-map/index.ts +++ b/samples/place-autocomplete-map/index.ts @@ -31,7 +31,8 @@ async function initMap(): Promise { const pac = new google.maps.places.PlaceAutocompleteElement({ inputElement: input }); const card = document.getElementById('pac-card') as HTMLElement; - card.appendChild(pac.element as HTMLElement); + //@ts-ignore + card.appendChild(pac); map.controls[google.maps.ControlPosition.TOP_LEFT].push(card); // [END maps_place_autocomplete_map_add] @@ -44,7 +45,8 @@ async function initMap(): Promise { // [START maps_place_autocomplete_map_listener] // Add the gmp-placeselect listener, and display the results on the map. - pac.addListener('gmp-placeselect', async ({ place }) => { + //@ts-ignore + pac.addEventListener('gmp-placeselect', async ({ place }) => { await place.fetchFields({ fields: ['displayName', 'formattedAddress', 'location'] }); // If the place has a geometry, then present it on a map.