Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 10 additions & 9 deletions dist/samples/3d-camera-position/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ async function initMap(): Promise<void> {
const fovSlider = document.getElementById('fov') as HTMLInputElement;
const rollSlider = document.getElementById('roll') as HTMLInputElement;

const headingVal = document.getElementById('heading-val') as HTMLElement;
const tiltVal = document.getElementById('tilt-val') as HTMLElement;
const rangeVal = document.getElementById('range-val') as HTMLElement;
const altitudeVal = document.getElementById('altitude-val') as HTMLElement;
const fovVal = document.getElementById('fov-val') as HTMLElement;
const rollVal = document.getElementById('roll-val') as HTMLElement;
const codeElem = document.getElementById('generated-code') as HTMLElement;
const headingVal = document.getElementById('heading-val')!;
const tiltVal = document.getElementById('tilt-val')!;
const rangeVal = document.getElementById('range-val')!;
const altitudeVal = document.getElementById('altitude-val')!;
const fovVal = document.getElementById('fov-val')!;
const rollVal = document.getElementById('roll-val')!;
const codeElem = document.getElementById('generated-code')!;
const copyBtn = document.getElementById('copy-btn') as HTMLButtonElement;

let currentAltitude = 30;
Expand Down Expand Up @@ -82,7 +82,7 @@ async function initMap(): Promise<void> {
});

// Listen to slider changes using event delegation.
const panel = document.querySelector('.panel') as HTMLElement;
const panel = document.querySelector('.panel')!;

panel.addEventListener('input', (e) => {
const target = e.target as HTMLInputElement;
Expand Down Expand Up @@ -121,7 +121,8 @@ async function initMap(): Promise<void> {
};
}
} else {
map3DElement[prop] = val;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(map3DElement as any)[prop] = val;
}
updateUI();
});
Expand Down
1 change: 1 addition & 0 deletions dist/samples/3d-camera-position/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ async function initMap() {
}
}
else {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
map3DElement[prop] = val;
}
updateUI();
Expand Down
19 changes: 10 additions & 9 deletions dist/samples/3d-camera-position/docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ async function initMap(): Promise<void> {
const fovSlider = document.getElementById('fov') as HTMLInputElement;
const rollSlider = document.getElementById('roll') as HTMLInputElement;

const headingVal = document.getElementById('heading-val') as HTMLElement;
const tiltVal = document.getElementById('tilt-val') as HTMLElement;
const rangeVal = document.getElementById('range-val') as HTMLElement;
const altitudeVal = document.getElementById('altitude-val') as HTMLElement;
const fovVal = document.getElementById('fov-val') as HTMLElement;
const rollVal = document.getElementById('roll-val') as HTMLElement;
const codeElem = document.getElementById('generated-code') as HTMLElement;
const headingVal = document.getElementById('heading-val')!;
const tiltVal = document.getElementById('tilt-val')!;
const rangeVal = document.getElementById('range-val')!;
const altitudeVal = document.getElementById('altitude-val')!;
const fovVal = document.getElementById('fov-val')!;
const rollVal = document.getElementById('roll-val')!;
const codeElem = document.getElementById('generated-code')!;
const copyBtn = document.getElementById('copy-btn') as HTMLButtonElement;

let currentAltitude = 30;
Expand Down Expand Up @@ -82,7 +82,7 @@ async function initMap(): Promise<void> {
});

// Listen to slider changes using event delegation.
const panel = document.querySelector('.panel') as HTMLElement;
const panel = document.querySelector('.panel')!;

panel.addEventListener('input', (e) => {
const target = e.target as HTMLInputElement;
Expand Down Expand Up @@ -121,7 +121,8 @@ async function initMap(): Promise<void> {
};
}
} else {
map3DElement[prop] = val;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(map3DElement as any)[prop] = val;
}
updateUI();
});
Expand Down
1 change: 1 addition & 0 deletions dist/samples/3d-camera-position/jsfiddle/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ async function initMap() {
};
}
} else {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
map3DElement[prop] = val;
}
updateUI();
Expand Down
5 changes: 3 additions & 2 deletions dist/samples/3d-clamp-mode/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

// [START maps_3d_clamp_mode]
let polyline;
let polyline: google.maps.maps3d.Polyline3DElement;

async function init() {
const { Map3DElement, Polyline3DElement } =
Expand Down Expand Up @@ -56,7 +56,8 @@ const dropdown = document.getElementById(
) as HTMLSelectElement;
dropdown.addEventListener('change', () => {
if (polyline && dropdown.value) {
polyline.altitudeMode = dropdown.value;
polyline.altitudeMode =
dropdown.value as google.maps.maps3d.AltitudeModeString;
}
});

Expand Down
5 changes: 3 additions & 2 deletions dist/samples/3d-clamp-mode/docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

// [START maps_3d_clamp_mode]
let polyline;
let polyline: google.maps.maps3d.Polyline3DElement;

async function init() {
const { Map3DElement, Polyline3DElement } =
Expand Down Expand Up @@ -56,7 +56,8 @@ const dropdown = document.getElementById(
) as HTMLSelectElement;
dropdown.addEventListener('change', () => {
if (polyline && dropdown.value) {
polyline.altitudeMode = dropdown.value;
polyline.altitudeMode =
dropdown.value as google.maps.maps3d.AltitudeModeString;
}
});

Expand Down
4 changes: 2 additions & 2 deletions dist/samples/3d-label-toggle/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ async function init() {

// Get the button element by its ID
const toggleButton = document.getElementById('toggleButton')!;
toggleButton.addEventListener('click', function () {
toggleButton.addEventListener('click', () => {
// Toggle the labels.
if (map.mode == 'SATELLITE') {
if (map.mode === 'SATELLITE') {
// Setting the map mode to HYBRID turns the labels on.
map.mode = 'HYBRID';
toggleButton.innerText = 'Labels are on. (HYBRID)';
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/samples/3d-label-toggle/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
});
</script>
<script type="module" crossorigin src="./assets/index-E8DBn9fK.js"></script>
<script type="module" crossorigin src="./assets/index-D9pWrcCl.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-LHSP-L_e.css">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions dist/samples/3d-label-toggle/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ async function init() {

// Get the button element by its ID
const toggleButton = document.getElementById('toggleButton');
toggleButton.addEventListener('click', function () {
toggleButton.addEventListener('click', () => {
// Toggle the labels.
if (map.mode == 'SATELLITE') {
if (map.mode === 'SATELLITE') {
// Setting the map mode to HYBRID turns the labels on.
map.mode = 'HYBRID';
toggleButton.innerText = 'Labels are on. (HYBRID)';
Expand Down
6 changes: 3 additions & 3 deletions dist/samples/3d-label-toggle/docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

// [START maps_3d_label_toggle]
let map;
let map: google.maps.maps3d.Map3DElement;
async function init() {
const { Map3DElement } = await google.maps.importLibrary('maps3d');

Expand All @@ -27,9 +27,9 @@ async function init() {

// Get the button element by its ID
const toggleButton = document.getElementById('toggleButton')!;
toggleButton.addEventListener('click', function () {
toggleButton.addEventListener('click', () => {
// Toggle the labels.
if (map.mode == 'SATELLITE') {
if (map.mode === 'SATELLITE') {
// Setting the map mode to HYBRID turns the labels on.
map.mode = 'HYBRID';
toggleButton.innerText = 'Labels are on. (HYBRID)';
Expand Down
4 changes: 2 additions & 2 deletions dist/samples/3d-label-toggle/jsfiddle/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ async function init() {

// Get the button element by its ID
const toggleButton = document.getElementById('toggleButton');
toggleButton.addEventListener('click', function () {
toggleButton.addEventListener('click', () => {
// Toggle the labels.
if (map.mode == 'SATELLITE') {
if (map.mode === 'SATELLITE') {
// Setting the map mode to HYBRID turns the labels on.
map.mode = 'HYBRID';
toggleButton.innerText = 'Labels are on. (HYBRID)';
Expand Down
9 changes: 3 additions & 6 deletions dist/samples/3d-map-45-degree-locked/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
<title>3d map 45-degree perspective</title>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
<script>
// prettier-ignore
(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))})({
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
});
</script>
<script
async
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d"></script>
</head>
<body>
<gmp-map-3d
Expand Down
5 changes: 0 additions & 5 deletions dist/samples/3d-map-45-degree-locked/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@
*/

// [START maps_3d_map_45_degree_locked]
async function initMap(): Promise<void> {
await google.maps.importLibrary('maps3d');
}

void initMap();
// [END maps_3d_map_45_degree_locked]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions dist/samples/3d-map-45-degree-locked/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
<html>
<head>
<title>3d map 45-degree perspective</title>
<script>
// prettier-ignore
(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))})({
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
});
</script>
<script type="module" crossorigin src="./assets/index-DnsoIklU.js"></script>
<script
async
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d"></script>
<script type="module" crossorigin src="./assets/index-CGhmJKDO.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-549u98Rk.css">
</head>
<body>
Expand Down
9 changes: 3 additions & 6 deletions dist/samples/3d-map-45-degree-locked/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
<title>3d map 45-degree perspective</title>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
<script>
// prettier-ignore
(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))})({
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
});
</script>
<script
async
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d"></script>
</head>
<body>
<gmp-map-3d
Expand Down
5 changes: 0 additions & 5 deletions dist/samples/3d-map-45-degree-locked/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@
*/

// [START maps_3d_map_45_degree_locked]
async function initMap() {
await google.maps.importLibrary('maps3d');
}

void initMap();
// [END maps_3d_map_45_degree_locked]
5 changes: 0 additions & 5 deletions dist/samples/3d-map-45-degree-locked/docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@
*/

// [START maps_3d_map_45_degree_locked]
async function initMap(): Promise<void> {
await google.maps.importLibrary('maps3d');
}

void initMap();
// [END maps_3d_map_45_degree_locked]
9 changes: 3 additions & 6 deletions dist/samples/3d-map-45-degree-locked/jsfiddle/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
<title>3d map 45-degree perspective</title>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
<script>
// prettier-ignore
(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))})({
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
});
</script>
<script
async
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d"></script>
</head>
<body>
<gmp-map-3d
Expand Down
6 changes: 0 additions & 6 deletions dist/samples/3d-map-45-degree-locked/jsfiddle/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@
* Copyright 2026 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

async function initMap() {
await google.maps.importLibrary('maps3d');
}

void initMap();
2 changes: 1 addition & 1 deletion dist/samples/3d-marker-html/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="stylesheet" type="text/css" href="./style.css" />
<script
async
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d&internal_usage_attribution_ids=gmp_git_jsapisamples_v1_3d-markers"></script>
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d"></script>
</head>
<body>
<gmp-map-3d
Expand Down
2 changes: 1 addition & 1 deletion dist/samples/3d-marker-html/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<title>3D Marker HTML</title>
<script
async
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d&internal_usage_attribution_ids=gmp_git_jsapisamples_v1_3d-markers"></script>
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d"></script>
<link rel="stylesheet" crossorigin href="./assets/index-YMhrl0SI.css">
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion dist/samples/3d-marker-html/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="stylesheet" type="text/css" href="./style.css" />
<script
async
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d&internal_usage_attribution_ids=gmp_git_jsapisamples_v1_3d-markers"></script>
src="https://maps.googleapis.com/maps/api/js?loading=async&key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps3d"></script>
</head>
<body>
<gmp-map-3d
Expand Down
Loading