diff --git a/dist/samples/map-simple/app/index.html b/dist/samples/map-simple/app/index.html index 21946f7d6..396973a4a 100644 --- a/dist/samples/map-simple/app/index.html +++ b/dist/samples/map-simple/app/index.html @@ -1,7 +1,7 @@ @@ -11,13 +11,16 @@ - - -
- + + + + + + + diff --git a/dist/samples/map-simple/app/index.ts b/dist/samples/map-simple/app/index.ts index 923240da1..219a27a17 100644 --- a/dist/samples/map-simple/app/index.ts +++ b/dist/samples/map-simple/app/index.ts @@ -1,20 +1,18 @@ /* * @license - * Copyright 2025 Google LLC. All Rights Reserved. + * Copyright 2026 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ // [START maps_map_simple] -let map: google.maps.Map; async function initMap(): Promise { - const { Map, RenderingType } = (await google.maps.importLibrary( - 'maps' - )) as google.maps.MapsLibrary; - map = new Map(document.getElementById('map') as HTMLElement, { - center: { lat: -34.397, lng: 150.644 }, - zoom: 8, - renderingType: RenderingType.VECTOR, - }); + // Import the needed libraries. + await google.maps.importLibrary('maps'); + + // Create the map. + const mapElement = document.querySelector('gmp-map') as google.maps.MapElement; + // Access the underlying map object. + const innerMap = mapElement.innerMap; } initMap(); diff --git a/dist/samples/map-simple/app/style.css b/dist/samples/map-simple/app/style.css index a7dea253d..afd57d7a7 100644 --- a/dist/samples/map-simple/app/style.css +++ b/dist/samples/map-simple/app/style.css @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ /* [START maps_map_simple] */ -/* - * Always set the map height explicitly to define the size of the div element - * that contains the map. - */ -#map { - height: 100%; -} - /* * Optional: Makes the sample page fill the window. */ diff --git a/dist/samples/map-simple/dist/assets/index-549u98Rk.css b/dist/samples/map-simple/dist/assets/index-549u98Rk.css new file mode 100644 index 000000000..37abb1c40 --- /dev/null +++ b/dist/samples/map-simple/dist/assets/index-549u98Rk.css @@ -0,0 +1 @@ +html,body{height:100%;margin:0;padding:0} diff --git a/dist/samples/map-simple/dist/assets/index-DWepjxzn.css b/dist/samples/map-simple/dist/assets/index-DWepjxzn.css deleted file mode 100644 index c49b8a3f3..000000000 --- a/dist/samples/map-simple/dist/assets/index-DWepjxzn.css +++ /dev/null @@ -1 +0,0 @@ -#map{height:100%}html,body{height:100%;margin:0;padding:0} diff --git a/dist/samples/map-simple/dist/assets/index-CZqO0WLr.js b/dist/samples/map-simple/dist/assets/index-WzusdyoD.js similarity index 79% rename from dist/samples/map-simple/dist/assets/index-CZqO0WLr.js rename to dist/samples/map-simple/dist/assets/index-WzusdyoD.js index 7f57cbc8d..46a326b1f 100644 --- a/dist/samples/map-simple/dist/assets/index-CZqO0WLr.js +++ b/dist/samples/map-simple/dist/assets/index-WzusdyoD.js @@ -1 +1 @@ -(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();async function e(){let{Map:e,RenderingType:t}=await google.maps.importLibrary(`maps`);new e(document.getElementById(`map`),{center:{lat:-34.397,lng:150.644},zoom:8,renderingType:t.VECTOR})}e(); \ No newline at end of file +(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();async function e(){await google.maps.importLibrary(`maps`),document.querySelector(`gmp-map`).innerMap}e(); \ No newline at end of file diff --git a/dist/samples/map-simple/dist/index.html b/dist/samples/map-simple/dist/index.html index 53e969a71..68d7e17b4 100644 --- a/dist/samples/map-simple/dist/index.html +++ b/dist/samples/map-simple/dist/index.html @@ -1,7 +1,7 @@ @@ -9,15 +9,18 @@ Simple Map - - - - -
- + + + + + + + + + diff --git a/dist/samples/map-simple/docs/index.html b/dist/samples/map-simple/docs/index.html index 21946f7d6..396973a4a 100644 --- a/dist/samples/map-simple/docs/index.html +++ b/dist/samples/map-simple/docs/index.html @@ -1,7 +1,7 @@ @@ -11,13 +11,16 @@ - - -
- + + + + + + + diff --git a/dist/samples/map-simple/docs/index.js b/dist/samples/map-simple/docs/index.js index 7f7507865..6bb19a6e2 100644 --- a/dist/samples/map-simple/docs/index.js +++ b/dist/samples/map-simple/docs/index.js @@ -1,18 +1,17 @@ "use strict"; /* * @license - * Copyright 2025 Google LLC. All Rights Reserved. + * Copyright 2026 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ // [START maps_map_simple] -let map; async function initMap() { - const { Map, RenderingType } = (await google.maps.importLibrary('maps')); - map = new Map(document.getElementById('map'), { - center: { lat: -34.397, lng: 150.644 }, - zoom: 8, - renderingType: RenderingType.VECTOR, - }); + // Import the needed libraries. + await google.maps.importLibrary('maps'); + // Create the map. + const mapElement = document.querySelector('gmp-map'); + // Access the underlying map object. + const innerMap = mapElement.innerMap; } initMap(); // [END maps_map_simple] diff --git a/dist/samples/map-simple/docs/index.ts b/dist/samples/map-simple/docs/index.ts index 923240da1..219a27a17 100644 --- a/dist/samples/map-simple/docs/index.ts +++ b/dist/samples/map-simple/docs/index.ts @@ -1,20 +1,18 @@ /* * @license - * Copyright 2025 Google LLC. All Rights Reserved. + * Copyright 2026 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ // [START maps_map_simple] -let map: google.maps.Map; async function initMap(): Promise { - const { Map, RenderingType } = (await google.maps.importLibrary( - 'maps' - )) as google.maps.MapsLibrary; - map = new Map(document.getElementById('map') as HTMLElement, { - center: { lat: -34.397, lng: 150.644 }, - zoom: 8, - renderingType: RenderingType.VECTOR, - }); + // Import the needed libraries. + await google.maps.importLibrary('maps'); + + // Create the map. + const mapElement = document.querySelector('gmp-map') as google.maps.MapElement; + // Access the underlying map object. + const innerMap = mapElement.innerMap; } initMap(); diff --git a/dist/samples/map-simple/docs/style.css b/dist/samples/map-simple/docs/style.css index a7dea253d..afd57d7a7 100644 --- a/dist/samples/map-simple/docs/style.css +++ b/dist/samples/map-simple/docs/style.css @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ /* [START maps_map_simple] */ -/* - * Always set the map height explicitly to define the size of the div element - * that contains the map. - */ -#map { - height: 100%; -} - /* * Optional: Makes the sample page fill the window. */ diff --git a/dist/samples/map-simple/jsfiddle/demo.css b/dist/samples/map-simple/jsfiddle/demo.css index cdb8614ba..22c12d719 100644 --- a/dist/samples/map-simple/jsfiddle/demo.css +++ b/dist/samples/map-simple/jsfiddle/demo.css @@ -4,14 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* - * Always set the map height explicitly to define the size of the div element - * that contains the map. - */ -#map { - height: 100%; -} - /* * Optional: Makes the sample page fill the window. */ diff --git a/dist/samples/map-simple/jsfiddle/demo.html b/dist/samples/map-simple/jsfiddle/demo.html index f54fb0f72..e14a9c649 100644 --- a/dist/samples/map-simple/jsfiddle/demo.html +++ b/dist/samples/map-simple/jsfiddle/demo.html @@ -1,7 +1,7 @@ @@ -11,13 +11,16 @@ - - -
- + + + + + + + diff --git a/dist/samples/map-simple/jsfiddle/demo.js b/dist/samples/map-simple/jsfiddle/demo.js index 2bf976891..7c2a8341a 100644 --- a/dist/samples/map-simple/jsfiddle/demo.js +++ b/dist/samples/map-simple/jsfiddle/demo.js @@ -1,18 +1,17 @@ "use strict"; /* * @license - * Copyright 2025 Google LLC. All Rights Reserved. + * Copyright 2026 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ -let map; async function initMap() { - const { Map, RenderingType } = (await google.maps.importLibrary('maps')); - map = new Map(document.getElementById('map'), { - center: { lat: -34.397, lng: 150.644 }, - zoom: 8, - renderingType: RenderingType.VECTOR, - }); + // Import the needed libraries. + await google.maps.importLibrary('maps'); + // Create the map. + const mapElement = document.querySelector('gmp-map'); + // Access the underlying map object. + const innerMap = mapElement.innerMap; } initMap();