Skip to content
Open
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
16 changes: 10 additions & 6 deletions samples/3d-accessibility-features/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@

<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="map"></div>

<!-- 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"});
</script>
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"});</script>
</head>
<body>
<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] -->
15 changes: 4 additions & 11 deletions samples/3d-accessibility-features/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,14 @@
// [START maps_3d_accessibility_features]
async function initMap() {
const [
{ Map3DElement, Marker3DInteractiveElement, PopoverElement },

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

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

'Map3DElement' is assigned a value but never used
{ 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 @@ -75,12 +68,12 @@

interactiveMarker.append(pin);

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

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

initMap();

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

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
// [END maps_3d_accessibility_features]
Loading