[openstreetmap-website] In certain situations, closing the pane with information about an element moves the center of map to a different position (#729)

M Somerville notifications at github.com
Thu May 28 09:19:46 UTC 2015

I hear you. I'm sure this isn't helpful, but I can't find an example where opening the left sidebar moves the map (and I agree with you, I also don't really see why there should be one). Starting with a normal map page (nothing in URL but location hash): opening History sidebar, doesn't move map (just clicking History sidebar and closing sidebar is a quick way to see the pan of this ticket). Export sidebar, doesn't move map. New note sidebar, doesn't move map. Search sidebar, doesn't move map. Directions sidebar, fits to bounds of direction lookup, not a "move" that needs resetting when sidebar closed (and it doesn't do that anyway). Query features, click feature, sidebar doesn't move map. Search results/query results - fitBounds of way/relation, again not related to sidebar.

When you go direct to a directions page, e.g. http://www.openstreetmap.org/directions?engine=osrm_car&route=53.479%2C-2.245%3B51.507%2C-0.128 it does pan the map out of the way of the sidebar; and then (correctly IMO) does nothing when you close the sidebar. So there's already precedent there. If you go directly to some other type of pages e.g. a way page, such as http://www.openstreetmap.org/way/168906294 – then the map pans out of the way of the sidebar, and closing that sidebar causes the issue of this ticket. Doing the same as directions and doing nothing upon sidebar closure seems okay to me, I don't expect the map to pan just because I've closed the sidebar (and indeed as you say, the right sidebar never does).

How about just trying never moving the map on sidebar closure, and seeing if anyone raises a bug? ;-) It sounds like that might simplify your code a little anyway. And this issue appears much more obvious. Thanks for your time and work on this, regardless!

Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20150528/a3137209/attachment.html>

More information about the rails-dev mailing list