dojo.provide("view.spatial.plugin"); dojo.require("widgets.analytics._AnalyticsPane"); dojo.declare("view.spatial.plugin", widgets.analytics._AnalyticsPane, { templatePath: dojo.moduleUrl("view.spatial", "plugin.html"), onShow: function() { var _this = this; this.inherited("onShow", arguments); this.googleLoaderDef = new dojo.Deferred(); this.loadGoogleMaps(); this.googleLoaderDef.then(function() { /* place the map */ _this.drawGoogleMap(); dojo.hitch(_this, "reload")(); }); }, setListeners: function() { _this = this; this.subscribe("refresh", dojo.hitch(_this, "reload")); this.subscribe("collectionChanged", dojo.hitch(_this, "reload")); }, /* This method takes care of reloading all data when necessary */ reload: function() { this.getCurrentData(); }, getCurrentData: function() { var _this = this; this.fetchData().then(function(data) { console.log(data); if (data.es_apiResponse === null) return; data.es_apiResponse.ibmsc_facet.ibmsc_facetValue.forEach(function(value ) { if (value.label == "null") return; /* coordinates should be in a format -41.415, 45.21212 */ var position = value.label.indexOf(","); var latitude = parseFloat(value.label.substring(0, position)); 

