Skip to content

Commit fa6ce36

Browse files
authored
fix: Renames demo; minor CSS change. (#395)
1 parent 89b4fcc commit fa6ce36

File tree

7 files changed

+32
-29
lines changed

7 files changed

+32
-29
lines changed
File renamed without changes.

samples/ui-kit-place-search/index.html renamed to samples/ui-kit-place-search-nearby/index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Copyright 2025 Google LLC. All Rights Reserved.
44
SPDX-License-Identifier: Apache-2.0
55
-->
6-
<!--[START maps_ui_kit_place_search] -->
6+
<!--[START maps_ui_kit_place_search_nearby] -->
77
<!DOCTYPE html>
88
<html>
99
<head>
@@ -13,7 +13,7 @@
1313
<script type="module" src="./index.js"></script>
1414
</head>
1515
<body>
16-
<!--[START maps_ui_kit_place_search_map] -->
16+
<!--[START maps_ui_kit_place_search_nearby_map] -->
1717
<gmp-map center="-37.813,144.963" zoom="10" map-id="DEMO_MAP_ID">
1818
<div class="overlay" slot="control-inline-start-block-start">
1919
<div class="controls">
@@ -30,11 +30,13 @@
3030
<gmp-place-list selectable></gmp-place-list>
3131
</div>
3232
</div>
33-
<gmp-place-details size="large"></gmp-place-details>
3433
</gmp-map>
35-
<!--[END maps_ui_kit_place_search_map] -->
34+
35+
<gmp-place-details size="large"></gmp-place-details>
36+
37+
<!--[END maps_ui_kit_place_search_nearby_map] -->
3638
<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))})
3739
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "alpha"});</script>
3840
</body>
3941
</html>
40-
<!--[END maps_ui_kit_place_search] -->
42+
<!--[END maps_ui_kit_place_search_nearby] -->

samples/ui-kit-place-search/index.ts renamed to samples/ui-kit-place-search-nearby/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* Copyright 2025 Google LLC. All Rights Reserved.
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
/* [START maps_ui_kit_place_search] */
7-
/* [START maps_ui_kit_place_search_query_selectors] */
6+
/* [START maps_ui_kit_place_search_nearby] */
7+
/* [START maps_ui_kit_place_search_nearby_query_selectors] */
88
const map = document.querySelector("gmp-map") as any;
99
const placeList = document.querySelector("gmp-place-list") as any;
1010
const typeSelect = document.querySelector(".type-select") as any;
1111
const placeDetails = document.querySelector("gmp-place-details") as any;
1212
let marker = document.querySelector('gmp-advanced-marker') as any;
13-
/* [END maps_ui_kit_place_search_query_selectors] */
13+
/* [END maps_ui_kit_place_search_nearby_query_selectors] */
1414
let markers = {};
1515
let infoWindow;
1616
let mapCenter;
@@ -39,7 +39,7 @@ async function initMap(): Promise<void> {
3939
clickableIcons: false,
4040
});
4141

42-
/* [START maps_ui_kit_place_search_event] */
42+
/* [START maps_ui_kit_place_search_nearby_event] */
4343
typeSelect.addEventListener("change", (event) => {
4444
// First remove all existing markers.
4545
for(marker in markers){
@@ -60,7 +60,7 @@ async function initMap(): Promise<void> {
6060
});
6161
}
6262
});
63-
/* [END maps_ui_kit_place_search_event] */
63+
/* [END maps_ui_kit_place_search_nearby_event] */
6464
}
6565

6666
async function addMarkers(){
@@ -125,4 +125,4 @@ async function findCurrentLocation(){
125125
}
126126

127127
initMap();
128-
/* [END maps_ui_kit_place_search] */
128+
/* [END maps_ui_kit_place_search_nearby] */
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@js-api-samples/ui-kit-place-search-nearby-nearby",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "tsc && bash ../jsfiddle.sh ui-kit-place-search-nearby && bash ../app.sh ui-kit-place-search-nearby && bash ../docs.sh ui-kit-place-search-nearby && npm run build:vite --workspace=. && bash ../dist.sh ui-kit-place-search-nearby",
6+
"test": "tsc && npm run build:vite --workspace=.",
7+
"start": "tsc && vite build --base './' && vite",
8+
"build:vite": "vite build --base './'",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
13+
}
14+
}
15+

samples/ui-kit-place-search/style.css renamed to samples/ui-kit-place-search-nearby/style.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright 2025 Google LLC. All Rights Reserved.
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
/* [START maps_ui_kit_place_search] */
6+
/* [START maps_ui_kit_place_search_nearby] */
77
html,
88
body {
99
height: 100%;
@@ -17,7 +17,7 @@ html,
1717
}
1818

1919
h1 {
20-
font-size: 16px;
20+
font-size: large;
2121
text-align: center;
2222
}
2323

@@ -64,5 +64,6 @@ html,
6464

6565
gmp-place-list {
6666
background-color: #fff;
67+
font-size: large
6768
}
68-
/* [END maps_ui_kit_place_search] */
69+
/* [END maps_ui_kit_place_search_nearby] */
File renamed without changes.

samples/ui-kit-place-search/package.json

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

0 commit comments

Comments
 (0)