show a 'no bbox specified' message for the moment at least. Due to inconsistent location detecting across tabs, the history tab often gets nil bbox (Need to fix for all tabs) + other history tab tweaks

This commit is contained in:
Harry Wood 2009-03-24 11:23:56 +00:00
parent 6167bb6502
commit 0f3e5a28c0
3 changed files with 18 additions and 6 deletions

View file

@ -349,9 +349,10 @@ class ChangesetController < ApplicationController
if params['bbox'] if params['bbox']
bbox = params['bbox'] bbox = params['bbox']
elsif params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat'] 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 end
conditions = conditions_bbox(bbox); conditions = conditions_bbox(bbox);

View 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=<%= 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>) (<a href='/?lat=<%= lat2 %>&lon=<%= lon2 %>&zoom=14'><%= format("%0.3f",lat2) -%>,<%= format("%0.3f",lon2) -%></a>)
</p> </p>
@ -32,7 +32,19 @@ Changsets within the area:
</table> </table>
<%= render :partial => 'changeset_paging_nav' %> <%= render :partial => 'changeset_paging_nav' %>
<%
end
<% end %> else
#bbox is nil. happens if the user surfs to this page directly.
%>
<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>

View file

@ -62,8 +62,7 @@ function updatelinks(lon,lat,zoom,layers,extents) {
if (node) { if (node) {
if (zoom >= 11) { if (zoom >= 11) {
var args = new Object(); var args = new Object();
//conjure a bounding box centred at the lat/lon. //set bbox param from 'extents' object
//TODO: feed actual bounds of the window through to here somehow.
minlon = extents.left; minlon = extents.left;
minlat = extents.bottom; minlat = extents.bottom;
maxlon = extents.right; maxlon = extents.right;