]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/site_controller.rb
Removed code for handling Osmrender export requests
[rails.git] / app / controllers / site_controller.rb
index 301d4a96641bb6d8557536c8ebf3de00baa600c1..cf4465b9c5b185bcdd3b760073083b51c1b842aa 100644 (file)
@@ -1,5 +1,6 @@
 class SiteController < ApplicationController
   layout 'site', :except => [:key, :permalink]
+  layout false, :only => [:key, :permalink]
 
   before_filter :authorize_web
   before_filter :set_locale
@@ -34,7 +35,7 @@ class SiteController < ApplicationController
   def edit
     editor = params[:editor] || @user.preferred_editor || DEFAULT_EDITOR
 
-    if editor == "josm"
+    if editor == "remote"
       render :action => :index
     else
       # Decide on a lat lon to initialise potlatch with. Various ways of doing this
@@ -48,6 +49,19 @@ class SiteController < ApplicationController
         @lat = params['mlat'].to_f
         @zoom = params['zoom'].to_i
 
+      elsif params['bbox']
+        bbox = BoundingBox.from_bbox_params(params)
+
+        @lon = bbox.centre_lon
+        @lat = bbox.centre_lat
+        @zoom = 16
+      elsif params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat']
+        bbox = BoundingBox.from_lon_lat_params(params)
+
+        @lon = bbox.centre_lon
+        @lat = bbox.centre_lat
+        @zoom = 16
+
       elsif params['gpx']
         @lon = Trace.find(params['gpx']).longitude
         @lat = Trace.find(params['gpx']).latitude
@@ -64,7 +78,11 @@ class SiteController < ApplicationController
         #Currently this results in potlatch starting up at 0,0 (Atlantic ocean).
       end
 
-      @zoom = '14' if @zoom.nil?
+      @zoom = '17' if @zoom.nil?
     end
   end
+
+  def copyright
+    @locale = params[:copyright_locale] || I18n.locale
+  end
 end