Test webpage for #3233

This commit is contained in:
Iván Sánchez Ortega 2015-05-08 16:32:57 +02:00
parent b849568ca0
commit 29e8507851

View File

@ -0,0 +1,54 @@
<!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 type="text/javascript" src="../../build/deps.js"></script>
<script src="../leaflet-include.js"></script>
</head>
<body>
This page tests if the cursors for dragging the map and the markers behave as expected. The left marker is draggable, the right one is not.
<hr>
<div>Map dragging enabled:</div>
<div id="map1" style="height: 300px;width: 400px; float:left;"></div>
<div style="clear:both"></div>
<div>Map dragging disabled:</div>
<div id="map2" style="height: 300px;width: 400px; float:left;"></div>
<script type="text/javascript">
function addLayerAndMarkers(map) {
var layer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
maxZoom : 18
}).addTo(map);
var draggableMarker = L.marker([20, -120.3], {draggable: true} ).addTo(map);
var fixedMarker = L.marker([50.5, 30.5], {draggable: false}).addTo(map);
}
var map1 = new L.Map('map1', {
center : new L.LatLng(0, -30),
zoom : 0,
dragging : true,
});
var map2 = new L.Map('map2', {
center : new L.LatLng(0, -30),
zoom : 0,
dragging : false,
});
addLayerAndMarkers(map1);
addLayerAndMarkers(map2);
</script>
</body>
</html>