Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix event bug when loaded in polar view #222

Benjaminf42f42c4aab5
diff --git a/web/js/map/wv.map.animate.js b/web/js/map/wv.map.animate.js
index 254fe10e5..6914eb75d 100644
--- a/web/js/map/wv.map.animate.js
+++ b/web/js/map/wv.map.animate.js
@@ -19,7 +19,6 @@ wv.map.animate = wv.map.animate || function(models, config, ui) {
var model = models.map;
var self = {};
- var map = ui.map.selected;
var lastLocation;
var init = function(){
@@ -38,8 +37,9 @@ wv.map.animate = wv.map.animate || function(models, config, ui) {
* @returns {void}
*/
self.move = function(method, location, zoomLevel, callback) {
- var start, currentZoom, newZoom, duration, wait, startTime, pan, bounceZoom, view, zoomTo, needsToZoomOut, flyParams;
+ var start, currentZoom, newZoom, duration, wait, startTime, pan, bounceZoom, view, zoomTo, needsToZoomOut, flyParams, map;
+ map = ui.map.selected;
start = lastLocation || map.getView().getCenter();
//Determine zoom and pan levels depending on distance to new point
//var distance = ol.sphere.ESPG4326.haversineDistance(start, location);
diff --git a/web/js/naturalEvents/wv.naturalEvents.map.js b/web/js/naturalEvents/wv.naturalEvents.map.js
index 804bb8bf9..03029f1b4 100644
--- a/web/js/naturalEvents/wv.naturalEvents.map.js
+++ b/web/js/naturalEvents/wv.naturalEvents.map.js
@@ -67,10 +67,9 @@ wv.naturalEvents.map = wv.naturalEvents.map || function(models, maps, config) {
};
- self.draw = function(location) {
-
+ self.draw = function(location, currentMap) {
//loads current map
-
+ map = maps.selected;
//remove any existing location first
map.removeLayer(vectorLayer);