-
Notifications
You must be signed in to change notification settings - Fork 1
/
map.html
57 lines (45 loc) · 1.67 KB
/
map.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
<!DOCTYPE html>
<html>
<head>
<title>Muizenberg Map</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!---- <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.38.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.38.0/mapbox-gl.css' rel='stylesheet' />
-->
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />
<!-- *** References for MapBox GL Draw ... -->
<script src='https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map' style='width: 800px; height: 500px;'>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoidWJ1bnR1cHVuayIsImEiOiJja2ExM2NscnkwdXBnM2Zudjd1dHVsenE5In0.Ke04y-Zg2OJ5isgz3TTfFQ';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/ubuntupunk/cka13iunl4xfy1ioujhnrq8tk', // stylesheet location
center: [18.475, -34.106], // starting position [lng, lat]
zoom: 14 // starting zoom
});
// *** Add zoom and rotation controls to the map ...
// osm_map.addControl(new mapboxgl.Navigation({position: 'bottom-left'}));
map.addControl(new mapboxgl.NavigationControl());
// *** Add the draw control to the map ...
var draw = new MapboxDraw({
displayControlsDefault: false,
controls: {
point: true,
trash: true
}
});
map.addControl(draw, 'top-left');
</script
</script>
</div>
</body>
</html>