-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
GeoJSON results in a Black Screen where the component is placed #290
Comments
Hi @soupmoth, <Geogrpahy key={geo.rsmKey} geography={geo} fill="none" stroke="#000" /> Your react-simple-maps code seems ok and it does seem to be rendering something. The map file could be a bit complex for SVG, but it should still be able to render it. You could try dropping the json in here to see if it works correctly: |
accidnt sorry lol |
went through this line of thinking, spent the day poking around looking for a solution, and couldn't make any progress. The JSON file works in MapShaper and something is being rendered as you said, and its clearly more complex then a black square because the patchy black lines. The only lead I have is it seems all 632 constituencies in this segment of the map are actually being registered, but from what I can tell, are all rendered at the same scale as each other??? So it overlaps in this weird way??? |
I just noticed that in the screenshot from mapshaper, this seems to be a pre-projected topojson file?
Then export the file as topojson and try to load it into react-simple-maps. Does it work then?
Note that if you are using |
New to React so forgive me if this is user error, but I've been stuck on this for 2 days.
My project currently is building an Electoral Map of the UK, representing all 650 constituencies and showing how different election systems, such as PR, AV, and STV can alter the result of elections. To do this, I wish to be able to use the react simple maps framework!
Instead, despite the JSON seemingly being correctly loaded as seen here in the console log

This is what I get

This is my code, where ElectoralMap is the child of another component
The directory.

JSON I'm using and ElectoralMap.js
The text was updated successfully, but these errors were encountered: