Sha256: ce8e931dc8141d92890e44a5cce9d1ffe9ccd96d01b52cc24230702acf61ac7e
Contents?: true
Size: 1.39 KB
Versions: 7
Compression:
Stored size: 1.39 KB
Contents
<!DOCTYPE html> <html> <head> <title>Leaflet debug page</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.css" /> <link rel="stylesheet" href="../css/screen.css" /> <script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script> <script> L_PREFER_CANVAS = true; $(document).ready(function() { var map = L.map('map', { minZoom: 1, maxZoom: 19, center: [51.505, -0.09], zoom: 9 }); var polygons = new L.FeatureGroup(); var points = [[51.505, -0.01], [51.505, -0.09], [51.55, -0.09]]; polygons.addLayer( new L.Polyline( points, { weight: 2, opacity: 1, smoothFactor: 1, color: 'red' })); polygons.on('click', function(m) { // m.layer is the clicked polygon here //m.layer.bindPopup('hello!').openPopup(); console.log(m.layer) }); polygons.addTo(map); }); </script> <script src="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.js"></script> </head> <body> <div id="map"></div> </body> </html>
Version data entries
7 entries across 7 versions & 1 rubygems