2011-12-03 01:04:19 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Leaflet debug page</title>
|
|
|
|
|
|
|
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
2013-03-22 22:27:07 +08:00
|
|
|
|
2011-12-03 01:04:19 +08:00
|
|
|
<link rel="stylesheet" href="../css/mobile.css" />
|
2013-03-22 22:27:07 +08:00
|
|
|
|
2011-12-03 01:04:19 +08:00
|
|
|
<script src="../leaflet-include.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div id="map"></div>
|
|
|
|
|
2017-02-04 23:17:51 +08:00
|
|
|
<script>
|
2011-12-03 01:04:19 +08:00
|
|
|
|
2014-03-04 23:54:41 +08:00
|
|
|
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
2014-03-05 00:04:00 +08:00
|
|
|
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
|
|
|
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
|
2011-12-07 21:58:06 +08:00
|
|
|
bounds = new L.LatLngBounds(new L.LatLng(49.5, -11.3), new L.LatLng(61.2, 2.5));
|
2013-03-22 22:27:07 +08:00
|
|
|
|
2011-12-03 01:04:19 +08:00
|
|
|
var map = new L.Map('map', {
|
|
|
|
center: bounds.getCenter(),
|
|
|
|
zoom: 7,
|
2014-03-04 23:54:41 +08:00
|
|
|
layers: [osm],
|
2011-12-03 01:04:19 +08:00
|
|
|
maxBounds: bounds
|
|
|
|
});
|
2013-03-22 22:27:07 +08:00
|
|
|
|
2016-06-28 21:14:24 +08:00
|
|
|
|
|
|
|
|
2013-11-14 23:21:53 +08:00
|
|
|
var latlngs = L.rectangle(bounds).getLatLngs();
|
2016-06-28 21:14:24 +08:00
|
|
|
L.polyline(latlngs[0].concat(latlngs[0][0])).addTo(map);
|
2011-12-03 01:04:19 +08:00
|
|
|
|
2015-04-29 17:02:51 +08:00
|
|
|
map.setMaxBounds(bounds); // Should not enter infinite recursion
|
|
|
|
|
2011-12-03 01:04:19 +08:00
|
|
|
</script>
|
|
|
|
</body>
|
2013-03-22 22:27:07 +08:00
|
|
|
</html>
|