Skip to content

Commit 82cb9a1

Browse files
committed
Updated mesh flattener sample
1 parent 1b981a8 commit 82cb9a1

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

samples/3d-mesh-flatten/index.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!doctype html>
2+
<!--
3+
@license
4+
Copyright 2025 Google LLC. All Rights Reserved.
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<!-- [START maps_3d_mesh_flatten] -->
8+
<html>
9+
<head>
10+
<title>3D Mesh Flatten</title>
11+
12+
<link rel="stylesheet" type="text/css" href="./style.css" />
13+
<script type="module" src="./index.js"></script>
14+
</head>
15+
<body>
16+
<gmp-map-3d
17+
center="40.70304023274898,-73.99453903360259,397.3687221767566"
18+
heading="-54.63577922139952"
19+
tilt="65.59195953953744"
20+
mode="SATELLITE">
21+
<gmp-flattener path="40.707680607935245,-74.00310353377735,500 40.70829665151717,-74.00193595590612,500 40.7073748659931,-74.00122787224885,500 40.706738652153156,-74.00232125268805,500 40.70738164589913,-74.0028721484274,500"></gmp-flattener>
22+
</gmp-map-3d>
23+
24+
<button class="toggleButton" id="toggleButton" type="button">Disable Flattener</button>
25+
26+
<script>
27+
(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))})({
28+
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8",
29+
v: "beta",
30+
// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).
31+
// Add other bootstrap parameters as needed, using camel case.
32+
});
33+
</script>
34+
</body>
35+
</html>
36+
<!-- [END maps_3d_mesh_flatten] -->

0 commit comments

Comments
 (0)