wri / gfw

Global Forest Watch: An online, global, near-real time forest monitoring tool

Home Page:https://www.globalforestwatch.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make tables dynamic when drawing polygon after analysis

d4weed opened this issue · comments

In

https://github.com/Vizzuality/gfw/blob/develop/app/assets/javascripts/map/presenters/AnalysisToolPresenter.js

The query to paint the geojson should take table name from layerspec

'logging': 'http://wri-01.cartodb.com/api/v2/sql/?q=SELECT ST_AsGeoJSON(the_geom) from gfw_logging where cartodb_id ={0}',
'mining':'http://wri-01.cartodb.com/api/v2/sql/?q=SELECT ST_AsGeoJSON(the_geom) from gfw_mining where cartodb_id ={0}',
'oilpalm': 'http://wri-01.cartodb.com/api/v2/sql/?q=SELECT ST_AsGeoJSON(the_geom) from gfw_oil_palm where cartodb_id ={0}',
'fiber': 'http://wri-01.cartodb.com/api/v2/sql/?q=SELECT ST_AsGeoJSON(the_geom) from gfw_wood_fiber where cartodb_id ={0}'

Fixed here: 2847ac7

Deployed to PRO.