trailheadlabs / outerspatial-map-library

A Leaflet plugin built for use in OuterSpatial
https://www.trailheadlabs.com/labs/outerspatial-map-library/
Other
6 stars 1 forks source link

Add interactivity "buffer" around vector features #129

Closed nateirwin closed 6 years ago

nateirwin commented 6 years ago

We started to work on something like this while I was at NPS but never finished our solution. Basically, the problem is that some vector features overlaid on the map are difficult to interact with because the clickable radius around, say, a line often isn't large enough. This issue is especially noticeable on mobile devices.

One obvious solution is to bump up the width of a line. This isn't always ideal, though, because this means the line's width has to get bumped up as well. We should think about this and either:

  1. Come up with good guidance on how to style lines and defaults in the OuterSpatial preset and Map Builder
  2. Programatically increase the click/tap radius around vector features using something like https://github.com/makinacorpus/Leaflet.AlmostOver
jmoe commented 6 years ago

Can you do zoom-dependent widths in the builder renderer? I find it really handy in GL maps that increase path width as you zoom in. Just an idea, dunno if it's possible in builder maps.

nateirwin commented 6 years ago

Yeah, think we can add zoom-dependent widths pretty easily. May work better than a "buffer".

nateirwin commented 6 years ago

After discussing with @ryanjhodge, I think we want to support both a "buffer" and zoom-dependent rendering. I've separated the zoom-dependent rendering to a new issue: https://github.com/trailheadlabs/outerspatial-map-library/issues/133.

nateirwin commented 6 years ago

This is working well on staging — much better!

ryanbranciforte commented 6 years ago

I did a quick test on a staging map, so much better. On mobile in particular.