Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fixing eonet requests #194

Benjamincb7668bf070b
diff --git a/web/js/naturalEvents/wv.naturalEvents.model.js b/web/js/naturalEvents/wv.naturalEvents.model.js
index 94f5d90b2..4030d90eb 100644
--- a/web/js/naturalEvents/wv.naturalEvents.model.js
+++ b/web/js/naturalEvents/wv.naturalEvents.model.js
@@ -30,11 +30,6 @@ wv.naturalEvents.model = wv.naturalEvents.model || function(models, config) {
time: null
};
- self.EVENT_QUERY_RESULTS = "queryResults";
- self.EVENT_SELECT = "select";
-
- self.apiURL = config.features.naturalEvents.host;
- var querySuccessFlag = false;
/**
* Handler for events fired by this class.
*
@@ -44,12 +39,6 @@ wv.naturalEvents.model = wv.naturalEvents.model || function(models, config) {
*/
self.events = wv.util.events();
- self.layers = config.naturalEvents.layers;
- self.ignored = config.naturalEvents.skip || [];
- self.data = {};
-
-
-
self.save = function(state) {
if ( self.active ){
state.e = 't';
diff --git a/web/js/naturalEvents/wv.naturalEvents.ui.js b/web/js/naturalEvents/wv.naturalEvents.ui.js
index dac36c2cd..ab0b1f85e 100644
--- a/web/js/naturalEvents/wv.naturalEvents.ui.js
+++ b/web/js/naturalEvents/wv.naturalEvents.ui.js
@@ -58,7 +58,7 @@ wv.naturalEvents.ui = wv.naturalEvents.ui || function(models, ui, config, reques
var onQueryResults = function(){
//FIXME: this if check needs to be reworked
if ( request.data ) {
- data = request.events;
+ data = request.data.events;
self.refresh();
}
};
@@ -148,7 +148,6 @@ wv.naturalEvents.ui = wv.naturalEvents.ui || function(models, ui, config, reques
var $content = $(self.selector + "content");
$content = $(self.selector + "content").empty();
-
// iterate through events
_.each(data, function(event, index) {
refreshEvent($content, event, index);
@@ -203,7 +202,7 @@ wv.naturalEvents.ui = wv.naturalEvents.ui || function(models, ui, config, reques
models.proj.select('geographic');
}
self.selected = index;
- event = request.events[index];
+ event = request.data.events[index];
eventItem = null;
if ( event.geometries.length > 1 ) {
@@ -339,7 +338,7 @@ wv.naturalEvents.ui = wv.naturalEvents.ui || function(models, ui, config, reques
if ( references.length > 0 ) {
items = [];
_.each(references, function(reference) {
- var source = _.find(model.data.sources, { id: reference.id });
+ var source = _.find(request.data.sources, { id: reference.id });
if ( reference.url ) {
items.push("<a target='event' class='natural-event-link' href='" + reference.url + "'>" +
"<i class='fa fa-external-link fa-1'></i>" +