|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <title>Leaflet debug page</title> |
| 5 | + |
| 6 | + <link rel="stylesheet" href="../../dist/leaflet.css" /> |
| 7 | + |
| 8 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 9 | + |
| 10 | + <link rel="stylesheet" href="../css/screen.css" /> |
| 11 | + |
| 12 | + <script src="../leaflet-include.js"></script> |
| 13 | +</head> |
| 14 | +<body> |
| 15 | + |
| 16 | + <div id="map"></div> |
| 17 | + |
| 18 | + <script> |
| 19 | + map = L.map('map', { center: [0, 0], zoom: 3, maxZoom: 4 }); |
| 20 | + |
| 21 | + var markerAutoPan = new L.Marker([0, -10], { |
| 22 | + draggable: true, |
| 23 | + autoPan: true, |
| 24 | + title: 'AutoPan' |
| 25 | + }); |
| 26 | + |
| 27 | + map.addLayer(markerAutoPan); |
| 28 | + markerAutoPan.bindPopup("AutoPan"); |
| 29 | + |
| 30 | + |
| 31 | + var markerDraggable = new L.Marker([0, 10], { |
| 32 | + title: 'Draggable' |
| 33 | + }); |
| 34 | + |
| 35 | + map.addLayer(markerDraggable); |
| 36 | + markerDraggable.bindPopup("Draggable"); |
| 37 | + markerDraggable.dragging.enable(); |
| 38 | + |
| 39 | + var poly = new L.Polygon([[0, 10], [0, 15.5], [0, 50], [20, 20.5]]); |
| 40 | + map.addLayer(poly); |
| 41 | + poly.bindPopup("Polygon"); |
| 42 | + |
| 43 | + |
| 44 | + markerDraggable.on('click', function(e) { |
| 45 | + console.log('markerDraggable click'); |
| 46 | + }); |
| 47 | + markerAutoPan.on('click', function(e) { |
| 48 | + console.log('markerAutoPan click'); |
| 49 | + }) |
| 50 | + map.on('click', function(e) { |
| 51 | + console.log('map click'); |
| 52 | + }); |
| 53 | + |
| 54 | + poly.on('click', function(e) { |
| 55 | + console.log('poly click'); |
| 56 | + }); |
| 57 | + |
| 58 | + var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { |
| 59 | + attribution: '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors', |
| 60 | + }).addTo(map); |
| 61 | + </script> |
| 62 | +</body> |
| 63 | +</html> |
0 commit comments