diff --git a/app/assets/javascripts/map/presenters/analysis/AnalysisCountryPresenter.js b/app/assets/javascripts/map/presenters/analysis/AnalysisCountryPresenter.js index 13290da1c3..eddedda24e 100644 --- a/app/assets/javascripts/map/presenters/analysis/AnalysisCountryPresenter.js +++ b/app/assets/javascripts/map/presenters/analysis/AnalysisCountryPresenter.js @@ -36,6 +36,7 @@ define([ country: null, regions: null, region: null, + layers: [], overlay_stroke_weight: 2 } @@ -53,6 +54,8 @@ define([ this.status.on('change:regions', this.changeRegions.bind(this)); + this.status.on('change:layers', this.changeLayers.bind(this)); + this.status.on('change:enabled', this.changeEnabled.bind(this)); this.status.on('change:enabledSubscription', this.changeEnabledSubscription.bind(this)); }, @@ -74,8 +77,18 @@ define([ region: params.iso.region }, isoDisabled: (!!params.dont_analyze) || !(!!params.iso.country && params.iso.country != 'ALL'), + fit_to_geom: !!params.fit_to_geom, + layers: params.baselayers - fit_to_geom: !!params.fit_to_geom + }); + } + }, + // Temp: to disable the regions selector + // for GLAD and terra-i + { + 'LayerNav/change': function(layerSpec) { + this.status.set({ + layers: _.clone(layerSpec.attributes) }); } }, @@ -158,6 +171,10 @@ define([ this.view.setSelects(); }, + changeLayers: function() { + this.view.render(); + }, + /** * ACTIONS diff --git a/app/assets/javascripts/map/templates/analysis/analysis-country.handlebars b/app/assets/javascripts/map/templates/analysis/analysis-country.handlebars index 58edfeff0c..5cf86af9ed 100644 --- a/app/assets/javascripts/map/templates/analysis/analysis-country.handlebars +++ b/app/assets/javascripts/map/templates/analysis/analysis-country.handlebars @@ -5,9 +5,11 @@ {{/each}} - + {{#if showRegions}} + + {{/if}}