Map is broken / filled in, despite using valid GeoJSON
See original GitHub issueI’m creating a map in the style of the example at https://www.react-simple-maps.io/docs/geographies/. The only difference is that instead of a link to a TopoJSON file, I am using an array of GeoJSON MultiPolygons. The exact object I’m passing to Geographies
can be found in this gist. If you want to see what it looks like, here it is formatted as a FeatureCollection. It’s valid, because GitHub manages to display it fine.
What I get looks like this:
The stroke I’m using is red
, and the fill is black
.
What I expect to happen is something like the GitHub display linked above, but this isn’t what happens. Any help is appreciated!
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Choropleth map not working with my geojson data
Any idea why my choropleth plot is not working out? It just shows one of the 11 areas and colors the rest of...
Read more >geojson fill broken · Issue #8161 · mapbox/mapbox-gl-js · GitHub
Your GeoJSON is not valid — in the first feature, an inner ring (hole) is outside of the outer polygon. We can't technically...
Read more >D3 V6 and JavaScript - GeoJSON fill is "spilling" outside of path
Closed 2 years ago. Creating a map using D3 V6, showing educational attainment by county. I have a counties.topojson and csvData.csv which are ......
Read more >Chapter 7 GeoJSON | Introduction to Web Mapping
This chapter is devoted to more in-depth treatment of the format and its use in web maps. GeoJSON has become a very popular...
Read more >GeoJSON Hosted Layer Error - Esri Community
I'm attempting to publish a geojson file as a hosted layer to ArcGIS Online but it gives me "There was an error".
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Don’t worry, managed to fix it! My pipeline ended up looking like:
@mapbox/geojson-rewind
(settingclockwise
totrue
- important)topojson-server
topojson-simplify
(which expects smaller values for the weight threshold than I expected!)Thanks again for all your help! 😃
Ah, that helps a lot, thank you! I think I’m going to end up converting GeoJSON to TopoJSON server-side and sending that over, then using it for the map, since that’ll help loading times as well as making it work. Thanks again.