From 3a51ea70da4144fe334996d28098d2a996970e8e Mon Sep 17 00:00:00 2001 From: William French Date: Tue, 28 Nov 2023 12:25:03 -0800 Subject: [PATCH] fix: Adds ts-ignore comments for pre-release features, to prevent type errors. (#1625) Change-Id: If8568ccb04a71a12fef548e000408c1cce302c6e --- samples/boundaries-text-search/index.ts | 1 + samples/place-autocomplete-element/index.ts | 3 +++ samples/place-autocomplete-map/index.ts | 3 +++ 3 files changed, 7 insertions(+) diff --git a/samples/boundaries-text-search/index.ts b/samples/boundaries-text-search/index.ts index 06f76cdd9f..a545ffcd95 100644 --- a/samples/boundaries-text-search/index.ts +++ b/samples/boundaries-text-search/index.ts @@ -36,6 +36,7 @@ async function findBoundary() { }; const { Place } = await google.maps.importLibrary("places") as google.maps.PlacesLibrary; + //@ts-ignore const { places } = await Place.searchByText(request); if (places.length) { diff --git a/samples/place-autocomplete-element/index.ts b/samples/place-autocomplete-element/index.ts index 9cc0006b18..d400dec230 100644 --- a/samples/place-autocomplete-element/index.ts +++ b/samples/place-autocomplete-element/index.ts @@ -13,7 +13,9 @@ async function initMap(): Promise { google.maps.importLibrary("places"), ]); // Create the input HTML element, and append it. + //@ts-ignore const placeAutocomplete = new google.maps.places.PlaceAutocompleteElement(); + //@ts-ignore document.body.appendChild(placeAutocomplete); // [END maps_place_autocomplete_element_add] @@ -28,6 +30,7 @@ async function initMap(): Promise { // [START maps_place_autocomplete_element_listener] // Add the gmp-placeselect listener, and display the results. + //@ts-ignore placeAutocomplete.addEventListener('gmp-placeselect', async ({ place }) => { await place.fetchFields({ fields: ['displayName', 'formattedAddress', 'location'] }); diff --git a/samples/place-autocomplete-map/index.ts b/samples/place-autocomplete-map/index.ts index 85eddef1b1..4924a07535 100644 --- a/samples/place-autocomplete-map/index.ts +++ b/samples/place-autocomplete-map/index.ts @@ -26,9 +26,11 @@ async function initMap(): Promise { // [START maps_place_autocomplete_map_add] //@ts-ignore const placeAutocomplete = new google.maps.places.PlaceAutocompleteElement(); + //@ts-ignore placeAutocomplete.id = 'place-autocomplete-input'; const card = document.getElementById('place-autocomplete-card') as HTMLElement; + //@ts-ignore card.appendChild(placeAutocomplete); map.controls[google.maps.ControlPosition.TOP_LEFT].push(card); // [END maps_place_autocomplete_map_add] @@ -42,6 +44,7 @@ async function initMap(): Promise { // [START maps_place_autocomplete_map_listener] // Add the gmp-placeselect listener, and display the results on the map. + //@ts-ignore placeAutocomplete.addEventListener('gmp-placeselect', async ({ place }) => { await place.fetchFields({ fields: ['displayName', 'formattedAddress', 'location'] });