Skip to content

Commit 09b6638

Browse files
Update dist folder [skip ci] (#282)
Co-authored-by: googlemaps-bot <[email protected]>
1 parent c24c38c commit 09b6638

File tree

15 files changed

+68
-57
lines changed

15 files changed

+68
-57
lines changed

dist/samples/ui-kit-place-search/app/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<script type="module" src="./index.js"></script>
1414
</head>
1515
<body>
16-
<h1>Place List Nearby Search with Google Maps</h1>
1716
<!--[START maps_ui_kit_place_search_map] -->
1817
<gmp-map center="-37.813,144.963" zoom="10" map-id="DEMO_MAP_ID">
1918
<div class="overlay" slot="control-inline-start-block-start">

dist/samples/ui-kit-place-search/app/index.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,24 @@ const placeDetails = document.querySelector("gmp-place-details") as any;
1212
let marker = document.querySelector('gmp-advanced-marker') as any;
1313
/* [END maps_ui_kit_place_search_query_selectors] */
1414
let markers = {};
15-
let infowindow;
15+
let infoWindow;
1616
let mapCenter;
1717

1818
async function initMap(): Promise<void> {
1919
await google.maps.importLibrary("places");
2020
const { InfoWindow } = await google.maps.importLibrary("maps") as google.maps.MapsLibrary;
2121
const { spherical } = await google.maps.importLibrary("geometry") as google.maps.GeometryLibrary;
2222

23-
infowindow = new google.maps.InfoWindow;
23+
infoWindow = new google.maps.InfoWindow;
2424

2525
function getContainingCircle(bounds) {
2626
const diameter = spherical.computeDistanceBetween(
2727
bounds.getNorthEast(),
2828
bounds.getSouthWest()
2929
);
30-
return { center: bounds.getCenter(), radius: diameter / 2 };
30+
const calculatedRadius = diameter / 2;
31+
const cappedRadius = Math.min(calculatedRadius, 50000); // Cap the radius to avoid an error.
32+
return { center: bounds.getCenter(), radius: cappedRadius };
3133
}
3234

3335
findCurrentLocation();
@@ -41,7 +43,6 @@ async function initMap(): Promise<void> {
4143
typeSelect.addEventListener("change", (event) => {
4244
// First remove all existing markers.
4345
for(marker in markers){
44-
console.log(marker);
4546
markers[marker].map = null;
4647
}
4748
markers = {};
@@ -53,7 +54,7 @@ async function initMap(): Promise<void> {
5354
),
5455
includedPrimaryTypes: [typeSelect.value],
5556
}).then(addMarkers);
56-
57+
// Handle user selection in Place Details.
5758
placeList.addEventListener("gmp-placeselect", ({ place }) => {
5859
markers[place.id].click();
5960
});
@@ -79,20 +80,20 @@ async function addMarkers(){
7980
bounds.extend(place.location);
8081

8182
marker.addListener('gmp-click',(event) => {
82-
if(infowindow.isOpen){
83-
infowindow.close();
83+
if(infoWindow.isOpen){
84+
infoWindow.close();
8485
}
8586
placeDetails.configureFromPlace(place);
8687
placeDetails.style.width = "350px";
87-
infowindow.setOptions({
88+
infoWindow.setOptions({
8889
content: placeDetails
8990
});
90-
infowindow.open({
91+
infoWindow.open({
9192
anchor: marker,
9293
map: map.innerMap
9394
});
9495
placeDetails.addEventListener('gmp-load',() => {
95-
map.innerMap.fitBounds(place.viewport, {top: placeDetails.offsetHeight || 206, left: 200});
96+
map.innerMap.fitBounds(place.viewport, { top: 400, left: 200 });
9697
});
9798

9899
});

dist/samples/ui-kit-place-search/app/style.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ html,
2424
gmp-map {
2525
box-sizing: border-box;
2626
padding: 0 20px 20px;
27+
height: 600px;
2728
}
2829

2930
.overlay {
31+
position: relative;
32+
top: 40px;
3033
margin: 20px;
3134
width: 400px;
3235
}
@@ -55,7 +58,7 @@ html,
5558
}
5659

5760
.list-container {
58-
height: 600px;
61+
height: 400px;
5962
overflow: auto;
6063
border-radius: 10px;
6164
}

dist/samples/ui-kit-place-search/dist/assets/index-4cFOkOyn.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/samples/ui-kit-place-search/dist/assets/index-BaQItlwa.css

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/samples/ui-kit-place-search/dist/assets/index-BmKxyk8Z.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/samples/ui-kit-place-search/dist/assets/index-lUDwP8WY.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/samples/ui-kit-place-search/dist/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
<head>
1010
<title>Place List Nearby Search with Google Maps</title>
1111
<meta charset="utf-8">
12-
<script type="module" crossorigin src="./assets/index-BmKxyk8Z.js"></script>
13-
<link rel="stylesheet" crossorigin href="./assets/index-BaQItlwa.css">
12+
<script type="module" crossorigin src="./assets/index-4cFOkOyn.js"></script>
13+
<link rel="stylesheet" crossorigin href="./assets/index-lUDwP8WY.css">
1414
</head>
1515
<body>
16-
<h1>Place List Nearby Search with Google Maps</h1>
1716
<!--[START maps_ui_kit_place_search_map] -->
1817
<gmp-map center="-37.813,144.963" zoom="10" map-id="DEMO_MAP_ID">
1918
<div class="overlay" slot="control-inline-start-block-start">

dist/samples/ui-kit-place-search/docs/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<script type="module" src="./index.js"></script>
1414
</head>
1515
<body>
16-
<h1>Place List Nearby Search with Google Maps</h1>
1716
<!--[START maps_ui_kit_place_search_map] -->
1817
<gmp-map center="-37.813,144.963" zoom="10" map-id="DEMO_MAP_ID">
1918
<div class="overlay" slot="control-inline-start-block-start">

dist/samples/ui-kit-place-search/docs/index.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ const placeDetails = document.querySelector("gmp-place-details");
1212
let marker = document.querySelector('gmp-advanced-marker');
1313
/* [END maps_ui_kit_place_search_query_selectors] */
1414
let markers = {};
15-
let infowindow;
15+
let infoWindow;
1616
let mapCenter;
1717
async function initMap() {
1818
await google.maps.importLibrary("places");
1919
const { InfoWindow } = await google.maps.importLibrary("maps");
2020
const { spherical } = await google.maps.importLibrary("geometry");
21-
infowindow = new google.maps.InfoWindow;
21+
infoWindow = new google.maps.InfoWindow;
2222
function getContainingCircle(bounds) {
2323
const diameter = spherical.computeDistanceBetween(bounds.getNorthEast(), bounds.getSouthWest());
24-
return { center: bounds.getCenter(), radius: diameter / 2 };
24+
const calculatedRadius = diameter / 2;
25+
const cappedRadius = Math.min(calculatedRadius, 50000); // Cap the radius to avoid an error.
26+
return { center: bounds.getCenter(), radius: cappedRadius };
2527
}
2628
findCurrentLocation();
2729
map.innerMap.setOptions({
@@ -32,7 +34,6 @@ async function initMap() {
3234
typeSelect.addEventListener("change", (event) => {
3335
// First remove all existing markers.
3436
for (marker in markers) {
35-
console.log(marker);
3637
markers[marker].map = null;
3738
}
3839
markers = {};
@@ -41,6 +42,7 @@ async function initMap() {
4142
locationRestriction: getContainingCircle(map.innerMap.getBounds()),
4243
includedPrimaryTypes: [typeSelect.value],
4344
}).then(addMarkers);
45+
// Handle user selection in Place Details.
4446
placeList.addEventListener("gmp-placeselect", ({ place }) => {
4547
markers[place.id].click();
4648
});
@@ -61,20 +63,20 @@ async function addMarkers() {
6163
markers[place.id] = marker;
6264
bounds.extend(place.location);
6365
marker.addListener('gmp-click', (event) => {
64-
if (infowindow.isOpen) {
65-
infowindow.close();
66+
if (infoWindow.isOpen) {
67+
infoWindow.close();
6668
}
6769
placeDetails.configureFromPlace(place);
6870
placeDetails.style.width = "350px";
69-
infowindow.setOptions({
71+
infoWindow.setOptions({
7072
content: placeDetails
7173
});
72-
infowindow.open({
74+
infoWindow.open({
7375
anchor: marker,
7476
map: map.innerMap
7577
});
7678
placeDetails.addEventListener('gmp-load', () => {
77-
map.innerMap.fitBounds(place.viewport, { top: placeDetails.offsetHeight || 206, left: 200 });
79+
map.innerMap.fitBounds(place.viewport, { top: 400, left: 200 });
7880
});
7981
});
8082
map.innerMap.setCenter(bounds.getCenter());

0 commit comments

Comments
 (0)