2014-08-05 05:09:01 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2016-04-29 17:35:50 +08:00
|
|
|
<title>Leaflet debug page</title>
|
2014-08-05 05:09:01 +08:00
|
|
|
|
2016-04-29 17:35:50 +08:00
|
|
|
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
2014-08-05 05:09:01 +08:00
|
|
|
|
2016-04-29 17:35:50 +08:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2014-08-05 05:09:01 +08:00
|
|
|
|
2016-04-29 17:35:50 +08:00
|
|
|
<link rel="stylesheet" href="../css/screen.css" />
|
2014-08-05 05:09:01 +08:00
|
|
|
|
2016-04-29 17:35:50 +08:00
|
|
|
<script src="../leaflet-include.js"></script>
|
2014-08-05 05:09:01 +08:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
2016-04-29 17:35:50 +08:00
|
|
|
<div id="map"></div>
|
2014-08-05 05:09:01 +08:00
|
|
|
|
2017-02-04 23:17:51 +08:00
|
|
|
<script>
|
2014-08-05 05:09:01 +08:00
|
|
|
map = L.map('map', { center: [0, 0], zoom: 3, maxZoom: 4 });
|
|
|
|
|
|
|
|
var markerStatic = new L.Marker([0, -10], {
|
|
|
|
draggable: false,
|
|
|
|
title: 'Static'
|
|
|
|
});
|
|
|
|
|
|
|
|
map.addLayer(markerStatic);
|
|
|
|
markerStatic.bindPopup("Static");
|
|
|
|
|
|
|
|
|
|
|
|
var markerDraggable = new L.Marker([0, 10], {
|
|
|
|
title: 'Draggable'
|
|
|
|
});
|
|
|
|
|
|
|
|
map.addLayer(markerDraggable);
|
|
|
|
markerDraggable.bindPopup("Draggable");
|
2016-07-08 17:22:54 +08:00
|
|
|
markerDraggable.dragging.enable();
|
2014-08-23 06:00:42 +08:00
|
|
|
|
|
|
|
var poly = new L.Polygon([[0, 10], [0, 15.5], [0, 50], [20, 20.5]]);
|
|
|
|
map.addLayer(poly);
|
2015-07-02 04:00:05 +08:00
|
|
|
poly.bindPopup("Polygon");
|
2014-08-23 06:00:42 +08:00
|
|
|
|
|
|
|
|
2014-08-05 05:09:01 +08:00
|
|
|
markerDraggable.on('click', function(e) {
|
|
|
|
console.log('markerDraggable click');
|
|
|
|
});
|
2014-08-23 06:00:42 +08:00
|
|
|
markerStatic.on('click', function(e) {
|
|
|
|
console.log('markerStatic click');
|
|
|
|
})
|
2014-08-05 05:09:01 +08:00
|
|
|
map.on('click', function(e) {
|
|
|
|
console.log('map click');
|
|
|
|
});
|
|
|
|
|
2014-08-23 06:00:42 +08:00
|
|
|
poly.on('click', function(e) {
|
|
|
|
console.log('poly click');
|
|
|
|
});
|
2014-08-05 05:09:01 +08:00
|
|
|
|
2018-03-12 15:46:20 +08:00
|
|
|
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
|
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
2016-07-26 01:39:55 +08:00
|
|
|
}).addTo(map);
|
2016-04-29 17:35:50 +08:00
|
|
|
</script>
|
2014-08-05 05:09:01 +08:00
|
|
|
</body>
|
|
|
|
</html>
|