<th>Bounding box:</th>
<% if changeset_details.max_lat.nil? or changeset_details.min_lat.nil? or changeset_details.max_lon.nil? or changeset_details.min_lon.nil? %>
<td>No bounding box has been stored for this changeset.</td>
- <% else %>
+ <%
+ else
+ minlon = changeset_details.min_lon/GeoRecord::SCALE.to_f
+ minlat = changeset_details.min_lat/GeoRecord::SCALE.to_f
+ maxlon = changeset_details.max_lon/GeoRecord::SCALE.to_f
+ maxlat = changeset_details.max_lat/GeoRecord::SCALE.to_f
+ %>
<td>
<table>
<tr>
- <td colspan="2" style="text-align:center"><%= changeset_details.max_lat/GeoRecord::SCALE.to_f -%></td>
+ <td colspan="3" style="text-align:center"><%=maxlat -%></td>
</tr>
<tr>
- <td><%= changeset_details.min_lon/GeoRecord::SCALE.to_f -%></td>
- <td><%= changeset_details.max_lon/GeoRecord::SCALE.to_f -%></td>
+ <td><%=minlon -%></td>
+ <td>(<a href='/?minlon=<%= minlon %>&minlat=<%= minlat %>&maxlon=<%= maxlon %>&maxlat=<%= maxlat %>&box=yes' title='show area box'>box</a>)</td>
+ <td><%=maxlon -%></td>
</tr>
<tr>
- <td colspan="2" style="text-align:center"><%= changeset_details.min_lon/GeoRecord::SCALE.to_f -%></td>
+ <td colspan="3" style="text-align:center"><%= minlon -%></td>
</tr>
</table>
</td>
<% if changeset.min_lat.nil? %>
(no edits)
<% else
- lat1 = changeset.min_lat/GeoRecord::SCALE.to_f
- lat2 = changeset.max_lat/GeoRecord::SCALE.to_f
- lon1 = changeset.min_lon/GeoRecord::SCALE.to_f
- lon2 = changeset.max_lon/GeoRecord::SCALE.to_f
+ minlon = changeset.min_lon/GeoRecord::SCALE.to_f
+ minlat = changeset.min_lat/GeoRecord::SCALE.to_f
+ maxlon = changeset.max_lon/GeoRecord::SCALE.to_f
+ maxlat = changeset.max_lat/GeoRecord::SCALE.to_f
%>
- (<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='/?minlon=<%= minlon %>&minlat=<%= minlat %>&maxlon=<%= maxlon %>&maxlat=<%= maxlat %>&box=yes' title='show area box'><%= format("%0.3f",minlon) -%>,<%= format("%0.3f",minlat) -%>,<%= format("%0.3f",maxlon) -%>,<%= format("%0.3f",maxlat) -%></a>)
<% end %>
</td>
<p>
For more changesets, select a user and view their edits, or see the editing 'history' of a specific area.
</p>
-
+<br>
<h1>History</h1>
<%
if @bbox!=nil
- lon1 = @bbox[0]
- lat1 = @bbox[1]
- lon2 = @bbox[2]
- lat2 = @bbox[3]
+ minlon = @bbox[0]
+ minlat = @bbox[1]
+ maxlon = @bbox[2]
+ maxlat = @bbox[3]
%>
<p>
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>)
+ (<a href='/?minlon=<%= minlon %>&minlat=<%= minlat %>&maxlon=<%= maxlon %>&maxlat=<%= maxlat %>&box=yes' title='show area box'><%= format("%0.3f",minlon) -%>,<%= format("%0.3f",minlat) -%>,<%= format("%0.3f",maxlon) -%>,<%= format("%0.3f",maxlat) -%></a>)
+
</p>
<% if @edits.nil? or @edits.empty? %>
</table>
<%= render :partial => 'changeset_paging_nav' %>
+
+<p>For all changes everywhere see <%= link_to("Recent Changes", :controller => "browse", :action => "changesets") %> </p>
+
<%
end
end
%>
<br>
-<br>
+
</table>
<%= render :partial => 'changeset_paging_nav' %>
<% end %>
+
+<p>For changes by all users see <%= link_to("Recent Changes", :controller => "browse", :action => "changesets") %> </p>
+<br>
+
minlat = h(params['minlat'])
maxlon = h(params['maxlon'])
maxlat = h(params['maxlat'])
+ box = true if params['box']=="yes"
end
# Decide on a lat lon to initialise the map with. Various ways of doing this
var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>);
setMapExtent(bbox);
+ <% if box %>
+ box = addBoxToMap(bbox);
+ <% end %>
<% else %>
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
var zoom = <%= zoom %>;
- <% if params['scale'] and params['scale'].length > 0 then %>
+ <% if params['scale'] and params['scale'].length > 0 then %>
zoom = scaleToZoom(<%= params['scale'].to_f() %>);
- <% end %>
+ <% end %>
setMapCenter(centre, zoom);
<% end %>
var epsg4326 = new OpenLayers.Projection("EPSG:4326");
var map;
var markers;
+var vectors;
var popup;
var nonamekeys = {
projection: "EPSG:900913"
});
map.addLayer(markers);
+
+ vectors = new OpenLayers.Layer.Vector("Vectors", {
+ displayInLayerSwitcher: false,
+ numZoomLevels: numZoomLevels,
+ maxExtent: new OpenLayers.Bounds(-20037508,-20037508,20037508,20037508),
+ maxResolution: 156543,
+ units: "m",
+ projection: "EPSG:900913"
+ });
+ map.addLayer(vectors);
+
return map;
}
return marker;
}
+function addBoxToMap(boxbounds) {
+ box = new OpenLayers.Feature.Vector(
+ boxbounds.toGeometry().transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()) );
+
+ box.style = {
+ 'strokeWidth': 3,
+ 'strokeColor': '#0000ff',
+ 'fillOpacity': 0,
+ };
+ vectors.addFeatures(box);
+ return box;
+}
+
function openMapPopup(marker, description) {
closeMapPopup();
markers.removeMarker(marker);
}
+function removeBoxFromMap(box){
+ vectors.removeFeature(box);
+}
+
function getMapCenter(center, zoom) {
return map.getCenter().clone().transform(map.getProjectionObject(), epsg4326);
}