]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/_potlatch2.html.erb
Make setPosition reposition Potlatch 2 instead of reloading it
[rails.git] / app / views / site / _potlatch2.html.erb
index 57a45f2abb027216bfccab58f5de221e72cf720e..8256540298f6d8f0c8b104f32c23742a4042e9e2 100644 (file)
@@ -24,6 +24,9 @@
     fo.addParam("base","/potlatch2");
     if (lat) { fo.addVariable("lat",lat); }
     if (lon) { fo.addVariable("lon",lon); }
+    <% if params['gpx'] %>
+    fo.addVariable('gpx' ,'<%= h(params['gpx']) %>');
+    <% end %>
     fo.addVariable("zoom",zoom);
     fo.addVariable("api","http://<%= SERVER_URL %>/api/<%= API_VERSION %>/");
     fo.addVariable("policy","http://<%= SERVER_URL %>/api/crossdomain.xml");
@@ -40,6 +43,6 @@
   doSWF(<%= @lat || 'null' %>,<%= @lon || 'null' %>,<%= @zoom %>);
 
   function setPosition(lat, lon, zoom) {
-    doSWF(lat, lon, zoom || 15);
+    $("potlatch").setPosition(lat, lon, Math.max(zoom || 15, 13));
   }
 </script>