Skip to content

Commit 3316a10

Browse files
Update dist folder [skip ci] (#446)
1 parent 469e679 commit 3316a10

File tree

11 files changed

+90
-48
lines changed

11 files changed

+90
-48
lines changed

dist/samples/ui-kit-place-details-compact/app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</gmp-map>
3636
<!--[END maps_ui_kit_place_details_compact_container]-->
3737
<script>(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})
38-
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "beta"});</script>
38+
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "weekly"});</script>
3939
</body>
4040
</html>
4141
<!--[END maps_ui_kit_place_details_compact] -->

dist/samples/ui-kit-place-details-compact/dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</gmp-map>
3636
<!--[END maps_ui_kit_place_details_compact_container]-->
3737
<script>(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})
38-
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "beta"});</script>
38+
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "weekly"});</script>
3939
</body>
4040
</html>
4141
<!--[END maps_ui_kit_place_details_compact] -->

dist/samples/ui-kit-place-details-compact/docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</gmp-map>
3636
<!--[END maps_ui_kit_place_details_compact_container]-->
3737
<script>(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})
38-
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "beta"});</script>
38+
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "weekly"});</script>
3939
</body>
4040
</html>
4141
<!--[END maps_ui_kit_place_details_compact] -->

dist/samples/ui-kit-place-details-compact/jsfiddle/demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</gmp-map>
3636

3737
<script>(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})
38-
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "beta"});</script>
38+
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "weekly"});</script>
3939
</body>
4040
</html>
4141

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

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,21 @@ async function initMap(): Promise<void> {
2323
// Hide the map type control.
2424
map.innerMap.setOptions({mapTypeControl: false});
2525

26+
// Function to update map and marker based on place details
27+
const updateMapAndMarker = () => {
28+
if (placeDetails.place && placeDetails.place.location) {
29+
let adjustedCenter = offsetLatLngRight(placeDetails.place.location, -0.005);
30+
map.innerMap.panTo(adjustedCenter);
31+
map.innerMap.setZoom(16); // Set zoom after panning if needed
32+
marker.position = placeDetails.place.location;
33+
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
34+
marker.style.display = 'block';
35+
}
36+
};
37+
2638
// Set up map once widget is loaded.
2739
placeDetails.addEventListener('gmp-load', (event) => {
28-
map.innerMap.panTo(placeDetails.place.location);
29-
map.innerMap.setZoom(16); // Set zoom after panning if needed
30-
marker.position = placeDetails.place.location;
31-
marker.style.display = 'block';
32-
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
40+
updateMapAndMarker();
3341
});
3442

3543
/* [START maps_ui_kit_place_details_event] */
@@ -40,18 +48,21 @@ async function initMap(): Promise<void> {
4048
if (event.placeId) {
4149
// Fire when the user clicks a POI.
4250
placeDetailsRequest.place = event.placeId;
51+
updateMapAndMarker();
4352
} else {
4453
// Fire when the user clicks the map (not on a POI).
4554
console.log('No place was selected.');
55+
marker.style.display = 'none';
4656
}
47-
48-
// Show the marker at the selected place.
49-
marker.position = placeDetails.place.location;
50-
marker.style.display = 'block';
51-
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
5257
});
5358
}
5459
/* [END maps_ui_kit_place_details_event] */
5560

61+
// Helper function to offset marker placement for better visual appearance.
62+
function offsetLatLngRight(latLng, longitudeOffset) {
63+
const newLng = latLng.lng() + longitudeOffset;
64+
return new google.maps.LatLng(latLng.lat(), newLng);
65+
}
66+
5667
initMap();
5768
/* [END maps_ui_kit_place_details] */

dist/samples/ui-kit-place-details/dist/assets/index-CxuERdVQ.js

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

dist/samples/ui-kit-place-details/dist/assets/index-Daq7ltsZ.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-details/dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<head>
1010
<title>Click on the map to view place details</title>
1111
<meta charset="utf-8">
12-
<script type="module" crossorigin src="./assets/index-CxuERdVQ.js"></script>
12+
<script type="module" crossorigin src="./assets/index-Daq7ltsZ.js"></script>
1313
<link rel="stylesheet" crossorigin href="./assets/index-DAWyXXsz.css">
1414
</head>
1515
<body>

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

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,20 @@ async function initMap() {
2020
await google.maps.importLibrary("places");
2121
// Hide the map type control.
2222
map.innerMap.setOptions({ mapTypeControl: false });
23+
// Function to update map and marker based on place details
24+
const updateMapAndMarker = () => {
25+
if (placeDetails.place && placeDetails.place.location) {
26+
let adjustedCenter = offsetLatLngRight(placeDetails.place.location, -0.005);
27+
map.innerMap.panTo(adjustedCenter);
28+
map.innerMap.setZoom(16); // Set zoom after panning if needed
29+
marker.position = placeDetails.place.location;
30+
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
31+
marker.style.display = 'block';
32+
}
33+
};
2334
// Set up map once widget is loaded.
2435
placeDetails.addEventListener('gmp-load', (event) => {
25-
map.innerMap.panTo(placeDetails.place.location);
26-
map.innerMap.setZoom(16); // Set zoom after panning if needed
27-
marker.position = placeDetails.place.location;
28-
marker.style.display = 'block';
29-
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
36+
updateMapAndMarker();
3037
});
3138
/* [START maps_ui_kit_place_details_event] */
3239
// Add an event listener to handle clicks.
@@ -36,17 +43,20 @@ async function initMap() {
3643
if (event.placeId) {
3744
// Fire when the user clicks a POI.
3845
placeDetailsRequest.place = event.placeId;
46+
updateMapAndMarker();
3947
}
4048
else {
4149
// Fire when the user clicks the map (not on a POI).
4250
console.log('No place was selected.');
51+
marker.style.display = 'none';
4352
}
44-
// Show the marker at the selected place.
45-
marker.position = placeDetails.place.location;
46-
marker.style.display = 'block';
47-
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
4853
});
4954
}
5055
/* [END maps_ui_kit_place_details_event] */
56+
// Helper function to offset marker placement for better visual appearance.
57+
function offsetLatLngRight(latLng, longitudeOffset) {
58+
const newLng = latLng.lng() + longitudeOffset;
59+
return new google.maps.LatLng(latLng.lat(), newLng);
60+
}
5161
initMap();
5262
/* [END maps_ui_kit_place_details] */

dist/samples/ui-kit-place-details/docs/index.ts

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,21 @@ async function initMap(): Promise<void> {
2323
// Hide the map type control.
2424
map.innerMap.setOptions({mapTypeControl: false});
2525

26+
// Function to update map and marker based on place details
27+
const updateMapAndMarker = () => {
28+
if (placeDetails.place && placeDetails.place.location) {
29+
let adjustedCenter = offsetLatLngRight(placeDetails.place.location, -0.005);
30+
map.innerMap.panTo(adjustedCenter);
31+
map.innerMap.setZoom(16); // Set zoom after panning if needed
32+
marker.position = placeDetails.place.location;
33+
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
34+
marker.style.display = 'block';
35+
}
36+
};
37+
2638
// Set up map once widget is loaded.
2739
placeDetails.addEventListener('gmp-load', (event) => {
28-
map.innerMap.panTo(placeDetails.place.location);
29-
map.innerMap.setZoom(16); // Set zoom after panning if needed
30-
marker.position = placeDetails.place.location;
31-
marker.style.display = 'block';
32-
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
40+
updateMapAndMarker();
3341
});
3442

3543
/* [START maps_ui_kit_place_details_event] */
@@ -40,18 +48,21 @@ async function initMap(): Promise<void> {
4048
if (event.placeId) {
4149
// Fire when the user clicks a POI.
4250
placeDetailsRequest.place = event.placeId;
51+
updateMapAndMarker();
4352
} else {
4453
// Fire when the user clicks the map (not on a POI).
4554
console.log('No place was selected.');
55+
marker.style.display = 'none';
4656
}
47-
48-
// Show the marker at the selected place.
49-
marker.position = placeDetails.place.location;
50-
marker.style.display = 'block';
51-
marker.collisionBehavior = google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;
5257
});
5358
}
5459
/* [END maps_ui_kit_place_details_event] */
5560

61+
// Helper function to offset marker placement for better visual appearance.
62+
function offsetLatLngRight(latLng, longitudeOffset) {
63+
const newLng = latLng.lng() + longitudeOffset;
64+
return new google.maps.LatLng(latLng.lat(), newLng);
65+
}
66+
5667
initMap();
5768
/* [END maps_ui_kit_place_details] */

0 commit comments

Comments
 (0)