From: Tom Hughes Date: Sat, 26 Nov 2011 16:39:52 +0000 (+0000) Subject: When asked to edit an object centre on the correct location X-Git-Tag: live~6506 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/a693fc9a3c7f35a567dc3dd07b16adf3991c441c When asked to edit an object centre on the correct location --- diff --git a/app/views/site/_potlatch2.html.erb b/app/views/site/_potlatch2.html.erb index e7a2564f9..c443a917a 100644 --- a/app/views/site/_potlatch2.html.erb +++ b/app/views/site/_potlatch2.html.erb @@ -60,7 +60,15 @@ // 700,600 for fixed size, 100%,100% for resizable } + <% if params[:node] -%> + <% bbox = Node.find(params[:node]).bbox.to_unscaled -%> + doSWF(<%= bbox.centre_lat %>,<%= bbox.centre_lon %>,16); + <% elsif params[:way] -%> + <% bbox = Way.find(params[:way]).bbox.to_unscaled -%> + doSWF(<%= bbox.centre_lat %>,<%= bbox.centre_lon %>,16); + <% else -%> doSWF(<%= @lat || 'null' %>,<%= @lon || 'null' %>,<%= @zoom %>); + <% end -%> function setPosition(lat, lon, zoom) { $("#potlatch").each(function () {