mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-25 23:50:22 +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 type="text/javascript" src="js/leaflet-hash.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
var useWebsocket = false; // Set to true if you want websocket support
|
||||||
|
|
||||||
L.Projection.NoWrap = {
|
L.Projection.NoWrap = {
|
||||||
project: function (latlng) {
|
project: function (latlng) {
|
||||||
@ -95,14 +96,16 @@ L.control.coordinates({
|
|||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
var manualUpdateControl;
|
var manualUpdateControl;
|
||||||
L.autoUpdate('autoUpdate', function(pressed) {
|
if (window.WebSocket && useWebsocket) {
|
||||||
if (pressed) {
|
L.autoUpdate('autoUpdate', function(pressed) {
|
||||||
manualUpdateControl.getContainer().style = 'visibility: hidden';
|
if (pressed) {
|
||||||
}
|
manualUpdateControl.getContainer().style = 'visibility: hidden';
|
||||||
else {
|
}
|
||||||
manualUpdateControl.getContainer().style = 'visibility: visible';
|
else {
|
||||||
}
|
manualUpdateControl.getContainer().style = 'visibility: visible';
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
var layersControl = new L.Control.Layers(rasterMaps, overlayMaps, {collapsed: false});
|
var layersControl = new L.Control.Layers(rasterMaps, overlayMaps, {collapsed: false});
|
||||||
map.addControl(layersControl);
|
map.addControl(layersControl);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user