Skip to content

Commit

Permalink
Merge pull request #11 from TomPsr/master
Browse files Browse the repository at this point in the history
update demo
  • Loading branch information
Bo-Duke authored Jan 15, 2024
2 parents 4eea0e8 + 7d21393 commit 410a1d7
Show file tree
Hide file tree
Showing 10 changed files with 1,224 additions and 0 deletions.
47 changes: 47 additions & 0 deletions docs/example.html
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>
1 change: 1 addition & 0 deletions docs/logo/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions docs/logo/makina.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/logo/npm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions docs/meta.js
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
}
})()


5 changes: 5 additions & 0 deletions docs/meta.json
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"
}
Loading

0 comments on commit 410a1d7

Please sign in to comment.