-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathindex.ts
More file actions
41 lines (33 loc) · 1 KB
/
index.ts
File metadata and controls
41 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* @license
* Copyright 2025 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// @ts-nocheck
// [START maps_3d_polygon]
async function init() {
const { Map3DElement, MapMode, Polygon3DElement } = await google.maps.importLibrary("maps3d");
const map3DElement = new Map3DElement({
center: { lat: 40.6842, lng: -74.0019, altitude: 1000 },
heading: 340,
tilt: 70,
mode: MapMode.HYBRID,
gestureHandling: "COOPERATIVE"
});
const polygonOptions = {
strokeColor: "#0000ff80",
strokeWidth: 8,
fillColor: "#ff000080",
drawsOccludedSegments: false,
}
const examplePolygon = new google.maps.maps3d.Polygon3DElement(polygonOptions);
examplePolygon.path = [
{ lat: 40.7144, lng: -74.0208 },
{ lat: 40.6993, lng: -74.019 },
{ lat: 40.7035, lng: -74.0004 }
];
map3DElement.append(examplePolygon);
document.body.append(map3DElement);
}
init();
// [END maps_3d_polygon]