From e05adbb917adef34700858e9c0b46cc81cf59120 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 5 Dec 2013 16:10:28 -0800 Subject: [PATCH] Obey the location hash for edit URLs with objects For a link like http://osm.org/edit?node=n#map=19/37.77683/-122.41459, select the feature but also respect the map location. This is the fix for iD. It appears P2 requires internal code modifications. Refs #620 --- app/views/site/_id.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/site/_id.html.erb b/app/views/site/_id.html.erb index 6409582cd..f88942669 100644 --- a/app/views/site/_id.html.erb +++ b/app/views/site/_id.html.erb @@ -8,6 +8,10 @@ var mapParams = OSM.mapParams(); if (mapParams.object) { params.id = mapParams.object.type[0] + mapParams.object.id; + mapParams = OSM.parseHash(location.hash); + if (mapParams.center) { + params.map = mapParams.zoom + '/' + mapParams.center.lng + '/' + mapParams.center.lat; + } } else { <% if @lat && @lon -%> params.map = '16/<%= @lon %>/<%= @lat %>'; -- 2.43.2