Reputation: 181
I am displaying a very basic map of the US; just the states. What I'm looking for is a good method for dividing the map into regions, with a single hover (all the states in the region change color) and click listener.
So far the best option if found is here: How/Where do I get geoJSON data for states, provinces, and administrative regions of non-US countries?
That seems like a lot more work than it should be. Anyone have suggestions for a better method than importing 50 different shape files, and manually editing them into regions?
Upvotes: 3
Views: 2820
Reputation: 8153
This demo is near what you want:
http://bl.ocks.org/mbostock/4060606
http://bl.ocks.org/mbostock/raw/4060606/
http://bl.ocks.org/mbostock/raw/4090846/us.json
What you're going to want to do is manipulate the us.json file; offhand I don't see state names but I see ids, create your regions by merging states in the region into one ID. try applying your own onclick/hover, if you can't get it, share what you tried and we'll go from there.
Upvotes: 2