Skip to content

Commit 1127dad

Browse files
authored
Merge branch 'main' into pkit-text
2 parents 1bea143 + 571cbef commit 1127dad

File tree

27 files changed

+809
-853
lines changed

27 files changed

+809
-853
lines changed

dist/samples/js-api-loader-map/dist/assets/index-CtsZJvLO.js renamed to dist/samples/js-api-loader-map/dist/assets/index-t3cVcvuX.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/samples/js-api-loader-map/dist/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<!--
33
@license
4-
Copyright 2019 Google LLC. All Rights Reserved.
4+
Copyright 2025 Google LLC. All Rights Reserved.
55
SPDX-License-Identifier: Apache-2.0
66
-->
77
<!-- [START maps_js_api_loader_map] -->
@@ -10,7 +10,7 @@
1010
<title>@googlemaps/js-api-loader map</title>
1111
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
1212
<meta charset="utf-8">
13-
<script type="module" crossorigin src="./assets/index-CtsZJvLO.js"></script>
13+
<script type="module" crossorigin src="./assets/index-t3cVcvuX.js"></script>
1414
<link rel="stylesheet" crossorigin href="./assets/index-Wl6o4y82.css">
1515
</head>
1616
<body>

dist/samples/js-api-loader-map/docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<!--
33
@license
4-
Copyright 2019 Google LLC. All Rights Reserved.
4+
Copyright 2025 Google LLC. All Rights Reserved.
55
SPDX-License-Identifier: Apache-2.0
66
-->
77
<!-- [START maps_js_api_loader_map] -->
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
/**
22
* @license
3-
* Copyright 2019 Google LLC. All Rights Reserved.
3+
* Copyright 2025 Google LLC. All Rights Reserved.
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66
// [START maps_js_api_loader_map]
7-
import { setOptions, importLibrary } from "@googlemaps/js-api-loader";
8-
const API_KEY = "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8";
7+
// [START maps_js_api_loader_map_load]
8+
// Import the needed libraries.
9+
import { setOptions, importLibrary } from '@googlemaps/js-api-loader';
10+
// [END maps_js_api_loader_map_load]
11+
const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8';
912
async function initMap() {
10-
setOptions({ key: API_KEY });
11-
const { Map } = await importLibrary("maps");
13+
// [START maps_js_api_loader_map_options]
14+
// Set loader options.
15+
setOptions({
16+
key: API_KEY,
17+
v: 'weekly',
18+
});
19+
// [END maps_js_api_loader_map_options]
20+
// Load the Maps library.
21+
const { Map } = (await importLibrary('maps'));
22+
// Set map options.
1223
const mapOptions = {
1324
center: { lat: 48.8566, lng: 2.3522 },
1425
zoom: 3,
1526
};
16-
const map = new Map(document.getElementById("map"), mapOptions);
27+
// Declare the map.
28+
const map = new Map(document.getElementById('map'), mapOptions);
1729
}
1830
initMap();
1931
// [END maps_js_api_loader_map]
Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
/**
22
* @license
3-
* Copyright 2019 Google LLC. All Rights Reserved.
3+
* Copyright 2025 Google LLC. All Rights Reserved.
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

77
// [START maps_js_api_loader_map]
8-
import { setOptions, importLibrary } from "@googlemaps/js-api-loader";
8+
// [START maps_js_api_loader_map_load]
9+
// Import the needed libraries.
10+
import { setOptions, importLibrary } from '@googlemaps/js-api-loader';
11+
// [END maps_js_api_loader_map_load]
912

10-
const API_KEY = "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8";
13+
const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8';
1114

1215
async function initMap(): Promise<void> {
13-
setOptions({ key: API_KEY });
14-
15-
const { Map } = await importLibrary("maps") as google.maps.MapsLibrary;
16-
17-
const mapOptions = {
18-
center: { lat: 48.8566, lng: 2.3522 },
19-
zoom: 3,
20-
};
21-
22-
const map = new Map(document.getElementById("map") as HTMLElement, mapOptions);
23-
16+
// [START maps_js_api_loader_map_options]
17+
// Set loader options.
18+
setOptions({
19+
key: API_KEY,
20+
v: 'weekly',
21+
});
22+
// [END maps_js_api_loader_map_options]
23+
24+
// Load the Maps library.
25+
const { Map } = (await importLibrary('maps')) as google.maps.MapsLibrary;
26+
27+
// Set map options.
28+
const mapOptions = {
29+
center: { lat: 48.8566, lng: 2.3522 },
30+
zoom: 3,
31+
};
32+
33+
// Declare the map.
34+
const map = new Map(
35+
document.getElementById('map') as HTMLElement,
36+
mapOptions
37+
);
2438
}
2539

2640
initMap();
27-
// [END maps_js_api_loader_map]
41+
// [END maps_js_api_loader_map]

dist/samples/js-api-loader-map/docs/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2019 Google LLC. All Rights Reserved.
3+
* Copyright 2025 Google LLC. All Rights Reserved.
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66
/* [START maps_js_api_loader_map] */

dist/samples/js-api-loader-map/jsfiddle/demo.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2019 Google LLC. All Rights Reserved.
3+
* Copyright 2025 Google LLC. All Rights Reserved.
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

dist/samples/js-api-loader-map/jsfiddle/demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<!--
33
@license
4-
Copyright 2019 Google LLC. All Rights Reserved.
4+
Copyright 2025 Google LLC. All Rights Reserved.
55
SPDX-License-Identifier: Apache-2.0
66
-->
77

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
/**
22
* @license
3-
* Copyright 2019 Google LLC. All Rights Reserved.
3+
* Copyright 2025 Google LLC. All Rights Reserved.
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import { setOptions, importLibrary } from "@googlemaps/js-api-loader";
8-
const API_KEY = "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8";
7+
8+
// Import the needed libraries.
9+
import { setOptions, importLibrary } from '@googlemaps/js-api-loader';
10+
11+
const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8';
912
async function initMap() {
10-
setOptions({ key: API_KEY });
11-
const { Map } = await importLibrary("maps");
13+
14+
// Set loader options.
15+
setOptions({
16+
key: API_KEY,
17+
v: 'weekly',
18+
});
19+
20+
// Load the Maps library.
21+
const { Map } = (await importLibrary('maps'));
22+
// Set map options.
1223
const mapOptions = {
1324
center: { lat: 48.8566, lng: 2.3522 },
1425
zoom: 3,
1526
};
16-
const map = new Map(document.getElementById("map"), mapOptions);
27+
// Declare the map.
28+
const map = new Map(document.getElementById('map'), mapOptions);
1729
}
1830
initMap();
1931

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

Lines changed: 58 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,81 +4,78 @@
44
SPDX-License-Identifier: Apache-2.0
55
-->
66
<!--[START maps_ui_kit_place_search_text] -->
7-
<!doctype html>
7+
<!DOCTYPE html>
88
<html>
99
<head>
10-
<title>Place List Text Search with Google Maps</title>
10+
<title>Place Text Search with Google Maps</title>
1111
<meta charset="utf-8" />
1212
<link rel="stylesheet" type="text/css" href="style.css" />
13-
<script type="module" src="./index.js"></script>
13+
<script type="module" src="./index.js" defer></script>
14+
<!-- prettier-ignore -->
15+
<script>
16+
(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))})
17+
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "weekly"});
18+
</script>
1419
</head>
1520
<body>
1621
<!--[START maps_ui_kit_place_search_text_map] -->
17-
<gmp-map center="37.395641,-122.077627" zoom="10" map-id="DEMO_MAP_ID">
18-
<div class="overlay" slot="control-inline-start-block-start">
19-
<div class="text-search-container">
22+
23+
<div class="container">
24+
<div class="ui-panel">
25+
<div class="controls">
2026
<input
2127
type="text"
22-
id="textSearchInput"
23-
placeholder="Enter text search..." />
24-
<button id="textSearchButton">Search</button>
28+
id="query-input"
29+
class="query-input"
30+
placeholder="Search for a place"
31+
value="cafe" />
32+
<button id="search-button" class="search-button">
33+
Search
34+
</button>
2535
</div>
2636
<div class="list-container">
27-
<gmp-place-list
28-
selectable
29-
style="display: none"></gmp-place-list>
37+
<gmp-place-search selectable>
38+
<gmp-place-all-content></gmp-place-all-content>
39+
<gmp-place-text-search-request
40+
max-result-count="5"></gmp-place-text-search-request>
41+
</gmp-place-search>
3042
</div>
3143
</div>
32-
<gmp-place-details style="display: none">
33-
<gmp-place-details-place-request></gmp-place-details-place-request>
34-
<gmp-place-all-content></gmp-place-all-content>
35-
</gmp-place-details>
36-
</gmp-map>
44+
<!-- map-id is required to use advanced markers. See https://developers.google.com/maps/documentation/javascript/map-ids/mapid-over. -->
45+
<gmp-map center="-37.813,144.963" zoom="16" map-id="DEMO_MAP_ID">
46+
</gmp-map>
47+
</div>
48+
49+
<!--
50+
The gmp-place-details-compact element is styled inline because it is
51+
conditionally rendered and moved into the info window, which is
52+
part of the map's shadow DOM.
53+
-->
54+
<gmp-place-details-compact
55+
orientation="horizontal"
56+
truncation-preferred
57+
style="
58+
width: 400px;
59+
padding: 0;
60+
margin: 0;
61+
border: none;
62+
background-color: transparent;
63+
color-scheme: light;
64+
">
65+
<gmp-place-details-place-request></gmp-place-details-place-request>
66+
<gmp-place-content-config>
67+
<gmp-place-media></gmp-place-media>
68+
<gmp-place-rating></gmp-place-rating>
69+
<gmp-place-price></gmp-place-price>
70+
<gmp-place-accessible-entrance-icon></gmp-place-accessible-entrance-icon>
71+
<gmp-place-open-now-status></gmp-place-open-now-status>
72+
<gmp-place-attribution
73+
light-scheme-color="gray"
74+
dark-scheme-color="white"></gmp-place-attribution>
75+
</gmp-place-content-config>
76+
</gmp-place-details-compact>
77+
3778
<!--[END maps_ui_kit_place_search_text_map] -->
38-
<script>
39-
((g) => {
40-
var h,
41-
a,
42-
k,
43-
p = 'The Google Maps JavaScript API',
44-
c = 'google',
45-
l = 'importLibrary',
46-
q = '__ib__',
47-
m = document,
48-
b = window;
49-
b = b[c] || (b[c] = {});
50-
var d = b.maps || (b.maps = {}),
51-
r = new Set(),
52-
e = new URLSearchParams(),
53-
u = () =>
54-
h ||
55-
(h = new Promise(async (f, n) => {
56-
await (a = m.createElement('script'));
57-
e.set('libraries', [...r] + '');
58-
for (k in g)
59-
e.set(
60-
k.replace(
61-
/[A-Z]/g,
62-
(t) => '_' + t[0].toLowerCase()
63-
),
64-
g[k]
65-
);
66-
e.set('callback', c + '.maps.' + q);
67-
a.src =
68-
`https://maps.${c}apis.com/maps/api/js?` + e;
69-
d[q] = f;
70-
a.onerror = () =>
71-
(h = n(Error(p + ' could not load.')));
72-
a.nonce =
73-
m.querySelector('script[nonce]')?.nonce || '';
74-
m.head.append(a);
75-
}));
76-
d[l]
77-
? console.warn(p + ' only loads once. Ignoring:', g)
78-
: (d[l] = (f, ...n) =>
79-
r.add(f) && u().then(() => d[l](f, ...n)));
80-
})({ key: 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8', v: 'alpha' });
81-
</script>
8279
</body>
8380
</html>
8481
<!--[END maps_ui_kit_place_search_text] -->

0 commit comments

Comments
 (0)