From a693fc9a3c7f35a567dc3dd07b16adf3991c441c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 26 Nov 2011 16:39:52 +0000 Subject: [PATCH 1/1] When asked to edit an object centre on the correct location --- app/views/site/_potlatch2.html.erb | 8 ++++++++ 1 file changed, 8 insertions(+) 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 () { -- 2.43.2