Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions samples/3d-accessibility-features/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<!--
@license
Copyright 2025 Google LLC. All Rights Reserved.
Copyright 2026 Google LLC. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
-->
<!-- [START maps_3d_accessibility_features] -->
Expand All @@ -11,15 +11,18 @@

<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>
<!-- prettier-ignore -->
<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))})
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "weekly" });</script>
</head>
<body>
<div id="map"></div>
<gmp-map-3d
center="34.8405,-111.7909"
range="13279.5"
tilt="67.44"
heading="0.01"
mode="satellite"
gesture-handling="cooperative"></gmp-map-3d>
</body>
</html>
<!-- [END maps_3d_accessibility_features] -->
32 changes: 12 additions & 20 deletions samples/3d-accessibility-features/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
/*
* @license
* Copyright 2025 Google LLC. All Rights Reserved.
* Copyright 2026 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

// [START maps_3d_accessibility_features]
async function init() {
const [
{ Map3DElement, Marker3DInteractiveElement, PopoverElement },
{ PinElement },
] = await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);
async function initMap() {

Check failure on line 8 in samples/3d-accessibility-features/index.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

'initMap' is defined but never used
// Import the needed libraries.
const [{ Marker3DInteractiveElement, PopoverElement }, { PinElement }] =
await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);

const map = new Map3DElement({
center: { lat: 34.8405, lng: -111.7909, altitude: 1322.7 },
range: 13279.5,
tilt: 67.44,
heading: 0.01,
mode: 'SATELLITE',
gestureHandling: 'COOPERATIVE',
});
const map3DElement = document.querySelector('gmp-map-3d')!;

// Set LatLng and title text for the markers. The first marker (Boynton Pass)
// receives the initial focus when tab is pressed. Use arrow keys to move
Expand Down Expand Up @@ -51,16 +43,16 @@

tourStops.forEach(({ position, title }, i) => {
const pin = new PinElement({
glyphText: `${i + 1}`,

Check warning on line 46 in samples/3d-accessibility-features/index.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Invalid type "number" of template literal expression
scale: 1.5,
glyphColor: '#FFFFFF',
});
const popover = new PopoverElement();

const content = `${i + 1}. ${title}`;

Check warning on line 52 in samples/3d-accessibility-features/index.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Invalid type "number" of template literal expression
const header = document.createElement('span');
// Include the label for screen readers.
header.ariaLabel = `This is marker ${i + 1}. ${title}`;

Check warning on line 55 in samples/3d-accessibility-features/index.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Invalid type "number" of template literal expression
header.slot = 'header';

popover.append(header);
Expand All @@ -75,12 +67,12 @@

interactiveMarker.append(pin);

map.append(interactiveMarker);
map.append(popover);
map3DElement.append(interactiveMarker);
map3DElement.append(popover);
});

document.body.append(map);
document.body.append(map3DElement);
}

void init();

Check failure on line 77 in samples/3d-accessibility-features/index.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Unsafe call of a type that could not be resolved
// [END maps_3d_accessibility_features]
4 changes: 1 addition & 3 deletions samples/3d-accessibility-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
"build:vite": "vite build --base './'",
"preview": "vite preview"
},
"dependencies": {

}
"dependencies": {}
}
2 changes: 1 addition & 1 deletion samples/3d-accessibility-features/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* @license
* Copyright 2025 Google LLC. All Rights Reserved.
* Copyright 2026 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
/* [START maps_3d_accessibility_features] */
Expand Down
Loading