-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlayerindex-demo.html
35 lines (35 loc) · 1.25 KB
/
layerindex-demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>
<head>
<title>Leaflet.LayerIndex Demo</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<script>L_PREFER_CANVAS = true;</script>
<script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
<script src="js/rtree.js"></script>
<script src="js/leaflet.layerindex.js"></script>
<script src="js/infocontrol.js"></script>
<style>
#map{position: absolute; top:0; left: 0; right: 0; bottom:0}
.leaflet-infocontrol{font-size: 25px !important}
</style>
</head>
<body>
<h1>Leaflet.LayerIndex Demo</h1>
<div id="map"></div>
<script>
L.Map.include(L.LayerIndexMixin);
var map = L.map('map');
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map);
map.fitWorld();
map.addControl(new L.Control.Information());
for (var i=0; i<5000; i++) {
var lat = Math.random() * 170 - 85
, lng = Math.random() * 350 - 175;
var layer = L.circleMarker(L.latLng([lat, lng]), {radius:1}).addTo(map);
map.indexLayer(layer);
}
map.fire('moveend');
</script>
<p><cite><a href="http://makinacorpus.github.io/Leaflet.LayerIndex/">Leaflet.LayerIndex Demo</a>, <a href="https://github.com/makinacorpus/Leaflet.LayerIndex">Leaflet.LayerIndex GitHub</cite></p>
</body>
</html>