-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathindex.ts
More file actions
96 lines (86 loc) · 2.15 KB
/
Copy pathindex.ts
File metadata and controls
96 lines (86 loc) · 2.15 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* @license
* Copyright 2025 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// [START maps_3d_marker_interactive]
async function init() {
// Request needed libraries.
const { Map3DElement, Marker3DInteractiveElement, PopoverElement } =
await google.maps.importLibrary('maps3d');
const map = new Map3DElement({
center: { lat: 37.469, lng: -122.1074, altitude: 0 },
tilt: 67.5,
range: 45000,
mode: 'HYBRID',
gestureHandling: 'COOPERATIVE',
});
map.mode = 'SATELLITE';
for (const position of positions) {
const popover = new PopoverElement({
open: true,
});
popover.append(position.name);
const interactiveMarker = new Marker3DInteractiveElement({
position,
gmpPopoverTargetElement: popover,
});
map.append(interactiveMarker);
map.append(popover);
}
document.body.append(map);
}
const positions = [
{
lat: 37.50981071450543,
lng: -122.20280629839084,
name: 'Google Redwood City',
},
{
lat: 37.423897572754754,
lng: -122.09167346506989,
name: 'Google West Campus',
},
{
lat: 37.42333982824077,
lng: -122.06647571637265,
name: 'Google Bay View',
},
{
lat: 37.42193728115661,
lng: -122.08531908774293,
name: 'Googleplex',
},
{
lat: 37.39982552146971,
lng: -122.057934225745,
name: 'Google Quad Campus',
},
{
lat: 37.40317922575345,
lng: -122.03276863941647,
name: 'Google Tech Corners',
},
{
lat: 37.41181058680138,
lng: -121.9538960231151,
name: 'Google San Jose',
},
{
lat: 37.62759428242346,
lng: -122.42615377188994,
name: 'Google San Bruno',
},
{
lat: 37.40369749797231,
lng: -122.14812537955007,
name: 'Google Palo Alto',
},
{
lat: 37.793664664297964,
lng: -122.39504580413139,
name: 'Google San Francisco',
},
];
void init();
// [END maps_3d_marker_interactive]