Replies: 1 comment
-
+1. We would essentially like to use the default |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
I am trying to render a US Map not unlike the example here. https://observablehq.com/@d3/us-state-choropleth/2
I'm not quite sure how best to approach this and I've been stuck for a couple of days.
I'm able to render my layer just fine with the following GeoJsonLayer. I'm using fixed size to make the projection bounds easier for now.
I've rendered this data using the following projection in 2d Canvas and SVG before.
This is my approach to converting the coordinates.
I've also tried a few combinations of swapping out
coordinateSystem
forCARTESIAN
and using OrthograhpicView but all i ever get is a blank canvas when loading the projected coordinates with GeoJson Layer.I got very close by using
PolygonLayer
, however that has a caveat of not supportingMultiPolygon
geometries. Only the first geometry is treated as the outer boundary and the rest as holes so territories LA county which has islands aren't filled correctly (well it's "correct" but not what I need). I suppose I could completely blow out the GeoJson to account for this and will as a last resort, but it feels heavy handed.I honestly don't care about actually using the
d3.geoAlbersUsa
projection so much as I want to scale and transform Alaska. I'm aware there are some functions in Turf.js which can help with that but I want to make sure i'm not overlooking a simpler solution.Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions