0

So I had a GeoJSON of UK Counties (was actually KML before) and converted it to TopoJSON using the topojson node package.

topojson -o map-england.json -p --simplify-proportion .2 topo-map-england.json

This worked well in terms of reducing the file size and with simplification, it drastically improved the panning and zooming of the map.

uk counties

However, in the conversion, my map now consists of a single path where before I had a path for each county.

map path

Before I was able to add a mouseover event that added a CSS class to the hovered path and that applied a colour change. Now however, when I move my mouse over any county, the whole map changes in colour because the whole map is one giant path!

How does one overcome this? Have I gone about this the wrong way?

halfer
  • 19,824
  • 17
  • 99
  • 186
J86
  • 14,345
  • 47
  • 130
  • 228
  • Are you able to show/link your source GeoJSON? And maybe to be complete add the commandline string you're using to make the conversion. – iH8 Feb 02 '15 at 11:44
  • See http://bl.ocks.org/mbostock/4206573 -- use `.features` on the structure returned by `topojson.feature()`. – Lars Kotthoff Feb 02 '15 at 11:46
  • @iH8 updated question with information you asked. – J86 Feb 02 '15 at 11:57

0 Answers0