forked from aws-samples/amazon-location-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
39 lines (36 loc) · 1.1 KB
/
index.html
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
<!-- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -->
<!-- SPDX-License-Identifier: MIT-0 -->
<html>
<head>
<link
href="https://unpkg.com/maplibre-gl@1/dist/maplibre-gl.css"
rel="stylesheet"
/>
</head>
<body style="margin: 0">
<div id="map" style="height: 100vh" />
<script src="https://unpkg.com/maplibre-gl@1"></script>
<script src="https://unpkg.com/[email protected]"></script>
<script>
async function initializeMap() {
// actually initialize the map
const map = await AmazonLocation.createMap(
{
// Cognito Identity Pool ID
identityPoolId: "<Identity Pool ID>",
},
{
container: "map",
center: [-123.1187, 49.2819], // initial map center point
zoom: 10, // initial map zoom
// Amazon Location Service Map Name
style: "<Map name>",
hash: true,
}
);
map.addControl(new maplibregl.NavigationControl(), "top-left");
}
initializeMap();
</script>
</body>
</html>