mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-11 09:20:17 +01:00
Check the browsers websocket support and added flag to turn websocket on/off.
This commit is contained in:
parent
7413221341
commit
c32e2646af
@ -41,6 +41,7 @@
|
||||
<script type="text/javascript" src="js/leaflet-hash.js"></script>
|
||||
<script>
|
||||
|
||||
var useWebsocket = false; // Set to true if you want websocket support
|
||||
|
||||
L.Projection.NoWrap = {
|
||||
project: function (latlng) {
|
||||
@ -95,14 +96,16 @@ L.control.coordinates({
|
||||
}).addTo(map);
|
||||
|
||||
var manualUpdateControl;
|
||||
L.autoUpdate('autoUpdate', function(pressed) {
|
||||
if (pressed) {
|
||||
manualUpdateControl.getContainer().style = 'visibility: hidden';
|
||||
}
|
||||
else {
|
||||
manualUpdateControl.getContainer().style = 'visibility: visible';
|
||||
}
|
||||
});
|
||||
if (window.WebSocket && useWebsocket) {
|
||||
L.autoUpdate('autoUpdate', function(pressed) {
|
||||
if (pressed) {
|
||||
manualUpdateControl.getContainer().style = 'visibility: hidden';
|
||||
}
|
||||
else {
|
||||
manualUpdateControl.getContainer().style = 'visibility: visible';
|
||||
}
|
||||
});
|
||||
}
|
||||
var layersControl = new L.Control.Layers(rasterMaps, overlayMaps, {collapsed: false});
|
||||
map.addControl(layersControl);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user