Debian Codegraph @

example/old-bugs/animationless-zoom.html

raw
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="doit">Zoom in</button><br/>
23 <span>Bug <a href="https://github.com/leaflet/Leaflet.markercluster/issues/216">#216</a>. Click the button. It will zoom in, leaflet will not do an animation for the zoom. A marker should be visible.</span><br/>
24 <span id="time"></span>
25 <script type="text/javascript">
26
27 var tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
28 maxZoom: 18,
29 attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
30 }),
31 latlng = new L.LatLng(-37.36142550190516, 174.254150390625);
32
33 var map = new L.Map('map', {center: latlng, zoom: 7, layers: [tiles]});
34
35 var markers = new L.MarkerClusterGroup();
36 markers.addLayer(new L.Marker([-37.77852090603777, 175.3103667497635])); //The one we zoom in on
37 markers.addLayer(new L.Marker([-37.711800591811055, 174.50034790039062])); //Marker that we cluster with at the top zoom level, but not 1 level down
38 map.addLayer(markers);
39
40 //Ugly add/remove code
41 L.DomUtil.get('doit').onclick = function () {
42 map.setView([-37.77852090603777, 175.3103667497635], 15);
43 };
44
45 </script>
46 </body>
47 </html>