diff --git a/static/js/controls.js b/static/js/controls.js index c69b4bc..0a7d9b6 100644 --- a/static/js/controls.js +++ b/static/js/controls.js @@ -1,7 +1,24 @@ 'use strict'; -/* global navigator $ socket userid token mapuser toggleMaps */ +/* global navigator $ userid token mapuser toggleMaps */ import css from '../css/controls.css'; +import io from 'socket.io-client'; + +const socket = io('//'+window.location.hostname); + +// Show/hide map if location is set/unset +function toggleMaps(loc) { + if (loc.lat===0&&loc.lon===0) { + $('#map').hide(); + $('#pano').hide(); + $('#notset').show(); + } + else { + $('#map').show(); + $('#pano').show(); + $('#notset').hide(); + } +} $(function(){ var wpid, newloc; diff --git a/static/js/map.js b/static/js/map.js index 4c3abf0..af7102d 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -2,8 +2,6 @@ /* global mapuser userid disp noHeader mapKey */ import css from '../css/map.css'; - -// Webpack imports import io from 'socket.io-client'; import $ from 'jquery'; import loadGoogleMapsAPI from 'load-google-maps-api';