| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<title>Leaflet debug page</title> |
| 5 |
|
| 6 |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ==" crossorigin="" /> |
| 7 |
<script src="https://unpkg.com/[email protected]/dist/leaflet-src.js" integrity="sha512-WXoSHqw/t26DszhdMhOXOkI7qCiv5QWXhH9R7CgvgZMHz1ImlkVQ3uNsiQKu5wwbbxtPzFXd1hK4tzno2VqhpA==" crossorigin=""></script> |
| 8 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 9 |
<link rel="stylesheet" href="../screen.css" /> |
| 10 |
|
| 11 |
<link rel="stylesheet" href="../../dist/MarkerCluster.css" /> |
| 12 |
<link rel="stylesheet" href="../../dist/MarkerCluster.Default.css" /> |
| 13 |
<script src="../../src/DistanceGrid.js"></script> |
| 14 |
<script src="../../src/MarkerCluster.js"></script> |
| 15 |
<script src="../../src/MarkerClusterGroup.js"></script> |
| 16 |
<script src="../../src/MarkerCluster.QuickHull.js"></script> |
| 17 |
<script src="../../src/MarkerCluster.Spiderfier.js"></script> |
| 18 |
</head> |
| 19 |
<body> |
| 20 |
|
| 21 |
<div id="map"></div> |
| 22 |
<button id="populate">Populate 1 marker</button> |
| 23 |
<span>Bug <a href="https://github.com/danzel/Leaflet.markercluster/issues/69">#69</a>. Click the button 2+ times. Zoom out. Should just be a single cluster but instead one of the child markers is still visible.</span><br/> |
| 24 |
<script type="text/javascript"> |
| 25 |
|
| 26 |
var tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
| 27 |
maxZoom: 18, |
| 28 |
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' |
| 29 |
}), |
| 30 |
latlng = new L.LatLng(50.5, 30.51); |
| 31 |
|
| 32 |
var map = new L.Map('map', {center: new L.LatLng(50.41, 30.51), zoom: 17, layers: [tiles]}); |
| 33 |
|
| 34 |
var markers = new L.MarkerClusterGroup({ animateAddingMarkers : true }); |
| 35 |
var markersList = []; |
| 36 |
|
| 37 |
function populate() { |
| 38 |
var m = new L.Marker(latlng); |
| 39 |
markersList.push(m); |
| 40 |
markers.addLayer(m); |
| 41 |
return false; |
| 42 |
} |
| 43 |
|
| 44 |
map.addLayer(markers); |
| 45 |
|
| 46 |
//Ugly add/remove code |
| 47 |
L.DomUtil.get('populate').onclick = function () { |
| 48 |
populate(); |
| 49 |
}; |
| 50 |
</script> |
| 51 |
</body> |
| 52 |
</html> |