mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
Deploy thephez/dash-docs to github.com/thephez/dash-docs.git:gh-pages
This commit is contained in:
commit
391f4f5496
1080 changed files with 220436 additions and 0 deletions
24
js/events.js
Normal file
24
js/events.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
"use strict";
|
||||
|
||||
var zoom = 2;
|
||||
var minzoom = 1;
|
||||
if (isMobile()) zoom = minzoom = 0;
|
||||
var map = L.map('eventmap', {
|
||||
'zoom': zoom,
|
||||
'minZoom': minzoom,
|
||||
'center': [20.00, 10.00]
|
||||
});
|
||||
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: 'Data © by <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>.',
|
||||
maxZoom: 18
|
||||
}).addTo(map);
|
||||
|
||||
var markers = new L.MarkerClusterGroup({
|
||||
showCoverageOnHover: false,
|
||||
maxClusterRadius: 40
|
||||
});
|
||||
for (var i = 0, nds = document.getElementById('eventdata').getElementsByTagName('DIV'), n = nds.length; i < n; i++) {
|
||||
L.marker([parseFloat(nds[i].getAttribute('data-lat')), parseFloat(nds[i].getAttribute('data-lon'))]).bindPopup(nds[i].innerHTML).addTo(markers);
|
||||
}
|
||||
|
||||
map.addLayer(markers);
|
Loading…
Add table
Add a link
Reference in a new issue