From e233c7f503467dbc1aa63dde89a82c07c2495220 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Tue, 11 Jul 2017 03:01:56 -0400 Subject: [PATCH] Fixed map controls --- static/js/controls.js | 19 ++++++++++++++++++- static/js/map.js | 2 -- 2 files changed, 18 insertions(+), 3 deletions(-) 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';