diff --git a/cmd/mtwebmapper/web/index.html b/cmd/mtwebmapper/web/index.html index 19b02d8..d955a7c 100644 --- a/cmd/mtwebmapper/web/index.html +++ b/cmd/mtwebmapper/web/index.html @@ -96,7 +96,7 @@ L.control.coordinates({ }).addTo(map); var manualUpdateControl; -if (window.WebSocket && useWebsocket) { +if (useWebsocket && 'WebSocket' in window) { L.autoUpdate('autoUpdate', function(pressed) { if (pressed) { manualUpdateControl.getContainer().style = 'visibility: hidden'; diff --git a/cmd/mtwebmapper/web/js/auto-update.js b/cmd/mtwebmapper/web/js/auto-update.js index a689bc2..d9a2d91 100644 --- a/cmd/mtwebmapper/web/js/auto-update.js +++ b/cmd/mtwebmapper/web/js/auto-update.js @@ -45,7 +45,7 @@ L.Control.AutoUpdate = L.Control.extend({ this.socket.onmessage = function(evt) { var invalidate = function(json) { - var invalidateAll = function(x, y, z) { return true }; + var invalidateAll = function(x, y, z) { return true; }; if (!(typeof json === "string")) { return invalidateAll;