nrenner / achavi

achavi - Augmented OSM Change Viewer - alpha
MIT License
41 stars 15 forks source link

Pixel-wide hotspots #2

Open Zverik opened 10 years ago

Zverik commented 10 years ago

It is very hard to point mouse cursor at a feature, because all lines are just a pixel wide. Could you please increase "hot" area to 3 pixels? If possible, without increasing visible line widths.

nrenner commented 10 years ago

I agree this is an issue, but I don't know an easy solution. Hit-testing is done by SVG and AFAIK there is no way to specify a pixel tolerance. And I do like those thin lines. From zoom 16 on lines are 2 pixels wide.

When switching to Leaflet, using Canvas and it's custom hit detection might be a solution, but can't tell when that will be.

Zverik commented 10 years ago

Can you draw an invisible wide contour on top of a visible line / polygon and use it for collision testing?

nrenner commented 10 years ago

That might be a better solution, but would need some thought on how to implement to avoid too much impact on memory and performance. I would also want to do this with Leaflet. I need to see how my other stuff goes and probably prioritize switching to Leaflet then.