mirror of
				https://bitbucket.org/s_l_teichmann/mtsatellite
				synced 2025-11-04 09:55:34 +01:00 
			
		
		
		
	Check the browsers websocket support and added flag to turn websocket on/off.
This commit is contained in:
		@@ -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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user