2013-02-15 11:17:34 +08:00
|
|
|
<!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="../../dist/leaflet.css" />
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../css/screen.css" />
|
|
|
|
<script src="../leaflet-include.js"></script>
|
2017-02-04 23:17:51 +08:00
|
|
|
<script src="http://code.jquery.com/jquery-1.8.0.js"></script>
|
2013-02-15 11:17:34 +08:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div id="map"></div>
|
|
|
|
|
2017-02-04 23:17:51 +08:00
|
|
|
<script>
|
2013-02-15 11:17:34 +08:00
|
|
|
|
|
|
|
var map;
|
|
|
|
var myLayerGroup = new L.LayerGroup();
|
|
|
|
|
|
|
|
initmap();
|
|
|
|
|
|
|
|
function initmap() {
|
2016-04-29 17:35:50 +08:00
|
|
|
// set up the map
|
|
|
|
map = new L.Map('map');
|
|
|
|
|
|
|
|
// create the tile layer with correct attribution
|
2018-03-12 15:46:20 +08:00
|
|
|
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
2016-04-29 17:35:50 +08:00
|
|
|
var osm = new L.TileLayer(osmUrl, { minZoom: 1, maxZoom: 17 });
|
|
|
|
map.addLayer(osm);
|
|
|
|
map.fitBounds(new L.LatLngBounds([51,7],[51,7]));
|
|
|
|
|
|
|
|
var route = L.polyline([
|
|
|
|
[51, 7.000],
|
|
|
|
[51.002, 7.004],
|
|
|
|
[51.004, 7.006]
|
|
|
|
]).addTo(map).on('click',function(e){console.log('bottom')})
|
|
|
|
|
|
|
|
var route2 = L.polyline([
|
|
|
|
[51, 7.000],
|
|
|
|
[51.002, 7.004]
|
|
|
|
],
|
|
|
|
{ interactive:false,color:'#f00' }
|
|
|
|
).addTo(map);
|
|
|
|
|
|
|
|
// when the mouse hovers over the red route2, you cannot click through the blue route1 beneath
|
2013-02-15 11:17:34 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|