class BrowseController < ApplicationController
before_filter :authorize_web
layout 'site'
+
def way_view
begin
- way = Way.find(params[:id])
+ @way = Way.find(params[:id])
- @way = way
@name = @way.tags['name'].to_s
if @name.length == 0:
@name = "#" + @way.id.to_s
- end
+ end
+
@title = 'Way | ' + (@name)
-
rescue ActiveRecord::RecordNotFound
render :nothing => true, :status => :not_found
end
end
+
def node_view
begin
- node = Node.find(params[:id])
+ @node = Node.find(params[:id])
- @node = node
@name = @node.tags_as_hash['name'].to_s
if @name.length == 0:
@name = "#" + @node.id.to_s
- end
+ end
+
@title = 'Node | ' + (@name)
-
rescue ActiveRecord::RecordNotFound
render :nothing => true, :status => :not_found
end
<li><%= link_to h("API"), :controller => "api/#{API_VERSION}/"+type, :id => obj.id %></li>
<li><%= link_to h("History"), :controller => "api/#{API_VERSION}/"+type, :id => obj.id, :action => "history" %></li>
</ul>
-Last edited: <%= h(obj.timestamp) %><% if obj.user.data_public %>,
- by <%= link_to h(obj.user.display_name), :controller => 'user', :action => 'view' , :display_name => obj.user.display_name %>
+Last edited: <%= h(obj.timestamp) %>
+<% if obj.user.data_public %>
+by <%= link_to h(obj.user.display_name), :controller => 'user', :action => 'view' , :display_name => obj.user.display_name %>
<% end %>
-
var osm_layer = new OpenLayers.Layer.GML("OSM", url, {format: OpenLayers.Format.OSM, projection: new OpenLayers.Projection("EPSG:4326")});
osm_layer.events.register("loadend", osm_layer, function() {
$("loading").innerHTML = "";
- this.map.zoomToExtent( this.features[0].geometry.getBounds());
- var center = map.getCenter().clone().transform(this.map.getProjectionObject(), new OpenLayers.Projection("EPSG:4326"));
+ this.map.zoomToExtent(this.features[0].geometry.getBounds());
+ var center = getMapCenter();
$("larger_map").href = '/?lat='+center.lat+'&lon='+center.lon+'&zoom='+this.map.getZoom();
$("larger_map").innerHTML = "View Larger Map";
})