-end
-
-# Decide on a lat lon to initialise the map with. Various ways of doing this
-if params['lon'] and params['lat']
- lon = h(params['lon'])
- lat = h(params['lat'])
- zoom = h(params['zoom'] || '5')
- layers = h(params['layers'])
+elsif params[:minlon] and params[:minlat] and params[:maxlon] and params[:maxlat]
+ bbox = true
+ minlon = params[:minlon].to_f
+ minlat = params[:minlat].to_f
+ maxlon = params[:maxlon].to_f
+ maxlat = params[:maxlat].to_f
+ layers = params[:layers]
+ box = true if params[:box]=="yes"
+ object_zoom = false
+elsif params[:lon] and params[:lat]
+ lon = params[:lon].to_f
+ lat = params[:lat].to_f
+ zoom = params.fetch(:zoom, 5).to_i
+ layers = params[:layers]