2011-08-11 19:30:46 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Leaflet debug page</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
|
|
|
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
2012-02-16 19:00:45 +08:00
|
|
|
|
2011-08-11 19:30:46 +08:00
|
|
|
<link rel="stylesheet" href="../css/screen.css" />
|
2012-02-16 19:00:45 +08:00
|
|
|
|
2013-01-31 18:29:39 +08:00
|
|
|
<script type="text/javascript" src="../../build/deps.js"></script>
|
2011-08-11 19:30:46 +08:00
|
|
|
<script src="../leaflet-include.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="map" style="width: 800px; height: 600px; border: 1px solid #ccc"></div>
|
|
|
|
|
|
|
|
<script src="route.js"></script>
|
|
|
|
<script>
|
|
|
|
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png',
|
|
|
|
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18}),
|
2012-02-17 00:11:17 +08:00
|
|
|
map = new L.Map('map', {layers: [cloudmade], center: new L.LatLng(51.505, -0.04), zoom: 13});
|
2012-02-16 19:00:45 +08:00
|
|
|
|
|
|
|
|
2012-02-17 00:11:17 +08:00
|
|
|
var polygon = new L.Polygon([
|
2012-07-29 07:22:18 +08:00
|
|
|
[51.51, -0.1],
|
|
|
|
[51.5, -0.06],
|
|
|
|
[51.52, -0.03]
|
2012-02-17 00:11:17 +08:00
|
|
|
]);
|
2012-02-16 19:00:45 +08:00
|
|
|
|
2012-02-21 21:28:11 +08:00
|
|
|
polygon.editing.enable();
|
|
|
|
|
2012-02-17 00:11:17 +08:00
|
|
|
map.addLayer(polygon);
|
2012-02-16 19:00:45 +08:00
|
|
|
|
2012-02-17 00:11:17 +08:00
|
|
|
var polyline = new L.Polyline([
|
2012-09-28 06:22:42 +08:00
|
|
|
[51.50, -0.04],
|
2012-07-29 07:22:18 +08:00
|
|
|
[51.49, -0.02],
|
|
|
|
[51.51, 0],
|
|
|
|
[51.52, -0.02]
|
2012-02-17 00:11:17 +08:00
|
|
|
]);
|
2012-02-16 20:15:47 +08:00
|
|
|
|
2012-02-21 21:28:11 +08:00
|
|
|
polyline.editing.enable();
|
|
|
|
|
2012-02-17 00:11:17 +08:00
|
|
|
map.addLayer(polyline);
|
|
|
|
|
2012-07-29 07:22:18 +08:00
|
|
|
polygon.on('edit', function() {
|
|
|
|
console.log('Polygon was edited!');
|
|
|
|
});
|
|
|
|
polyline.on('edit', function() {
|
|
|
|
console.log('Polyline was edited!');
|
|
|
|
});
|
2011-08-11 19:30:46 +08:00
|
|
|
</script>
|
|
|
|
</body>
|
2012-02-16 19:00:45 +08:00
|
|
|
</html>
|