Sha256: 2f828d4ab1835521cb375f4563dc948ee3e0abfbe5bcfbab4fa3e19715fa2847
Contents?: true
Size: 1.63 KB
Versions: 6
Compression:
Stored size: 1.63 KB
Contents
<!DOCTYPE html> <html> <head> <title>Leaflet.draw vector editing handlers</title> <link rel="stylesheet" href="libs/leaflet.css" /> <!--[if lte IE 8]><link rel="stylesheet" href="libs/leaflet.ie.css" /><![endif]--> <script src="libs/leaflet-src.js"></script> <script src="../src/Leaflet.draw.js"></script> <script src="../src/edit/handler/Edit.Poly.js"></script> <script src="../src/edit/handler/Edit.SimpleShape.js"></script> <script src="../src/edit/handler/Edit.Circle.js"></script> <script src="../src/edit/handler/Edit.Rectangle.js"></script> </head> <body> <div id="map" style="width: 800px; height: 600px; border: 1px solid #ccc"></div> <script> var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18}), map = new L.Map('map', {layers: [cloudmade], center: new L.LatLng(51.505, -0.04), zoom: 13}); var polygon = new L.Polygon([ [51.51, -0.1], [51.5, -0.06], [51.52, -0.03] ]); polygon.editing.enable(); map.addLayer(polygon); var polyline = new L.Polyline([ [51.50, -0.04], [51.49, -0.02], [51.51, 0], [51.52, -0.02] ]); polyline.editing.enable(); map.addLayer(polyline); var circle = L.circle([51.53, -0.06], 600); circle.editing.enable(); map.addLayer(circle); var rectangle = L.rectangle([[51.49, -0.1], [51.48, -0.06]]); rectangle.editing.enable(); map.addLayer(rectangle); polygon.on('edit', function() { console.log('Polygon was edited!'); }); polyline.on('edit', function() { console.log('Polyline was edited!'); }); </script> </body> </html>
Version data entries
6 entries across 6 versions & 1 rubygems