From 9fe576451feb765661942c12865327f62360bfbb Mon Sep 17 00:00:00 2001 From: William French Date: Wed, 24 Apr 2024 08:47:44 -0700 Subject: [PATCH] fix: Removes exclusion tags, changes to use DEMO_MAP_ID (#1697) * fix: Removes exclusion tags, changes to use DEMO_MAP_ID Problem: The example map had used a custom reduced-POI map ID; a subsequent request was made to obscure the map ID parameter to avoid exposing the custom map ID. The example works when users link to JS Fiddle using the buttons, but if the code is copied and pasted it won't work. Solution: Get rid of the custom map ID and use DEMO_MAP_ID; remove the exclude tag which hides the needed map ID parameter. This fix is in response to b/316906523 * Adds type declaration to bounds.extend Changes ln. 60 to include type declaration. * Adds type declaration for bounds.extend Updates ln. 65 to include a type declaration for bounds.extend. --- samples/place-nearby-search/index.ts | 2 +- samples/place-text-search/index.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/samples/place-nearby-search/index.ts b/samples/place-nearby-search/index.ts index ecf6acfaf7..a17c4d74f7 100644 --- a/samples/place-nearby-search/index.ts +++ b/samples/place-nearby-search/index.ts @@ -62,7 +62,7 @@ async function nearbySearch() { title: place.displayName, }); - bounds.extend(place.location); + bounds.extend(place.location as google.maps.LatLng); console.log(place); }); diff --git a/samples/place-text-search/index.ts b/samples/place-text-search/index.ts index 8a879e0282..57da84cccb 100644 --- a/samples/place-text-search/index.ts +++ b/samples/place-text-search/index.ts @@ -16,9 +16,7 @@ async function initMap() { map = new Map(document.getElementById('map') as HTMLElement, { center: center, zoom: 11, - // [START_EXCLUDE] - mapId: '4504f8b37365c3d0', - // [END_EXCLUDE] + mapId: 'DEMO_MAP_ID', }); findPlaces(); @@ -59,7 +57,7 @@ async function findPlaces() { title: place.displayName, }); - bounds.extend(place.location); + bounds.extend(place.location as google.maps.LatLng); console.log(place); });