Skip to content

Commit

Permalink
fix: Adds ts-ignore comments for pre-release features, to prevent typ…
Browse files Browse the repository at this point in the history
…e errors. (#1625)

Change-Id: If8568ccb04a71a12fef548e000408c1cce302c6e
  • Loading branch information
willum070 authored Nov 28, 2023
1 parent 9f71130 commit 3a51ea7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/boundaries-text-search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions samples/place-autocomplete-element/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ async function initMap(): Promise<void> {
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]

Expand All @@ -28,6 +30,7 @@ async function initMap(): Promise<void> {

// [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'] });

Expand Down
3 changes: 3 additions & 0 deletions samples/place-autocomplete-map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ async function initMap(): Promise<void> {
// [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]
Expand All @@ -42,6 +44,7 @@ async function initMap(): Promise<void> {

// [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'] });

Expand Down

0 comments on commit 3a51ea7

Please sign in to comment.