]> git.openstreetmap.org Git - rails.git/commitdiff
show a 'no bbox specified' message for the moment at least. Due to inconsistent locat...
authorHarry Wood <mail@harrywood.co.uk>
Tue, 24 Mar 2009 11:23:56 +0000 (11:23 +0000)
committerHarry Wood <mail@harrywood.co.uk>
Tue, 24 Mar 2009 11:23:56 +0000 (11:23 +0000)
app/controllers/changeset_controller.rb
app/views/changeset/list_bbox.rhtml
public/javascripts/site.js

index 9b09549d0f91def074c5e6bc9065c91cd43072c3..d69e7f4c1f53545aef09385bedbc5a8948c0b498 100644 (file)
@@ -349,9 +349,10 @@ class ChangesetController < ApplicationController
     if params['bbox']
        bbox = params['bbox']
     elsif params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat']
     if params['bbox']
        bbox = params['bbox']
     elsif params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat']
-       bbox = params['minlon'] + ',' + params['minlat'] + ',' + params['maxlon'] + ',' + params['maxlat']
+       bbox = h(params['minlon']) + ',' + h(params['minlat']) + ',' + h(params['maxlon']) + ',' + h(params['maxlat'])
     else
     else
-      redirect_to :action => 'list'
+      #TODO: fix bugs in location determination for history tab (and other tabs) then uncomment this redirect
+      #redirect_to :action => 'list'
     end
        
     conditions = conditions_bbox(bbox);
     end
        
     conditions = conditions_bbox(bbox);
index 4f90d185bec245fd469d020b91c84afdb27db535..63e54e11d10bfca92df2e2ef9a2de146b32c5593 100644 (file)
@@ -8,7 +8,7 @@ if @bbox!=nil
 
        %>
 <p>
 
        %>
 <p>
-Changsets within the area: 
+Changesets within the area: 
 (<a href='/?lat=<%= lat1 %>&lon=<%= lon1 %>&zoom=14'><%= format("%0.3f",lat1) -%>,<%= format("%0.3f",lon1) -%></a>) to 
 (<a href='/?lat=<%= lat2 %>&lon=<%= lon2 %>&zoom=14'><%= format("%0.3f",lat2) -%>,<%= format("%0.3f",lon2) -%></a>)   
 </p>
 (<a href='/?lat=<%= lat1 %>&lon=<%= lon1 %>&zoom=14'><%= format("%0.3f",lat1) -%>,<%= format("%0.3f",lon1) -%></a>) to 
 (<a href='/?lat=<%= lat2 %>&lon=<%= lon2 %>&zoom=14'><%= format("%0.3f",lat2) -%>,<%= format("%0.3f",lon2) -%></a>)   
 </p>
@@ -32,7 +32,19 @@ Changsets within the area:
 </table>
 
 <%= render :partial => 'changeset_paging_nav' %>
 </table>
 
 <%= render :partial => 'changeset_paging_nav' %>
+<%
+       end
+
+else 
+       #bbox is nil. happens if the user surfs to this page directly.
+%>
 
 
-<% end %>
+<p>No area specified</p>
+<p>First use the <a href="/" title="view the map">view tab</a> to pan and zoom to an area of interest, then click the history tab.</p>
+<p>Alternatively view all <%=  link_to("recent changes", :controller => "browse", :action => "changesets") %> </p>
+
+<%
+end
+%>
 <br>
 <br>
 <br>
 <br>
index d381c02314d2b9e7761fa0fac387a05b266c444d..06b4152df9a1267cef030762145d5c2946e117c1 100644 (file)
@@ -62,8 +62,7 @@ function updatelinks(lon,lat,zoom,layers,extents) {
   if (node) {
     if (zoom >= 11) {
       var args = new Object();
   if (node) {
     if (zoom >= 11) {
       var args = new Object();
-      //conjure a bounding box centred at the lat/lon.
-      //TODO: feed actual bounds of the window through to here somehow.
+      //set bbox param from 'extents' object
       minlon = extents.left;
       minlat = extents.bottom;
       maxlon = extents.right;
       minlon = extents.left;
       minlat = extents.bottom;
       maxlon = extents.right;