Skip to content

Commit

Permalink
Merge pull request #212 from wearepal/select-project-extent
Browse files Browse the repository at this point in the history
use model.zoom on categorical/boolean snapshot instead of zoom level = 20
  • Loading branch information
paulthatjazz authored Nov 24, 2023
2 parents 7734fed + a9ef149 commit de36da2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/javascript/projects/analysis_panel_tools/subsection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function extentToChartData(colors: Color[] | undefined, model: BooleanTil

if (model instanceof CategoricalTileGrid) {

const area = getArea(fromExtent(tileGrid.getTileCoordExtent([20, x, y]))) / 1000000
const area = getArea(fromExtent(tileGrid.getTileCoordExtent([model.zoom, x, y]))) / 1000000

const value = model.labels.get(model.get(x, y)) ? model.labels.get(model.get(x, y)) : "No Data"
const count = counts.get(value) || 0
Expand All @@ -58,7 +58,7 @@ export function extentToChartData(colors: Color[] | undefined, model: BooleanTil

} else {

const area = model instanceof NumericTileGrid ? 1 : getArea(fromExtent(tileGrid.getTileCoordExtent([20, x, y]))) / 1000000
const area = model instanceof NumericTileGrid ? 1 : getArea(fromExtent(tileGrid.getTileCoordExtent([model.zoom, x, y]))) / 1000000
const value = model.get(x, y)


Expand Down

0 comments on commit de36da2

Please sign in to comment.