# the delete_with_relations_and_nodes_and_history method should do this,
# but at present it just throws a 'precondition failed'
way=way.to_i
- db_now='@now'+(rand*100).to_i.to_s+uid.to_s+id.to_i.abs.to_s+Time.new.to_i.to_s
- db_uqn='unin'+(rand*100).to_i.to_s+uid.to_s+way.to_i.abs.to_s+Time.new.to_i.to_s
+ db_now='@now'+(rand*100).to_i.to_s+uid.to_s+way.abs.to_s+Time.new.to_i.to_s
+ db_uqn='unin'+(rand*100).to_i.to_s+uid.to_s+way.abs.to_s+Time.new.to_i.to_s
ActiveRecord::Base.connection.execute("SET #{db_now}=NOW()")
createuniquenodes(way,db_uqn,[])
deleteuniquenoderelations(db_uqn,uid,db_now)
def list
if params[:display_name]
@this_user = User.find_by_display_name(params[:display_name])
- @title = @this_user.display_name + "'s diary"
- @entry_pages, @entries = paginate(:diary_entries,
- :conditions => ['user_id = ?', @this_user.id],
- :order => 'created_at DESC',
- :per_page => 20)
+ if @this_user
+ @title = @this_user.display_name + "'s diary"
+ @entry_pages, @entries = paginate(:diary_entries,
+ :conditions => ['user_id = ?', @this_user.id],
+ :order => 'created_at DESC',
+ :per_page => 20)
+ else
+ @not_found_user = params[:display_name]
+ render :action => 'no_such_user', :status => :not_found
+ end
else
@title = "Users' diaries"
@entry_pages, @entries = paginate(:diary_entries,
Notifier::deliver_message_notification(@message)
redirect_to :controller => 'message', :action => 'inbox', :display_name => @user.display_name
end
+ else
+ @title = params[:title]
end
end
def reply
message = Message.find(params[:message_id], :conditions => ["to_user_id = ? or from_user_id = ?", @user.id, @user.id ])
- title = message.title.sub(/^Re:\s*/, "Re: ")
- redirect_to :action => 'new', :user_id => message.from_user_id, :title => title
+ @body = "On #{message.sent_on} #{message.sender.display_name} wrote:\n\n#{message.body.gsub(/^/, '> ')}"
+ @title = "Re: #{message.title.sub(/^Re:\s*/, '')}"
+ @user_id = message.from_user_id
+ render :action => 'new'
rescue ActiveRecord::RecordNotFound
render :nothing => true, :status => :not_found
end
def view
@trace = Trace.find(params[:id])
- @title = "Viewing trace #{@trace.name}"
- if !@trace.visible?
- render :nothing => true, :status => :not_found
- elsif !@trace.public? and @trace.user.id != @user.id
- render :nothing => true, :status => :forbidden
+
+ if @trace and @trace.visible? and
+ (@trace.public? or @trace.user.id == @user.id)
+ @title = "Viewing trace #{@trace.name}"
+ else
+ flash[:notice] = "Trace not found!"
+ redirect_to :controller => 'trace', :action => 'list'
end
rescue ActiveRecord::RecordNotFound
- render :nothing => true, :status => :not_found
+ flash[:notice] = "Trace not found!"
+ redirect_to :controller => 'trace', :action => 'list'
end
def create
conditions[0] += " AND users.display_name = ?"
conditions << params[:display_name]
end
-
+
if params[:tag]
conditions[0] += " AND EXISTS (SELECT * FROM gpx_file_tags AS gft WHERE gft.gpx_id = gpx_files.id AND gft.tag = ?)"
conditions << params[:tag]
@title = 'create account'
@user = User.new(params[:user])
+ @user.data_public = true
+
if @user.save
token = @user.tokens.create
flash[:notice] = "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)<br>Please note that you won't be able to login until you've received and confirmed your email address."
if @this_user
@title = @this_user.display_name
else
- render :nothing => true, :status => :not_found
+ @not_found_user = params[:display_name]
+ render :action => 'no_such_user', :status => :not_found
end
end
+# Update and read user preferences, which are arbitrayr key/val pairs
class UserPreferenceController < ApplicationController
before_filter :authorize
- def read
+ def read_one
+ pref = UserPreference.find(@user.id, params[:preference_key])
+
+ if pref
+ render :text => pref.v.to_s
+ else
+ render :text => 'OH NOES! PREF NOT FOUND!', :status => 404
+ end
+ end
+
+ def update_one
+ begin
+ pref = UserPreference.find(@user.id, params[:preference_key])
+ pref.v = request.raw_post.chomp
+ pref.save
+ rescue ActiveRecord::RecordNotFound
+ pref = UserPreference.new
+ pref.user = @user
+ pref.k = params[:preference_key]
+ pref.v = request.raw_post.chomp
+ pref.save
+ end
+
+ render :nothing => true
+ end
+ def delete_one
+ UserPreference.delete(@user.id, params[:preference_key])
+
+ render :nothing => true
+ end
+
+ # print out all the preferences as a big xml block
+ def read
doc = OSM::API.new.get_xml_doc
prefs = @user.preferences
doc.root << el1
render :text => doc.to_s, :content_type => "text/xml"
-
end
+ # update the entire set of preferences
def update
begin
p = XML::Parser.new
doc.find('//preferences/preference').each do |pt|
pref = UserPreference.new
-
+
unless keyhash[pt['k']].nil? # already have that key
render :text => 'OH NOES! CAN HAS UNIQUE KEYS?', :status => :not_acceptable
return
end
-
+
keyhash[pt['k']] = 1
pref.k = pt['k']
render :nothing => true
end
-
end
def htmlize(text)
return sanitize(auto_link(simple_format(text), :urls))
end
+
+ def rss_link_to(*args)
+ return link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), Hash[*args], { :class => "rsssmall" });
+ end
end
headers "Auto-Submitted" => "auto-generated"
body :trace_name => trace.name,
:trace_points => trace.size,
+ :trace_description => trace.description,
+ :trace_tags => trace.tags,
:possible_points => possible_points
end
subject "[OpenStreetMap] GPX Import failure"
headers "Auto-Submitted" => "auto-generated"
body :trace_name => trace.name,
+ :trace_description => trace.description,
+ :trace_tags => trace.tags,
:error => error
end
if first
f_lat = point['latitude']
f_lon = point['longitude']
+ first = false
end
tp = Tracepoint.new
class UserPreference < ActiveRecord::Base
+ set_primary_keys :user_id, :k
belongs_to :user
# Turn this Node in to an XML Node without the <osm> wrapper.
<br />
-<%= link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), :action => 'rss') %>
-<%= auto_discovery_link_tag(:atom, :action => 'rss') %>
+<%= rss_link_to :action => 'rss' %>
+<%= auto_discovery_link_tag :atom, :action => 'rss' %>
<td><%= f.text_area :body, :cols => 80 %></td>
</tr>
<tr valign="top">
- <th>Location</th>
- <td><a name="map"></a><div id="map" style="border: 1px solid black; position: relative; width : 90%; height : 400px; display: none;"></div>
- <span class="location">Latitude: <%= f.text_field :latitude, :size => 20, :id => "latitude" %> Longitude: <%= f.text_field :longitude, :size => 20, :id => "longitude" %></span> <a href="#map" id="usemap" onclick="document.getElementById('map').style.display = 'block'; document.getElementById('usemap').style.display = 'none';">use map</a> </td>
- </tr>
+ <th>Location</th>
+ <td>
+ <div id="map" style="border: 1px solid black; position: relative; width : 90%; height : 400px; display: none;"></div>
+ <span class="location">Latitude: <%= f.text_field :latitude, :size => 20, :id => "latitude" %> Longitude: <%= f.text_field :longitude, :size => 20, :id => "longitude" %></span>
+ <a href="javascript:openMap()" id="usemap">use map</a>
+ </td>
+ </tr>
<tr>
<th></th>
<td><%= submit_tag 'Save' %></td>
<!--
var marker;
- function init(){
+ function init() {
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
var zoom = <%= zoom %>;
removeMarkerFromMap(marker);
}
- marker = addMarkerToMap(merc, null, "Diary entry location");
+ marker = addMarkerToMap(lonlat, null, "Diary entry location");
+ }
+
+ function openMap() {
+ $("map").style.display = "block";
+ $("usemap").style.display = "none";
}
window.onload = init;
--- /dev/null
+<h2><%= h(@not_found_user) %></h2>
+<p>Sorry, there is no user with the name <%= @not_found_user -%>. Please check your spelling, or maybe the link you clicked is wrong.</p>
<div class="export_details">
<p>
- <%= radio_button_tag("format", "osm") %>OpenStreetMap XML Data
+ <%= radio_button_tag("format", "osm") %> OpenStreetMap XML Data
<br/>
- <%= radio_button_tag("format", "mapnik") %>Mapnik Image
+ <%= radio_button_tag("format", "mapnik") %> Mapnik Image
<br/>
- <%= radio_button_tag("format", "osmarender") %>Osmarender Image
+ <%= radio_button_tag("format", "osmarender") %> Osmarender Image
+ <br/>
+ <%= radio_button_tag("format", "html") %> Embeddable HTML
</p>
</div>
<p>Zoom <%= select_tag("osmarender_zoom", options_for_select([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])) %></p>
</div>
</div>
+
+ <div id="export_html">
+ <p class="export_heading">Options</p>
+ <div class="export_details">
+ <p><a id="add_marker" href="#">Add a marker to the map</a></p>
+ <p id="marker_inputs" style="display:none">
+ Lat: <input type="text" id="marker_lat" size="9" />
+ Lon: <input type="text" id="marker_lon" size="9" />
+ </p>
+ </div>
+
+ <p class="export_heading">Output</p>
+ <div class="export_details">
+ <p><input type="text" id="export_html_text" style="width:95%" /></p>
+ <p>Paste HTML to embed in website</p>
+ </div>
+ </div>
<div class="export_buttons">
<p><%= submit_tag "Export", :id => "export_commit" %></p>
page << <<EOJ
var vectors;
var box;
+ var markerLayer;
+ var markerControl;
function startExport() {
vectors = new OpenLayers.Layer.Vector("Vector Layer", {
map.addControl(box);
map.events.register("moveend", map, mapMoved);
+ map.events.register("changebaselayer", map, htmlUrlChanged);
openSidebar({ onclose: stopExport });
- setBounds(map.getExtent());
-
if (map.baseLayer.name == "Mapnik") {
$("format_mapnik").checked = true;
} else if (map.baseLayer.name == "Osmarender") {
}
formatChanged();
+ setBounds(map.getExtent());
$("viewanchor").className = "";
$("exportanchor").className = "active";
$("exportanchor").className = "";
clearBox();
+ clearMarker();
map.events.unregister("moveend", map, mapMoved);
+ map.events.unregister("changebaselayer", map, htmlUrlChanged);
map.removeLayer(vectors);
}
$("drag_box").innerHTML = "Manually select a different area";
}
+ function startMarker() {
+ $("add_marker").innerHTML='Click on the map to add a marker';
+
+ if (!markerLayer) {
+ markerLayer = new OpenLayers.Layer.Vector("",{
+ displayInLayerSwitcher: false,
+ style: {
+ externalGraphic: OpenLayers.Util.getImagesLocation() + "marker.png",
+ graphicXOffset: -10.5,
+ graphicYOffset: -25,
+ graphicWidth: 21,
+ graphicHeight: 25
+ }
+ });
+ map.addLayer(markerLayer);
+
+ markerControl = new OpenLayers.Control.DrawFeature(markerLayer, OpenLayers.Handler.Point);
+ map.addControl(markerControl);
+
+ markerLayer.events.on({ "featureadded": endMarker });
+ }
+
+ markerLayer.destroyFeatures();
+ markerControl.activate();
+
+ return false;
+ }
+
+ $("add_marker").onclick = startMarker;
+
+ function endMarker(event) {
+ markerControl.deactivate();
+
+ $("add_marker").innerHTML = "Change marker position";
+ $("marker_inputs").style.display = "block";
+
+ var epsg4326 = new OpenLayers.Projection("EPSG:4326");
+ var epsg900913 = new OpenLayers.Projection("EPSG:900913");
+ var geom = event.feature.geometry.clone().transform(epsg900913, epsg4326);
+
+ $("marker_lon").value = geom.x.toFixed(5);
+ $("marker_lat").value = geom.y.toFixed(5);
+
+ htmlUrlChanged();
+ }
+
+ function clearMarker() {
+ $("marker_lon").value = "";
+ $("marker_lat").value = "";
+ $("marker_inputs").style.display = "none";
+ $("add_marker").innerHTML = "Add a marker to the map";
+
+ if (markerLayer) {
+ markerControl.destroy();
+ markerLayer.destroy();
+ markerLayer = null;
+ markerControl = null;
+ }
+ }
+
function mapMoved() {
setBounds(map.getExtent());
validateControls();
$("maxlat").value = Math.round(bounds.top * decimals) / decimals;
mapnikSizeChanged();
+ htmlUrlChanged();
}
function clearBox() {
}
}
+ function htmlUrlChanged() {
+ var bounds = new OpenLayers.Bounds($("minlon").value, $("minlat").value, $("maxlon").value, $("maxlat").value);
+ var layerName = map.baseLayer.name.toLowerCase();
+ var url = "http://#{SERVER_URL}/export/embed.html?bbox=" + bounds.toBBOX() + "&layer=" + layerName;
+ var markerUrl = "";
+
+ if ($("marker_lat").value && $("marker_lon").value) {
+ markerUrl = "&mlat=" + $("marker_lat").value + "&mlon=" + $("marker_lon").value;
+ url += "&marker=" + $("marker_lat").value + "," + $("marker_lon").value;
+ }
+
+ var html = '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+url+'" style="border: 1px solid black"></iframe>';
+
+ // Create "larger map" link
+ var center = bounds.getCenterLonLat();
+ var epsg4326 = new OpenLayers.Projection("EPSG:4326");
+ var epsg900913 = new OpenLayers.Projection("EPSG:900913");
+
+ bounds.transform(epsg4326, epsg900913);
+ var zoom = map.getZoomForExtent(bounds);
+
+ html += '<br /><small><a href="http://#{SERVER_URL}/?lat='+center.lat+'&lon='+center.lon+'&zoom='+zoom+markerUrl+'">View Larger Map</a></small>';
+
+ $("export_html_text").value = html;
+
+ if ($("format_html").checked) {
+ $("export_html_text").select();
+ }
+ }
+
function formatChanged() {
+ $("export_commit").style.display = "inline";
+
if ($("format_osm").checked) {
$("export_osm").style.display = "inline";
} else {
$("export_osmarender").style.display = "none";
}
+ if ($("format_html").checked) {
+ $("export_html").style.display = "inline";
+ $("export_commit").style.display = "none";
+ $("export_html_text").select();
+ } else {
+ $("export_html").style.display = "none";
+ clearMarker();
+ }
+
validateControls();
}
$("format_osm").onclick = formatChanged;
$("format_mapnik").onclick = formatChanged;
$("format_osmarender").onclick = formatChanged;
+ $("format_html").onclick = formatChanged;
function maxMapnikScale() {
var bounds = new OpenLayers.Bounds($("minlon").value, $("minlat").value, $("maxlon").value, $("maxlat").value);
<%= yield :left_menu %>
</div>
+ <div id="sotm" class="left_menu">
+ <div id="sotminfo">
+ Come to the second OpenStreetMap Conference, <a href="http://www.stateofthemap.org">The State of the Map</a>: 12th-13th July 2008, Limerick, Ireland.
+ </div>
+ </div>
+
<%= yield :optionals %>
<div id="cclogo">
<center>
-<% display_name = User.find_by_id(params[:user_id]).display_name %>
-<% title = params[:message] ? params[:message][:title] : params[:title] %>
+<% user_id = params[:user_id] || @user_id %>
+<% display_name = User.find_by_id(user_id).display_name %>
<h2>Send a new message to <%= h(display_name) %></h2>
<%= error_messages_for 'message' %>
-<% form_for :message do |f| %>
+<% form_for :message, :url => { :action => "new", :user_id => user_id } do |f| %>
<table>
<tr valign="top">
<th>Subject</th>
- <td><%= text_field_tag 'message[title]', title, :size => 60 %></td>
+ <td><%= f.text_field :title, :size => 60, :value => @title %></td>
</tr>
<tr valign="top">
<th>Body</th>
- <td><%= f.text_area :body, :cols => 80 %></td>
+ <td><%= f.text_area :body, :cols => 80, :value => @body %></td>
</tr>
<tr>
<th></th>
- <td><%= submit_tag 'Send' %></td>
+ <td><%= submit_tag 'Send', :action => 'new' %></td>
</tr>
</table>
<% end %>
--- /dev/null
+Hi,
+
+It looks like your GPX file
+
+ <%= @trace_name %>
+
+with the description
+
+ <%= @trace_description %>
+<% if @trace_tags.length>0 %>
+and the following tags:
+<% @trace_tags.each do |tag| %>
+ <%= tag.tag.rstrip %><% end %><% else %>
+and no tags.<% end %>
-Hi,
-
-It looks like your GPX file
-
- <%= @trace_name %>
-
+<%= render :partial => "gpx_description" %>
failed to import. Here's the error:
<%= @error %>
-Hi,
-
-It looks like your GPX file
-
- <%= @trace_name %>
-
+<%= render :partial => "gpx_description" %>
loaded successfully with <%= @trace_points %> out of a possible
<%= @possible_points %> points.
<p>If this is you, please click the link below to confirm that account.</p>
<p><a href="<%= @url %>"><%= @url %></a></p>
+
+<p>You may also want to <a href="http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page">sign up to the OpenStreetMap wiki</a>.</p>
+
+<p>It is recommended that you create a user wiki page, which includes category tags noting where you are, such as <a href="http://wiki.openstreetmap.org/index.php/Category:Users_in_London">[[Category:Users_in_London]]</a>.</p>
+
+<p>A list of current users in categories, based on where in the world they are, is available from <a href="http://wiki.openstreetmap.org/index.php/Category:Users_by_geographical_region">Category:Users_by_geographical_region</a>.</p>
If this is you, please click the link below to confirm that account.
<%= @url %>
+
+You may also want to sign up to the OpenStreetMap wiki at:
+
+http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page
+
+It is recommended that you create a user wiki page, which includes
+category tags noting where you are, such as [[Category:Users_in_London]].
+
+A list of current users in categories, based on where in the world
+they are, is available from:
+
+http://wiki.openstreetmap.org/index.php/Category:Users_by_geographical_region
<% form_remote_tag(:loading => "startSearch()",
:complete => "endSearch()",
:url => { :controller => :geocoder, :action => :search }) do %>
- <%= text_field_tag :query, h(params[:query]) %>
+ <table>
+ <tr>
+ <td><%= text_field_tag :query, h(params[:query]) %></td>
+ <td></td>
+ <td><%= submit_tag 'Go' %></td>
+ </tr>
+ </table>
<% end %>
</span>
<p id="search_active">Searching...</p>
<% session[:token] = @user.tokens.create.token unless session[:token] %>
<% if params['mlon'] and params['mlat'] %>
-<% lon = h(params['mlon']) %>
-<% lat = h(params['mlat']) %>
-<% zoom = h(params['zoom'] || '14') %>
+ <% lon = h(params['mlon']) %>
+ <% lat = h(params['mlat']) %>
+ <% zoom = h(params['zoom'] || '14') %>
<% elsif @user and params['lon'].nil? and params['lat'].nil? and params['gpx'].nil? %>
-<% lon = @user.home_lon %>
-<% lat = @user.home_lat %>
-<% zoom = '14' %>
-<% elsif params['gpx'].nil? %>
-<% lon = h(params['lon'] || '-0.1') %>
-<% lat = h(params['lat'] || '51.5') %>
-<% zoom = h(params['zoom'] || '14') %>
+ <% lon = @user.home_lon %>
+ <% lat = @user.home_lat %>
+ <% zoom = '14' %>
<% else %>
-<% lon = nil %>
-<% lat = nil %>
-<% zoom = '14' %>
+ <% lon = h(params['lon'] || 'null') %>
+ <% lat = h(params['lat'] || 'null') %>
+ <% zoom = h(params['zoom'] || '14') %>
<% end %>
-<div id="map">You need a Flash player to use Potlatch, the
+<div id="map">
+ You need a Flash player to use Potlatch, the
OpenStreetMap Flash editor. You can <a href="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">download Flash Player from Adobe.com</a>.
<a href="http://wiki.openstreetmap.org/index.php/Editing">Several other options</a> are also available
for editing OpenStreetMap.
</div>
+
<%= javascript_include_tag 'swfobject.js' %>
<script type="text/javascript" defer="defer">
var brokenContentSize = $("content").offsetWidth == 0;
if (lat) { fo.addVariable('lat',lat); }
if (lon) { fo.addVariable('long',lon); }
<% if params['gpx'] %>
- fo.addVariable('gpx','<%= h(params['gpx']) + "/data.xml" %>');
+ fo.addVariable('gpx','<%= h(params['gpx']) %>');
<% end %>
fo.write("map");
}
<tr>
<td colspan="2" align="center">
Licensed under the Creative Commons Attribution-Share Alike 2.0 license
-by the OpenStreetMap project and it's contributors.
+by the OpenStreetMap project and its contributors.
</td>
</table>
</div>
<h1><%= h(@title) %></h1>
-<span class="rsssmall"><a href="<%= url_for :action => 'georss', :display_name => @display_name, :tag => @tag %>"><img src="/images/RSS.gif" border="0" alt="RSS" /></a></span>
-<% if @user.nil? or @display_name.nil? or @user.display_name != @display_name %>
- | <%= link_to 'See just your traces, or upload a trace', :action => 'mine' %>
-<% end %>
-<% if @tag or @display_name %>
- | <%= link_to 'See all traces', :controller => 'trace', :action => 'list' %>
-<% end %>
-<% if @tag and @user and @user.display_name == @display_name %>
- | <%= link_to 'See all your traces', :controller => 'trace', :action => 'mine' %>
-<% end %>
+<%= auto_discovery_link_tag :atom, :action => 'georss', :display_name => @display_name, :tag => @tag %>
-<br />
-<br />
+<p>
+ <%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %>
+ <% if @user.nil? or @display_name.nil? or @user.display_name != @display_name %>
+ | <%= link_to 'See just your traces, or upload a trace', :action => 'mine' %>
+ <% end %>
+ <% if @tag or @display_name %>
+ | <%= link_to 'See all traces', :controller => 'trace', :action => 'list' %>
+ <% end %>
+ <% if @tag and @user and @user.display_name == @display_name %>
+ | <%= link_to 'See all your traces', :controller => 'trace', :action => 'mine' %>
+ <% end %>
+</p>
+
+<% if @user and @user.traces.count(:conditions => "inserted=0") > 4 %>
+ <p>
+ You have <%= @user.traces.count(:conditions => "inserted=0") %> traces
+ waiting for upload. Please consider waiting for these to finish before
+ uploading any more, so as not to block the queue for other users.
+ </p>
+<% end %>
<% if @user.data_public? %>
All your edits are public.
<% else %>
- Currently your edits are anonymous and people can't send you messages or see your location. To show what you edited and allow people to contact you through the website, click the button below. <b>You will need to do this if you want to use the online editor</b> (<a href="http://wiki.openstreetmap.org/index.php/Disabling_anonymous_edits">find out why</a>). This action cannot be reversed.
+Currently your edits are anonymous and people can't send you messages or see your location. To show what you edited and allow people to contact you through the website, click the button below.
+<b>You will need to do this if you want to use the online editor and it is encouraged</b> (<a href="http://wiki.openstreetmap.org/index.php/Disabling_anonymous_edits">find out why</a>).
+This action cannot be reversed and all new users are now public by default.
<br /><br />
- <%= button_to "Make all my edits public, forever", :action => :go_public %>
+ <%= button_to "Make all my edits public", :action => :go_public %>
<% end %>
--- /dev/null
+<h2><%= h(@not_found_user) %></h2>
+<p>Sorry, there is no user with the name <%= @not_found_user -%>. Please check your spelling, or maybe the link you clicked is wrong.</p>
# Set expiry for static content
#
expire.url = (
+ "/export/" => "access 7 days",
"/images/" => "access 10 years",
"/javascripts/" => "access 10 years",
- "/openlayers/" => "access 10 years",
+ "/openlayers/" => "access 7 days",
"/stylesheets/" => "access 10 years"
)
# Potlatch autocomplete values
# each line should be: key / way|point|POI (tab) list_of_values
# '-' indicates no autocomplete for values
-highway/way motorway,motorway_link,trunk,trunk_link,primary,primary_link,secondary,tertiary,unclassified,residential,service,bridleway,cycleway,footway,pedestrian,steps
-highway/point mini_roundabout,traffic_signals,crossing,gate,stile,cattle_grid,toll_booth,incline,viaduct,motorway_junction,services,ford,bus_stop
+highway/way motorway,motorway_link,trunk,trunk_link,primary,primary_link,secondary,tertiary,unclassified,residential,service,bridleway,cycleway,footway,pedestrian,steps,living_street,track
+highway/point mini_roundabout,traffic_signals,crossing,gate,stile,cattle_grid,toll_booth,incline,viaduct,motorway_junction,services,ford,bus_stop,turning_circle
junction/way roundabout
cycleway/way lane,track,opposite_lane,opposite_track,opposite
-waterway/way river,canal,stream,drain,dock
+waterway/way river,canal,stream,drain,dock,riverbank
waterway/point lock_gate,lock,turning_point,aqueduct,boatyard,water_point,waste_disposal,mooring,weir
waterway/POI boatyard,water_point,waste_disposal,mooring
railway/way rail,tram,light_rail,subway,preserved,disused,abandoned,narrow_gauge,monorail
man_made/way reservoir_covered,pier
leisure/POI sports_centre,golf_course,stadium,marina,track,pitch,water_park,fishing,nature_reserve,park,playground,garden,common,slipway
leisure/way sports_centre,golf_course,stadium,marina,track,pitch,water_park,fishing,nature_reserve,park,playground,garden,common
-amenity/POI pub,biergarten,cafe,nightclub,restaurant,fast_food,parking,bicycle_parking,bicycle_rental,car_rental,car_shasring,fuel,telephone,toilets,recycling,public_building,place_of_worship,grave_yard,post_office,post_box,school,university,college,pharmacy,hospital,library,police,fire_station,bus_station,theatre,cinema,arts_centre,courthouse,prison,bank,bureau_de_change,atm,town_hall
+amenity/POI pub,biergarten,cafe,nightclub,restaurant,fast_food,parking,bicycle_parking,bicycle_rental,car_rental,car_sharing,fuel,telephone,toilets,recycling,public_building,place_of_worship,grave_yard,post_office,post_box,school,university,college,pharmacy,hospital,library,police,fire_station,bus_station,theatre,cinema,arts_centre,courthouse,prison,bank,bureau_de_change,atm,town_hall
amenity/way parking,bicycle_parking,car_rental,car_sharing,public_building,grave_yard,school,university,college,hospital,town_hall
shop/POI supermarket,convenience,bicycle,outdoor
shop/way supermarket
tourism/POI information,camp_site,caravan_site,caravan_site,picnic_site,viewpoint,theme_park,hotel,motel,guest_house,hostel,attraction,zoo
-tourism/way camp_site,caravan_site,picnic_site,theme_parkattraction,zoo
+tourism/way camp_site,caravan_site,picnic_site,theme_park,attraction,zoo
historic/POI castle,monument,memorial,museum,archaeological_site,icon,ruins
historic/way archaeological_site,ruins
landuse/POI farm,quarry,landfill,basin,reservoir,forest,allotments,residential,retail,commercial,industrial,brownfield,greenfield,cemetery,village_green,recreation_ground
trunk road: highway=trunk,ref=(type road number),name=(type road name)
primary road: highway=primary,ref=(type road number),name=(type road name)
secondary road: highway=secondary,ref=(type road number),name=(type road name)
-tertiary road: highway=tertiary,ref=,name=(type road name)
-residential road: highway=residential,ref=,name=(type road name)
+tertiary road: highway=tertiary,ref=(type road number),name=(type road name)
unclassified road: highway=unclassified,ref=,name=(type road name)
+residential road: highway=residential,ref=,name=(type road name)
+service road: highway=service,ref=,name=
way/footway
footpath: highway=footway,foot=yes
map.connect "api/#{API_VERSION}/user/details", :controller => 'user', :action => 'api_details'
map.connect "api/#{API_VERSION}/user/preferences", :controller => 'user_preference', :action => 'read', :conditions => { :method => :get }
+ map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'read_one', :conditions => { :method => :get }
map.connect "api/#{API_VERSION}/user/preferences", :controller => 'user_preference', :action => 'update', :conditions => { :method => :put }
+ map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'update_one', :conditions => { :method => :put }
+ map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'delete_one', :conditions => { :method => :delete }
map.connect "api/#{API_VERSION}/user/gpx_files", :controller => 'user', :action => 'api_gpx_files'
map.connect "api/#{API_VERSION}/gpx/create", :controller => 'trace', :action => 'api_create'
if gpx.actual_points > 0
Notifier::deliver_gpx_success(trace, gpx.actual_points)
else
- trace.destroy
Notifier::deliver_gpx_failure(trace, '0 points parsed ok. Do they all have lat,lng,alt,timestamp?')
+ trace.destroy
end
rescue Exception => ex
logger.info ex.to_s
ex.backtrace.each {|l| logger.info l }
- trace.destroy
Notifier::deliver_gpx_failure(trace, ex.to_s + "\n" + ex.backtrace.join("\n"))
+ trace.destroy
end
Signal.trap("TERM", "DEFAULT")
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style type="text/css">
+ #map {
+ width: 100%;
+ height: 100%;
+ }
+ .olControlAttribution {
+ bottom: 3px!important;
+ }
+ </style>
+ <script src="http://openstreetmap.org/openlayers/OpenLayers.js"></script>
+ <script src="http://openstreetmap.org/openlayers/OpenStreetMap.js"></script>
+ <script type="text/javascript">
+ var map, layer;
+ function init(){
+ map = new OpenLayers.Map ("map", {
+ controls: [
+ new OpenLayers.Control.Attribution(),
+ new OpenLayers.Control.Navigation()
+ ],
+ maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,
+ 20037508.34,20037508.34),
+ numZoomLevels: 20,
+ maxResolution: 156543.0339,
+ displayProjection: new OpenLayers.Projection("EPSG:4326"),
+ units: 'm',
+ projection: new OpenLayers.Projection("EPSG:900913")
+ });
+
+ var attribution = 'Data by <a target="_parent" href="http://www.openstreetmap.org">OpenStreetMap</a>';
+ var args = OpenLayers.Util.getParameters();
+ if (!args.layer || args.layer == "mapnik") {
+ var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", {
+ displayOutsideMaxExtent: true,
+ wrapDateLine: true,
+ attribution: attribution
+ });
+ map.addLayer(mapnik);
+ } else {
+ var osmarender = new OpenLayers.Layer.OSM.Osmarender("Osmarender", {
+ displayOutsideMaxExtent: true,
+ wrapDateLine: true,
+ attribution: attribution
+ });
+ map.addLayer(osmarender);
+ }
+
+ if (args.marker) {
+ var markers = new OpenLayers.Layer.Markers();
+ map.addLayer(markers);
+ markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(args.marker[1], args.marker[0]).transform(map.displayProjection, map.getProjectionObject())));
+ map.marker = true;
+ }
+
+ if (args.bbox) {
+ var bounds = OpenLayers.Bounds.fromArray(args.bbox).transform(map.displayProjection, map.getProjectionObject());
+ map.zoomToExtent(bounds)
+ } else {
+ map.zoomToMaxExtent();
+ }
+
+ var size = map.getSize();
+ if (size.h > 320) {
+ map.addControl(new OpenLayers.Control.PanZoomBar());
+ } else {
+ map.addControl(new OpenLayers.Control.PanZoom());
+ }
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <div id="map"></div>
+ </body>
+</html>
map.zoomToExtent(extent.clone().transform(epsg4326, map.getProjectionObject()));
}
+function getMapExtent(extent) {
+ return map.getExtent().clone().transform(map.getProjectionObject(), epsg4326);
+}
+
function getEventPosition(event) {
return map.getLonLatFromViewPortPx(event.xy).clone().transform(map.getProjectionObject(), epsg4326);
}
width: 100%;
}
+.optionalbox td {
+ margin: 0px;
+ padding: 0px;
+}
+
.search_form {
height: 16px;
- padding-bottom: 2px;
+ padding-bottom: 6px;
}
#search_active {
list-style: square;
}
-input[type="text"] {
+input[type="text"], input[type="password"], textarea {
+ border: 1px solid black;
+}
+
+input[type="submit"] {
border: 1px solid black;
}
font-weight: normal;
}
+#sotminfo a:link {
+ text-decoration: underline;
+}
+
+#sotminfo a:visited {
+ text-decoration: underline;
+}
+
#permalink {
z-index:10000;
position:absolute;