forked from shravan91/mboxnzcrowd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mboxnz.html
110 lines (86 loc) · 2.89 KB
/
mboxnz.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Mapbox Hackday project</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.9/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<style>
#inputs,
#errors,
#directions {
position: absolute;
width: 33.3333%;
max-width: 300px;
min-width: 200px;
}
#inputs {
z-index: 10;
top: 10px;
left: 10px;
}
#directions {
z-index: 99;
background: rgba(0,0,0,.8);
top: 0;
right: 0;
bottom: 0;
overflow: auto;
}
#errors {
z-index: 8;
opacity: 0;
padding: 10px;
border-radius: 0 0 3px 3px;
background: rgba(0,0,0,.25);
top: 90px;
left: 10px;
}
</style>
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/mapbox-directions.js/v0.1.0/mapbox.directions.js'></script>
<link rel='stylesheet' href='https://api.tiles.mapbox.com/mapbox.js/plugins/mapbox-directions.js/v0.1.0/mapbox.directions.css' type='text/css' />
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-hash/v0.2.1/leaflet-hash.js'></script>
<!--<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-minimap/v1.0.0/Control.MiniMap.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-minimap/v1.0.0/Control.MiniMap.css' rel='stylesheet' />-->
<div id='map'></div>
<div id='inputs'></div>
<div id='errors'></div>
<div id='directions'>
<div id='routes'></div>
<div id='instructions'></div>
<script>
L.mapbox.accessToken = 'pk.eyJ1Ijoic2hyYXZhbjE5OTEiLCJhIjoiMTdBSHFPbyJ9.TOW1Gw15YndOtIHl3_oiKw';
var map = L.mapbox.map('map', 'shravan1991.9bde9ec1', { zoomControl: false })
.setView([-43.5494, -187.3207], 6)
new L.Control.Zoom({ position: 'topright' }).addTo(map);
/*.on('ready', function() { new L.Control.MiniMap(L.mapbox.tileLayer('shravan1991.cd791dbd'))
.addTo(map);
});*/
var hash = L.hash(map);
//directions
map.attributionControl.setPosition('bottomleft');
// create the initial directions object, from which the layer
// and inputs will pull data.
var directions = L.mapbox.directions({
profile: 'mapbox.driving'
});
var directionsLayer = L.mapbox.directions.layer(directions)
.addTo(map);
var directionsInputControl = L.mapbox.directions.inputControl('inputs', directions)
.addTo(map);
var directionsErrorsControl = L.mapbox.directions.errorsControl('errors', directions)
.addTo(map);
var directionsRoutesControl = L.mapbox.directions.routesControl('routes', directions)
.addTo(map);
var directionsInstructionsControl = L.mapbox.directions.instructionsControl('instructions', directions)
.addTo(map);
</script>
</body>
</html>