forked from guilherme-daros/boat-telemetry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaps.js
More file actions
28 lines (21 loc) · 699 Bytes
/
maps.js
File metadata and controls
28 lines (21 loc) · 699 Bytes
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
let map;
const CREDENTIAL_KEY = "CREDENTIAL_KEY_FROM_GOOGLE_MAPS_JAVASCRIPT_API"
async function initMap() {
const { Map } = await google.maps.importLibrary("maps");
const { AdvancedMarkerElement } = await google.maps.importLibrary("marker");
map = new Map(document.getElementById("map"), {
center: { lat: -27.585006713867188, lng: -48.526302337646484 },
zoom: 14,
mapId: 'f5b17940ec1c83ea'
});
let marker = new AdvancedMarkerElement({
map,
position: { lat: -27.585006713867188, lng: -48.526302337646484 },
});
window.placeMarker = placeMarker
window.marker = marker
}
function placeMarker(location, marker) {
marker.position = location
}
initMap();