[openstreetmap/openstreetmap-website] Map pans to improved position when clicking on directions (#1745)
Tom Hughes
notifications at github.com
Tue Feb 13 00:49:24 UTC 2018
Here's my suggestion - it comes in two steps:
* When the popup is created specify `autoPanPadding: [100, 100]` or similar in the options so that there is some padding from the edge of the map when it opens.
* Rather than panning to the popup after opening, pan to the route before doing so by doing `panInsideBounds(polyline.getBounds().pad(0.05))` on the map so that the map pans back to the route but without changing zoom.
That way we ensure the user is looking at the route if they have panned away, and we prevent popups being to close to the edge, but without constantly panning the map to keep it dead centre.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1745#issuecomment-365113871
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180213/fc9555e0/attachment.html>
More information about the rails-dev
mailing list