mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 16:50:18 +01:00
Applied rrenkert's patch to have an autoupdating client.
This commit is contained in:
parent
7249a60043
commit
0b7c8b6afe
@ -37,6 +37,7 @@
|
||||
<script src="js/leaflet.js"></script>
|
||||
<script src="js/Leaflet.Coordinates-0.1.4.min.js"></script>
|
||||
<script src="js/easy-button.js"></script>
|
||||
<script src="js/auto-update.js"></script>
|
||||
<script type="text/javascript" src="js/leaflet-hash.js"></script>
|
||||
<script>
|
||||
|
||||
@ -93,10 +94,19 @@ L.control.coordinates({
|
||||
useLatLngOrder: true //ordering of labels, default false-> lng-lat
|
||||
}).addTo(map);
|
||||
|
||||
var manualUpdateControl;
|
||||
L.autoUpdate('autoUpdate', function(e) {
|
||||
if (e.target.checked) {
|
||||
manualUpdateControl.getContainer().style = 'visibility: hidden';
|
||||
}
|
||||
else {
|
||||
manualUpdateControl.getContainer().style = 'visibility: visible';
|
||||
}
|
||||
});
|
||||
var layersControl = new L.Control.Layers(rasterMaps, overlayMaps, {collapsed: false});
|
||||
map.addControl(layersControl);
|
||||
|
||||
L.easyButton('fa-refresh',
|
||||
manualUpdateControl = L.easyButton('fa-refresh',
|
||||
function (){
|
||||
var tiles = document.getElementsByTagName("img");
|
||||
for (var i = 0; i < tiles.length; i++) {
|
||||
@ -114,7 +124,7 @@ L.easyButton('fa-refresh',
|
||||
//map._resetView(map.getCenter(), map.getZoom(), false);
|
||||
},
|
||||
'Update view'
|
||||
)
|
||||
);
|
||||
var hash = new L.Hash(map)
|
||||
</script>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user