As reported in #3971, some URLs like https://www.openstreetmap.org/?mlat=53.32607&mlon=-1.49033 reset the currently selected layers. In order to restore the previous setting, a user needs to select both map and overlay layers after click on the link.
It seems a bit premature to simply override the current layers, in case the link does not include any layer information. Instead, this PR unconditionally extracts the current layers from the _osm_location cookie, so it can be applied consistently across different url parsing alterantives. As before, if the link includes layers in the hash value, that information takes precedence. This change mainly impacts line 144 below: ``` mapParams.layers = hash.layers || (loc && loc[3]) || ''; ``` loc[3] will now always contain the selected layers, as long as the cookie is available. You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5529 -- Commit Summary -- * Consistent usage of layer information in _osm_location cookie -- File Changes -- M app/assets/javascripts/osm.js.erb (7) -- Patch Links -- https://github.com/openstreetmap/openstreetmap-website/pull/5529.patch https://github.com/openstreetmap/openstreetmap-website/pull/5529.diff -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5529 You are receiving this because you are subscribed to this thread. Message ID: <openstreetmap/openstreetmap-website/pull/5...@github.com>
_______________________________________________ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev