2011-02-26 01:01:29 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Leaflet debug page</title>
|
|
|
|
|
2011-02-26 22:34:51 +08:00
|
|
|
<link rel="stylesheet" href="../dist/leaflet.css" />
|
2011-02-27 08:08:09 +08:00
|
|
|
<!--[if lte IE 8]><link rel="stylesheet" href="../dist/leaflet.ie.css" /><![endif]-->
|
|
|
|
|
2011-02-26 22:34:51 +08:00
|
|
|
<script src="include.js"></script>
|
2011-02-26 01:01:29 +08:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="map" style="width: 800px; height: 600px; border: 1px solid #ccc"></div>
|
|
|
|
|
2011-02-26 22:34:51 +08:00
|
|
|
<script src="route.js"></script>
|
|
|
|
<script>
|
2011-02-26 01:01:29 +08:00
|
|
|
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
|
|
|
|
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
|
|
|
|
|
2011-02-26 22:34:51 +08:00
|
|
|
for (var i = 0, latlngs = [], len = route.length; i < len; i++) {
|
2011-02-26 01:01:29 +08:00
|
|
|
latlngs.push(new L.LatLng(route[i][0], route[i][1]));
|
|
|
|
}
|
|
|
|
var path = new L.Polyline(latlngs);
|
2011-02-26 22:34:51 +08:00
|
|
|
|
|
|
|
var map = new L.Map('map', {layers: [cloudmade]});
|
|
|
|
|
|
|
|
map.fitBounds(new L.LatLngBounds(latlngs));
|
|
|
|
|
|
|
|
map.addLayer(new L.Marker(latlngs[0]));
|
|
|
|
map.addLayer(new L.Marker(latlngs[len - 1]));
|
|
|
|
|
2011-02-26 01:01:29 +08:00
|
|
|
map.addLayer(path);
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|