Skip to content

Commit

Permalink
test with higher res Brazil geojson
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Nov 5, 2024
1 parent a688b62 commit d72080c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/composables/useLeaflet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const useLeaflet = (

// TODO: fix up types again - shouldn't really need to use L
vectorGridLayer.value = vectorGrid.slicer(geoJsonDocument, {
rendererFactory: L.canvas.tile, // or L.svg.tile
//rendererFactory: L.canvas.tile, // or L.svg.tile
interactive: true,
vectorTileLayerStyles: {
sliced: style
Expand Down
13 changes: 9 additions & 4 deletions src/resources/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ export const getIndicators = async (country: string, level: number) => {
};

export const getGeojsonFeatures = async (country: string, level: number) => {
const file =
level === 2
? `geojson/admin${level}/gadm41_${country}_${level}_2_5pc.json`
: `geojson/admin${level}/gadm41_${country}_${level}.json`;
let file = "";
if (level === 2 && country === "BRA") {
file = "geojson/admin2/gadm41_BRA_2_100pc.json"
} else {
file =
level === 2
? `geojson/admin${level}/gadm41_${country}_${level}_2_5pc.json`
: `geojson/admin${level}/gadm41_${country}_${level}.json`;
}
const coll = (await getResource(file)) as Geojson;
return coll.features;
};
Expand Down

0 comments on commit d72080c

Please sign in to comment.