-
Notifications
You must be signed in to change notification settings - Fork 823
/
index.js
41 lines (37 loc) · 1.06 KB
/
index.js
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 2019 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// [START maps_advanced_markers_altitude]
let map;
async function initMap() {
// Request needed libraries.
const { Map } = await google.maps.importLibrary("maps");
const { AdvancedMarkerElement, PinElement } = await google.maps.importLibrary(
"marker",
);
map = new Map(document.getElementById("map"), {
center: { lat: 47.65196191658531, lng: -122.30716770065949 },
zoom: 19,
tilt: 67.5,
heading: 45,
mapId: "6ff586e93e18149f",
});
// [START maps_advanced_markers_altitude_marker]
const pin = new PinElement({
background: "#4b2e83",
borderColor: "#b7a57a",
glyphColor: "#b7a57a",
scale: 2.0,
});
const markerView = new AdvancedMarkerElement({
map,
content: pin.element,
// Set altitude to 20 meters above the ground.
position: { lat: 47.65170843460547, lng: -122.30754, altitude: 20 },
});
// [END maps_advanced_markers_altitude_marker]
}
initMap();
// [END maps_advanced_markers_altitude]