Search code examples
highmaps

Highmaps US County map is missing New York and DC (among others)


Seems like the US County map for Highmaps is missing New York and DC (among others)

http://www.highcharts.com/maps/demo/us-counties

Is there a complete and correct geojson US-county map available?


Solution

  • The good news is that the GeoJSON does include New York and DC (and I'm fairly certain all counties in the US). What you are experiencing are two separate issues.

    For DC, it is already drawn on the map, but the problem is simply that it has no data to display from the source. Therefor it appears as though it is just a hole in the map. The path for DC is drawn and very much visible (just not lively colored). Change the fill color to black and you'll see it.

    For New York county it is also drawn on the map, but unfortunately it is only 1 pixel wide and doesn't show up at all visually even when zoomed. This could be fixed by altering the geometry of the GeoJSON data for that county specifically. To see that it is there you could give it an id in the data and use Point.zoomTo to see where it would've been (if visible).

    I'm not certain what defines "correct", but you're not going to get a GeoJSON on a centimeter-scale of correctness, so it comes down to how many points you want to use for the geometry of each element.

    If you look at the drilldown map it is even more coarse when displaying the overall map, but when zooming in it shows New York county perfectly. Perhaps you could somehow combine or utilize the different levels of granularity of the different GeoJSON files.