Skip to content

Commit 27073fb

Browse files
authored
feat: Updates code sample to match doc updates. (#936)
1 parent 900c7b6 commit 27073fb

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed
Lines changed: 6 additions & 13 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_web_components_map] -->
@@ -11,27 +11,20 @@
1111

1212
<link rel="stylesheet" type="text/css" href="./style.css" />
1313
<script type="module" src="./index.js"></script>
14+
<script
15+
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps,marker&v=weekly"
16+
defer
17+
></script>
1418
</head>
1519
<body>
1620
<!-- [START maps_web_components_map_gmpmap] -->
1721
<gmp-map
1822
center="37.4220656,-122.0840897"
1923
zoom="10"
2024
map-id="DEMO_MAP_ID"
21-
style="height: 400px"
25+
style="height: 500px"
2226
></gmp-map>
2327
<!-- [END maps_web_components_map_gmpmap] -->
24-
<!--
25-
The `defer` attribute causes the script to execute after the full HTML
26-
document has been parsed. For non-blocking uses, avoiding race conditions,
27-
and consistent behavior across browsers, consider loading using Promises. See
28-
https://developers.google.com/maps/documentation/javascript/load-maps-js-api
29-
for more information.
30-
-->
31-
<script
32-
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps,marker&v=weekly"
33-
defer
34-
></script>
3528
</body>
3629
</html>
3730
<!-- [END maps_web_components_map] -->

samples/web-components-map/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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_web_components_map]
88
// This example adds a map using web components.
9-
async function initMap(): Promise<void> {
9+
async function initMap() {
1010
console.log('Maps JavaScript API loaded.');
1111
}
1212

samples/web-components-map/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_web_components_map] */

0 commit comments

Comments
 (0)