visual-tools / tm-globe

GNU Lesser General Public License v3.0
0 stars 0 forks source link

Make cities display content #11

Closed TapdancingRodent closed 7 years ago

TapdancingRodent commented 7 years ago

Pop a label on the cities, associate the cities and labels with content (pdf or video) and hijack the old mouseover code to make it based on city rather than country

christopherreay commented 7 years ago

mouseover? Mouseclick?

TapdancingRodent commented 7 years ago

I've had a look at the underlying mouseover and mouseclick code and I think this is going to be a much bigger problem than I anticipated.

My expectation: Mouse interaction was based on clicking on visual elements which had mouseover/mouseclick hooks The actual method: Mouse position is ray traced onto the globe, converted to latlong coordinates, and checked against country boundaries to find the country which encloses the latlong position and interact with it

The best workaround that I can see for making mouseover work for cities is to dummy up some city "boundaries" which loosely match the rendered sphere at the city's location, massage them into a GeoJSON format and hand them off to the same boundary detection function which is being used to processed the country boundaries (in the geoHelpers library). I would estimate this will take 2-4 hours and I'll crack on with it some time tomorrow unless someone else has a better idea? Honestly I'll take anything!

christopherreay commented 7 years ago

obsolete #17