//= require leaflet.key
//= require leaflet.note
//= require leaflet.share
+//= require leaflet.query
//= require index/search
//= require index/browse
//= require index/export
//= require index/history
//= require index/note
//= require index/new_note
+//= require index/query
//= require router
(function() {
sidebar: sidebar
}).addTo(map);
+ L.OSM.query({
+ position: position,
+ sidebar: sidebar
+ }).addTo(map);
+
L.control.scale()
.addTo(map);
"/node/:id(/history)": OSM.Browse(map, 'node'),
"/way/:id(/history)": OSM.Browse(map, 'way'),
"/relation/:id(/history)": OSM.Browse(map, 'relation'),
- "/changeset/:id": OSM.Browse(map, 'changeset')
+ "/changeset/:id": OSM.Browse(map, 'changeset'),
+ "/query": OSM.Query(map)
});
if (OSM.preferred_editor == "remote" && document.location.pathname == "/edit") {
$(".describe_location").on("click", function(e) {
e.preventDefault();
- var precision = OSM.zoomPrecision(map.getZoom());
+ var center = map.getCenter().wrap(),
+ precision = OSM.zoomPrecision(map.getZoom());
OSM.router.route("/search?query=" + encodeURIComponent(
- map.getCenter().lat.toFixed(precision) + "," +
- map.getCenter().lng.toFixed(precision)));
+ center.lat.toFixed(precision) + "," + center.lng.toFixed(precision)
+ ));
});
});
.icon.close:hover { background-position: -200px -20px; }
.icon.check { background-position: -220px 0; }
.icon.note { background-position: -240px 0; }
-.icon.gear { background-position: -260px 0; }
+.icon.query { background-position: -260px 0; }
/* Rules for links */
#map {
height: 100%;
overflow: hidden;
+
+ &.query-active {
+ cursor: help;
+ }
+
+ &.query-disabled {
+ cursor: not-allowed;
+ }
}
#map-ui {
.search_results_entry {
ul li {
border-bottom: $keyline;
+ cursor: pointer;
&:first-child { border-top: $keyline; }
+ &.selected { background: #FFFFE6; }
}
.search_details {
overflow: hidden;
margin: 0 0 10px 10px;
}
+
+ .query-intro p {
+ padding: $lineheight $lineheight $lineheight/2;
+ }
+
+ .query-results {
+ display: none;
+
+ h3 {
+ padding: $lineheight $lineheight $lineheight/2;
+ margin: 0;
+ }
+
+ ul {
+ li {
+ padding: 15px 20px;
+ border-bottom: 1px solid #ddd;
+
+ &.query-result {
+ cursor: pointer;
+ }
+
+ &.selected {
+ background: #FFFFE6;
+ }
+
+ a {
+ color: #000;
+ }
+ }
+ }
+ }
}
/* Rules for export sidebar */
background-size: cover;
background-attachment: fixed;
- &.photo-0 { background-image: image-url('about/0.jpg'); .photo-0 { display: block; } }
- &.photo-1 { background-image: image-url('about/1.jpg'); .photo-1 { display: block; } }
- &.photo-2 { background-image: image-url('about/2.jpg'); .photo-2 { display: block; } }
- &.photo-3 { background-image: image-url('about/4.jpg'); .photo-3 { display: block; } }
- &.photo-4 { background-image: image-url('about/4.jpg'); .photo-4 { display: block; } }
- &.photo-5 { background-image: image-url('about/5.jpg'); .photo-5 { display: block; } }
-
.caption {
max-width: 200px;
font: 13px/20px Helvetica, Arial, sans-serif;
printable_name:
with_id: "%{id}"
with_version: "%{id}, v%{version}"
- with_name: "%{name} (%{id})"
+ with_name_html: "%{name} (%{id})"
editor:
default: "Default (currently %{name})"
potlatch:
key: "The wiki description page for the %{key} tag"
tag: "The wiki description page for the %{key}=%{value} tag"
wikipedia_link: "The %{page} article on Wikipedia"
+ telephone_link: "Call %{phone_number}"
note:
title: "Note: %{id}"
new_note: "New Note"
reopened_by: "Reactivated by %{user} <abbr title='%{exact_time}'>%{when} ago</abbr>"
reopened_by_anonymous: "Reactivated by anonymous <abbr title='%{exact_time}'>%{when} ago</abbr>"
hidden_by: "Hidden by %{user} <abbr title='%{exact_time}'>%{when} ago</abbr>"
+ query:
+ title: "Query Features"
+ introduction: "Click on the map to find nearby features."
+ nearby: "Nearby features"
+ enclosing: "Enclosing features"
changeset:
changeset_paging_nav:
showing_page: "Page %{page}"
primary_link: "Primary Road"
proposed: "Proposed Road"
raceway: "Raceway"
- residential: "Residential"
+ residential: "Residential Road"
rest_area: "Rest Area"
road: "Road"
secondary: "Secondary Road"
tram: "Tramway"
tram_stop: "Tram Stop"
yard: "Railway Yard"
+ route:
+ bus: "Bus Route"
shop:
alcohol: "Off License"
antiques: "Antiques"
createnote_disabled_tooltip: Zoom in to add a note to the map
map_notes_zoom_in_tooltip: Zoom in to see map notes
map_data_zoom_in_tooltip: Zoom in to see map data
+ queryfeature_tooltip: Query features
+ queryfeature_disabled_tooltip: Zoom in to query features
notes:
new:
- intro: "Spotted a mistake or something missing? Let other mappers know so we can fix it. Move the marker to the correct position and type a note to explain the problem. (Please don't enter personal information here.)"
+ intro: "Spotted a mistake or something missing? Let other mappers know so we can fix it. Move the marker to the correct position and type a note to explain the problem. (Please don't enter personal information or information from copyrighted maps or directory listings.)"
add: Add Note
show:
anonymous_warning: This note includes comments from anonymous users which should be independently verified.
comment_and_resolve: Comment & Resolve
comment: Comment
edit_help: Move the map and zoom in on a location you want to edit, then click here.
+ query:
+ node: Node
+ way: Way
+ relation: Relation
+ nothing_found: No features found
+ error: "Error contacting %{server}: %{error}"
+ timeout: "Timeout contacting %{server}"
redaction:
edit:
description: "Description"
match '/offline' => 'site#offline', :via => :get
match '/key' => 'site#key', :via => :get
match '/id' => 'site#id', :via => :get
+ match '/query' => 'browse#query', :via => :get
match '/user/new' => 'user#new', :via => :get
match '/user/new' => 'user#create', :via => :post
match '/user/terms' => 'user#terms', :via => :get
match '/traces/mine/page/:page' => 'trace#mine', :via => :get
match '/traces/mine' => 'trace#mine', :via => :get
match '/trace/create' => 'trace#create', :via => [:get, :post]
- match '/trace/:id/data' => 'trace#data', :via => :get, :id => /\d+/
+ match '/trace/:id/data' => 'trace#data', :via => :get, :id => /\d+/, :as => "trace_data"
match '/trace/:id/edit' => 'trace#edit', :via => [:get, :post, :patch], :id => /\d+/, :as => "trace_edit"
match '/trace/:id/delete' => 'trace#delete', :via => :post, :id => /\d+/