diff --git a/app/javascript/projects/analysis_panel_tools/subsection.ts b/app/javascript/projects/analysis_panel_tools/subsection.ts index ca31a882..9b52449d 100644 --- a/app/javascript/projects/analysis_panel_tools/subsection.ts +++ b/app/javascript/projects/analysis_panel_tools/subsection.ts @@ -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 @@ -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)