-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from TomPsr/master
update demo
- Loading branch information
Showing
10 changed files
with
1,224 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Leaflet.LayerIndex</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css" /> | ||
<script>L_PREFER_CANVAS = true;</script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script> | ||
<script src="../rtree.js"></script> | ||
<script src="../leaflet.layerindex.js"></script> | ||
<script src="../infocontrol.js"></script> | ||
<style> | ||
#map { | ||
position: absolute; | ||
top:0; | ||
left: 0; | ||
right: 0; | ||
bottom:0; | ||
} | ||
|
||
.leaflet-infocontrol { | ||
font-size: 25px !important; | ||
top:50px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="map"></div> | ||
|
||
<script type="text/javascript"> | ||
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> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const logJson = async () => { | ||
const reponse = await fetch('docs/meta.json'); | ||
return await reponse.json(); | ||
} | ||
|
||
(async () => { | ||
const meta = await logJson() | ||
document.querySelector("title").innerText= meta.name | ||
document.querySelector(".demo-name").innerText= meta.name | ||
if (meta.npm){ | ||
document.querySelector(".npm").href="https://www.npmjs.com/package/" + meta.npm | ||
document.querySelector(".npm .title").innerText= meta.npm | ||
}else{ | ||
document.querySelector(".npm").remove() | ||
} | ||
document.querySelector(".sources").href= meta.github | ||
document.querySelector(".readme-md").src= meta.github.replace("github.com","raw.githubusercontent.com") + "HEAD/README.md" | ||
if (meta.moreInfo){ | ||
document.querySelector(".moreInfo").innerText= meta.moreInfo | ||
} | ||
})() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name" : "Leaflet.LayerIndex", | ||
"github" : "https://github.com/makinacorpus/Leaflet.LayerIndex/", | ||
"npm" : "leaflet-layerindex" | ||
} |
Oops, something went wrong.