forked from DerGuteWolf/lrm-google
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (42 loc) · 1.92 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
<!DOCTYPE html>
<html>
<head>
<title>Quick Demo</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="bower_components/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="bower_components/leaflet-routing-machine/dist/leaflet-routing-machine.css" />
</head>
<body>
<div id="map" style="width: 100%; height: 100%; position: absolute"></div>
<script src="bower_components/leaflet/dist/leaflet.js"></script>
<script src="bower_components/leaflet-routing-machine/dist/leaflet-routing-machine.js"></script>
<script src="bower_components/polyline/src/polyline.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBzZr6EP9bOB9YuBRS8sFDzFJiHCyOaCME"></script>
<script src="lrm-google.js"></script>
<script>
var map = L.map('map').fitBounds(L.latLngBounds(L.latLng(1.24005, 103.60071), L.latLng(1.48027, 104.03685)));
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1Ijoia2Foa2hhbmciLCJhIjoiNGRkYTdlZWM4ZjVmZTY2ZDgyNWYxZjE3MTM0MmQ5YzYifQ.gvpT-QKOem-ANWUOcNnUgQ', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'kahkhang.n5i9gb4m'
}).addTo(map);
L.Routing.control({
waypoints: [
L.latLng(1.350794, 103.835950),
L.latLng(1.392755, 103.913670)
],
router: L.Routing.google(),
lineOptions: {
styles: [
{color: 'black', opacity: 0.3, weight: 11},
{color: 'white', opacity: 0.9, weight: 9},
{color: 'blue', opacity: 1, weight: 3}
]
}
}).addTo(map);
</script>
</body>
</html>