Skip to content

Commit

Permalink
fix: Removes exclusion tags, changes to use DEMO_MAP_ID (#1697)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
willum070 committed Apr 24, 2024
1 parent 5991c43 commit 9fe5764
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion samples/place-nearby-search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
6 changes: 2 additions & 4 deletions samples/place-text-search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
});

Expand Down

0 comments on commit 9fe5764

Please sign in to comment.