-
Notifications
You must be signed in to change notification settings - Fork 65
/
index.html
70 lines (57 loc) · 2.02 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Test XYZ</title>
<meta name="description" content="" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<script src="https://js.api.here.com/v3/3.1/mapsjs-core.js" type="text/javascript" charset="utf-8"></script>
<script src="https://js.api.here.com/v3/3.1/mapsjs-service.js" type="text/javascript" charset="utf-8"></script>
<script src="https://js.api.here.com/v3/3.1/mapsjs-mapevents.js" type="text/javascript" charset="utf-8"></script>
<script src="https://js.api.here.com/v3/3.1/mapsjs-ui.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="https://js.api.here.com/v3/3.1/mapsjs-ui.css" />
<style>
body {
margin: 0;
}
#mapContainer {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="mapContainer"></div>
<script>
// Get this at developer.here.com, it's a JavaScript key
const HERE_MAPS_KEY = "c1LJuR0Bl2y02PefaQ2d8PvPnBKEN8KdhAOFYR_Bgmw";
// This is a read only key you can get in our token manager
const DATA_HUB_ACCESS_TOKEN = "AMuu6pamTieLe38Ybun60gA";
// Your space ID
const SPACE_ID = "uK3E2YoX";
var platform = new H.service.Platform({
apikey: HERE_MAPS_KEY
});
// Obtain the default map types from the platform object:
var defaultLayers = platform.createDefaultLayers();
var map = new H.Map(
document.getElementById('mapContainer'),
defaultLayers.vector.normal.map,
{
zoom: 4,
center: { lat: 38.7984, lng: -96.3944 },
pixelRatio: window.devicePixelRatio || 1
}
);
var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map));
// Create the default UI:
var ui = H.ui.UI.createDefault(map, defaultLayers);
const service = platform.getXYZService({
token: DATA_HUB_ACCESS_TOKEN,
});
const mySpaceProvider = new H.service.xyz.Provider(service, SPACE_ID, {});
const mySpaceLayer = new H.map.layer.TileLayer(mySpaceProvider);
map.addLayer(mySpaceLayer);
</script>
</body>
</html>