service being slow doesn't delay the response from others.
before_filter :set_locale
def search
- query = params[:query]
- results = Array.new
-
- query.sub(/^\s+/, "")
- query.sub(/\s+$/, "")
-
- if query.match(/^[+-]?\d+(\.\d*)?\s*[\s,]\s*[+-]?\d+(\.\d*)?$/)
- results.push search_latlon(query)
- elsif query.match(/^\d{5}(-\d{4})?$/)
- results.push search_us_postcode(query)
- elsif query.match(/^(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\s*[0-9][ABD-HJLNP-UW-Z]{2})$/i)
- results.push search_uk_postcode(query)
- results.push search_osm_namefinder(query)
- elsif query.match(/^[A-Z]\d[A-Z]\s*\d[A-Z]\d$/i)
- results.push search_ca_postcode(query)
+ @query = params[:query]
+ @sources = Array.new
+
+ @query.sub(/^\s+/, "")
+ @query.sub(/\s+$/, "")
+
+ if @query.match(/^[+-]?\d+(\.\d*)?\s*[\s,]\s*[+-]?\d+(\.\d*)?$/)
+ @sources.push "latlon"
+ elsif @query.match(/^\d{5}(-\d{4})?$/)
+ @sources.push "us_postcode"
+ elsif @query.match(/^(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\s*[0-9][ABD-HJLNP-UW-Z]{2})$/i)
+ @sources.push "uk_postcode"
+ @sources.push "osm_namefinder"
+ elsif @query.match(/^[A-Z]\d[A-Z]\s*\d[A-Z]\d$/i)
+ @sources.push "ca_postcode"
else
- results.push search_osm_namefinder(query)
- results.push search_geonames(query)
+ @sources.push "osm_namefinder"
+ @sources.push "geonames"
end
- results_count = count_results(results)
-
render :update do |page|
- page.replace_html :sidebar_content, :partial => 'results', :object => results
-
- if results_count == 1
- position = results.collect { |s| s[:results] }.compact.flatten[0]
- page.call "setPosition", position[:lat].to_f, position[:lon].to_f, position[:zoom].to_i
- else
- page.call "openSidebar"
- end
- end
- end
-
- def description
- results = Array.new
-
- lat = params[:lat]
- lon = params[:lon]
-
- results.push description_osm_namefinder("cities", lat, lon, 2)
- results.push description_osm_namefinder("towns", lat, lon, 4)
- results.push description_osm_namefinder("places", lat, lon, 10)
- results.push description_geonames(lat, lon)
-
- render :update do |page|
- page.replace_html :sidebar_content, :partial => 'results', :object => results
+ page.replace_html :sidebar_content, :partial => "search"
page.call "openSidebar"
end
end
-private
+ def search_latlon
+ # get query parameters
+ query = params[:query]
- def search_latlon(query)
- results = Array.new
+ # create result array
+ @results = Array.new
# decode the location
- if m = query.match(/^([+-]?\d+(\.\d*)?)\s*[\s,]\s*([+-]?\d+(\.\d*)?)$/)
+ if m = query.match(/^\s*([+-]?\d+(\.\d*)?)\s*[\s,]\s*([+-]?\d+(\.\d*)?)\s*$/)
lat = m[1].to_f
lon = m[3].to_f
end
# generate results
if lat < -90 or lat > 90
- return { :source => "Internal", :url => "http://openstreetmap.org/", :error => "Latitude #{lat} out of range" }
+ @error = "Latitude #{lat} out of range"
+ render :action => "error"
elsif lon < -180 or lon > 180
- return { :source => "Internal", :url => "http://openstreetmap.org/", :error => "Longitude #{lon} out of range" }
+ @error = "Longitude #{lon} out of range"
+ render :action => "error"
else
- results.push({:lat => lat, :lon => lon,
- :zoom => APP_CONFIG['postcode_zoom'],
- :name => "#{lat}, #{lon}"})
+ @results.push({:lat => lat, :lon => lon,
+ :zoom => APP_CONFIG['postcode_zoom'],
+ :name => "#{lat}, #{lon}"})
- return { :source => "Internal", :url => "http://openstreetmap.org/", :results => results }
+ render :action => "results"
end
end
- def search_us_postcode(query)
- results = Array.new
+ def search_us_postcode
+ # get query parameters
+ query = params[:query]
+
+ # create result array
+ @results = Array.new
# ask geocoder.us (they have a non-commercial use api)
response = fetch_text("http://rpc.geocoder.us/service/csv?zip=#{escape_query(query)}")
# parse the response
unless response.match(/couldn't find this zip/)
data = response.split(/\s*,\s+/) # lat,long,town,state,zip
- results.push({:lat => data[0], :lon => data[1],
- :zoom => APP_CONFIG['postcode_zoom'],
- :prefix => "#{data[2]}, #{data[3]}, ",
- :name => data[4]})
+ @results.push({:lat => data[0], :lon => data[1],
+ :zoom => APP_CONFIG['postcode_zoom'],
+ :prefix => "#{data[2]}, #{data[3]}, ",
+ :name => data[4]})
end
- return { :source => "Geocoder.us", :url => "http://geocoder.us/", :results => results }
+ render :action => "results"
rescue Exception => ex
- return { :source => "Geocoder.us", :url => "http://geocoder.us/", :error => "Error contacting rpc.geocoder.us: #{ex.to_s}" }
+ @error = "Error contacting rpc.geocoder.us: #{ex.to_s}"
+ render :action => "error"
end
- def search_uk_postcode(query)
- results = Array.new
+ def search_uk_postcode
+ # get query parameters
+ query = params[:query]
+
+ # create result array
+ @results = Array.new
# ask npemap.org.uk to do a combined npemap + freethepostcode search
response = fetch_text("http://www.npemap.org.uk/cgi/geocoder.fcgi?format=text&postcode=#{escape_query(query)}")
data = dataline.split(/,/) # easting,northing,postcode,lat,long
postcode = data[2].gsub(/'/, "")
zoom = APP_CONFIG['postcode_zoom'] - postcode.count("#")
- results.push({:lat => data[3], :lon => data[4], :zoom => zoom,
- :name => postcode})
+ @results.push({:lat => data[3], :lon => data[4], :zoom => zoom,
+ :name => postcode})
end
- return { :source => "NPEMap / FreeThePostcode", :url => "http://www.npemap.org.uk/", :results => results }
+ render :action => "results"
rescue Exception => ex
- return { :source => "NPEMap / FreeThePostcode", :url => "http://www.npemap.org.uk/", :error => "Error contacting www.npemap.org.uk: #{ex.to_s}" }
+ @error = "Error contacting www.npemap.org.uk: #{ex.to_s}"
+ render :action => "error"
end
- def search_ca_postcode(query)
- results = Array.new
+ def search_ca_postcode
+ # get query parameters
+ query = params[:query]
+ @results = Array.new
# ask geocoder.ca (note - they have a per-day limit)
response = fetch_xml("http://geocoder.ca/?geoit=XML&postal=#{escape_query(query)}")
# parse the response
if response.get_elements("geodata/error").empty?
- results.push({:lat => response.get_text("geodata/latt").to_s,
- :lon => response.get_text("geodata/longt").to_s,
- :zoom => APP_CONFIG['postcode_zoom'],
- :name => query.upcase})
+ @results.push({:lat => response.get_text("geodata/latt").to_s,
+ :lon => response.get_text("geodata/longt").to_s,
+ :zoom => APP_CONFIG['postcode_zoom'],
+ :name => query.upcase})
end
- return { :source => "Geocoder.CA", :url => "http://geocoder.ca/", :results => results }
+ render :action => "results"
rescue Exception => ex
- return { :source => "Geocoder.CA", :url => "http://geocoder.ca/", :error => "Error contacting geocoder.ca: #{ex.to_s}" }
+ @error = "Error contacting geocoder.ca: #{ex.to_s}"
+ render :action => "error"
end
- def search_osm_namefinder(query)
- results = Array.new
+ def search_osm_namefinder
+ # get query parameters
+ query = params[:query]
+
+ # create result array
+ @results = Array.new
# ask OSM namefinder
response = fetch_xml("http://gazetteer.openstreetmap.org/namefinder/search.xml?find=#{escape_query(query)}")
prefix = ""
name = type
else
- prefix = t "geocoder.results.namefinder.prefix", :type => type
+ prefix = t "geocoder.search_osm_namefinder.prefix", :type => type
end
if place
distance = format_distance(place.attributes["approxdistance"].to_i)
direction = format_direction(place.attributes["direction"].to_i)
placename = format_name(place.attributes["name"].to_s)
- suffix = t "geocoder.results.namefinder.suffix_place", :distance => distance, :direction => direction, :placename => placename
+ suffix = t "geocoder.search_osm_namefinder.suffix_place", :distance => distance, :direction => direction, :placename => placename
if place.attributes["rank"].to_i <= 30
parent = nil
parentname = format_name(parent.attributes["name"].to_s)
if place.attributes["info"].to_s == "suburb"
- suffix = t "geocoder.results.namefinder.suffix_suburb", :suffix => suffix, :parentname => parentname
+ suffix = t "geocoder.search_osm_namefinder.suffix_suburb", :suffix => suffix, :parentname => parentname
else
parentdistance = format_distance(parent.attributes["approxdistance"].to_i)
parentdirection = format_direction(parent.attributes["direction"].to_i)
- suffix = t "geocoder.results.namefinder.suffix_parent", :suffix => suffix, :parentdistance => parentdistance, :parentdirection => parentdirection, :parentname => parentname
+ suffix = t "geocoder.search_osm_namefinder.suffix_parent", :suffix => suffix, :parentdistance => parentdistance, :parentdirection => parentdirection, :parentname => parentname
end
end
end
suffix = ""
end
- results.push({:lat => lat, :lon => lon, :zoom => zoom,
- :prefix => prefix, :name => name, :suffix => suffix,
- :description => description})
+ @results.push({:lat => lat, :lon => lon, :zoom => zoom,
+ :prefix => prefix, :name => name, :suffix => suffix,
+ :description => description})
end
- return { :source => "OpenStreetMap Namefinder", :url => "http://gazetteer.openstreetmap.org/namefinder/", :results => results }
+ render :action => "results"
rescue Exception => ex
- return { :source => "OpenStreetMap Namefinder", :url => "http://gazetteer.openstreetmap.org/namefinder/", :error => "Error contacting gazetteer.openstreetmap.org: #{ex.to_s}" }
+ @error = "Error contacting gazetteer.openstreetmap.org: #{ex.to_s}"
+ render :action => "error"
end
- def search_geonames(query)
- results = Array.new
+ def search_geonames
+ # get query parameters
+ query = params[:query]
+
+ # create result array
+ @results = Array.new
# ask geonames.org
response = fetch_xml("http://ws.geonames.org/search?q=#{escape_query(query)}&maxRows=20")
lon = geoname.get_text("lng").to_s
name = geoname.get_text("name").to_s
country = geoname.get_text("countryName").to_s
- results.push({:lat => lat, :lon => lon,
- :zoom => APP_CONFIG['geonames_zoom'],
- :name => name,
- :suffix => ", #{country}"})
+ @results.push({:lat => lat, :lon => lon,
+ :zoom => APP_CONFIG['geonames_zoom'],
+ :name => name,
+ :suffix => ", #{country}"})
end
- return { :source => "GeoNames", :url => "http://www.geonames.org/", :results => results }
+ render :action => "results"
rescue Exception => ex
- return { :source => "GeoNames", :url => "http://www.geonames.org/", :error => "Error contacting ws.geonames.org: #{ex.to_s}" }
+ @error = "Error contacting ws.geonames.org: #{ex.to_s}"
+ render :action => "error"
end
+
+ def description
+ @sources = Array.new
- def description_osm_namefinder(types, lat, lon, max)
- results = Array.new
+ @sources.push({ :name => "osm_namefinder", :types => "cities", :max => 2 })
+ @sources.push({ :name => "osm_namefinder", :types => "towns", :max => 4 })
+ @sources.push({ :name => "osm_namefinder", :types => "places", :max => 10 })
+ @sources.push({ :name => "geonames" })
+
+ render :update do |page|
+ page.replace_html :sidebar_content, :partial => "description"
+ page.call "openSidebar"
+ end
+ end
+
+ def description_osm_namefinder
+ # get query parameters
+ lat = params[:lat]
+ lon = params[:lon]
+ types = params[:types]
+ max = params[:max]
+
+ # create result array
+ @results = Array.new
# ask OSM namefinder
response = fetch_xml("http://gazetteer.openstreetmap.org/namefinder/search.xml?find=#{types}+near+#{lat},#{lon}&max=#{max}")
distance = format_distance(place.attributes["approxdistance"].to_i)
direction = format_direction((place.attributes["direction"].to_i - 180) % 360)
prefix = "#{distance} #{direction} of #{type} "
- results.push({:lat => lat, :lon => lon, :zoom => zoom,
- :prefix => prefix.capitalize, :name => name,
- :description => description})
+ @results.push({:lat => lat, :lon => lon, :zoom => zoom,
+ :prefix => prefix.capitalize, :name => name,
+ :description => description})
end
- return { :type => types.capitalize, :source => "OpenStreetMap Namefinder", :url => "http://gazetteer.openstreetmap.org/namefinder/", :results => results }
+ render :action => "results"
rescue Exception => ex
- return { :type => types.capitalize, :source => "OpenStreetMap Namefinder", :url => "http://gazetteer.openstreetmap.org/namefinder/", :error => "Error contacting gazetteer.openstreetmap.org: #{ex.to_s}" }
+ @error = "Error contacting gazetteer.openstreetmap.org: #{ex.to_s}"
+ render :action => "error"
end
- def description_geonames(lat, lon)
- results = Array.new
+ def description_geonames
+ # get query parameters
+ lat = params[:lat]
+ lon = params[:lon]
+
+ # create result array
+ @results = Array.new
# ask geonames.org
response = fetch_xml("http://ws.geonames.org/countrySubdivision?lat=#{lat}&lng=#{lon}")
response.elements.each("geonames/countrySubdivision") do |geoname|
name = geoname.get_text("adminName1").to_s
country = geoname.get_text("countryName").to_s
- results.push({:prefix => "#{name}, #{country}"})
+ @results.push({:prefix => "#{name}, #{country}"})
end
- return { :type => "Location", :source => "GeoNames", :url => "http://www.geonames.org/", :results => results }
+ render :action => "results"
rescue Exception => ex
- return { :type => "Location", :source => "GeoNames", :url => "http://www.geonames.org/", :error => "Error contacting ws.geonames.org: #{ex.to_s}" }
+ @error = "Error contacting ws.geonames.org: #{ex.to_s}"
+ render :action => "error"
end
+private
+
def fetch_text(url)
return Net::HTTP.get(URI.parse(url))
end
end
def format_distance(distance)
- return t("geocoder.results.distance", :count => distance)
+ return t("geocoder.distance", :count => distance)
end
def format_direction(bearing)
- return t("geocoder.results.direction.south_west") if bearing >= 22.5 and bearing < 67.5
- return t("geocoder.results.direction.south") if bearing >= 67.5 and bearing < 112.5
- return t("geocoder.results.direction.south_east") if bearing >= 112.5 and bearing < 157.5
- return t("geocoder.results.direction.east") if bearing >= 157.5 and bearing < 202.5
- return t("geocoder.results.direction.north_east") if bearing >= 202.5 and bearing < 247.5
- return t("geocoder.results.direction.north") if bearing >= 247.5 and bearing < 292.5
- return t("geocoder.results.direction.north_west") if bearing >= 292.5 and bearing < 337.5
- return t("geocoder.results.direction.west")
+ return t("geocoder.direction.south_west") if bearing >= 22.5 and bearing < 67.5
+ return t("geocoder.direction.south") if bearing >= 67.5 and bearing < 112.5
+ return t("geocoder.direction.south_east") if bearing >= 112.5 and bearing < 157.5
+ return t("geocoder.direction.east") if bearing >= 157.5 and bearing < 202.5
+ return t("geocoder.direction.north_east") if bearing >= 202.5 and bearing < 247.5
+ return t("geocoder.direction.north") if bearing >= 247.5 and bearing < 292.5
+ return t("geocoder.direction.north_west") if bearing >= 292.5 and bearing < 337.5
+ return t("geocoder.direction.west")
end
def format_name(name)
--- /dev/null
+<% @sources.each do |source| %>
+ <% if source[:types] %>
+ <p class="search_results_heading"><%= t("geocoder.description.title.#{source[:name]}", :types => t("geocoder.description.types.#{source[:types]}")) %></p>
+ <% else %>
+ <p class="search_results_heading"><%= t("geocoder.description.title.#{source[:name]}") %></p>
+ <% end %>
+ <div class='search_results_entry' id='<%= "description_#{source[:name]}_#{source[:types]}" %>'>
+ <%= image_tag "searching.gif", :class => "search_searching" %>
+ </div>
+ <script type="text/javascript">
+ <%= remote_function :update => "description_#{source[:name]}_#{source[:types]}", :url => { :action => "description_#{source[:name]}", :lat => params[:lat], :lon => params[:lon], :types => source[:types], :max => source[:max] } %>
+ </script>
+<% end %>
+++ /dev/null
-<% results.each do |source| %>
-<% type = source[:type] || t('geocoder.results.results') %>
-<p class="search_results_heading"><%= t'geocoder.results.type_from_source', :type => type, :source_link => link_to(source[:source], source[:url]) %></p>
-<% if source[:results] %>
-<% if source[:results].empty? %>
-<p class="search_results_entry"><%= t'geocoder.results.no_results' %></p>
-<% else %>
-<% source[:results].each do |result| %>
-<p class="search_results_entry"><%= result_to_html(result) %></p>
-<% end %>
-<% end %>
-<% else %>
-<p class="search_results_error"><%= source[:error] %></p>
-<% end %>
-<% end %>
--- /dev/null
+<% @sources.each do |source| %>
+ <p class="search_results_heading"><%= t "geocoder.search.title.#{source}" %></p>
+ <div class='search_results_entry' id='<%= "search_#{source}" %>'>
+ <%= image_tag "searching.gif", :class => "search_searching" %>
+ </div>
+ <script type="text/javascript">
+ <%= remote_function :update => "search_#{source}", :url => { :action => "search_#{source}", :query => @query } %>
+ </script>
+<% end %>
--- /dev/null
+<p class="search_results_error"><%= @error %></p>
--- /dev/null
+<% if @results.empty? %>
+ <p class="search_results_entry"><%= t 'geocoder.results.no_results' %></p>
+<% else %>
+ <% @results.each do |result| %>
+ <p class="search_results_entry"><%= result_to_html(result) %></p>
+ <% end %>
+<% end %>
<script type="text/javascript">
<!--
function startSearch() {
- updateSidebar("<%= t 'site.sidebar.search_results' %>", "<p class='search_results_entry'><%= t 'site.search.searching' %><\/p>");
-
- $("search_field").style.display = "none";
- $("search_active").style.display = "inline";
- }
-
- function endSearch() {
- $("search_field").style.display = "inline";
- $("search_active").style.display = "none";
+ updateSidebar("<%= t 'site.sidebar.search_results' %>", "");
}
function describeLocation() {
var position = getPosition();
<%= remote_function(:loading => "startSearch()",
- :complete => "endSearch()",
:url => { :controller => :geocoder, :action => :description },
:with => "'lat=' + position.lat + '&lon=' + position.lon") %>
}
<% if params[:query] %>
<%= remote_function(:loading => "startSearch()",
- :complete => "endSearch()",
:url => { :controller => :geocoder, :action => :search, :query => h(params[:query]) }) %>
<% end %>
// -->
<%= submit_tag t('site.search.submit_text') %>
<% end %>
</div>
- <p id="search_active"><%= t 'site.search.searching' %></p>
</div>
<p class="search_help">
<%= t 'site.search.search_help' %>
add_marker: "Дадаць маркер на карту"
view_larger_map: "Прагледзець большую карту"
geocoder:
+ search:
+ title:
+ latlon: 'Рэзультаты з <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Рэзультаты з <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Рэзультаты з <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Рэзультаты з <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Рэзультаты з <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Рэзультаты з <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "Рэзультаты"
- type_from_source: "{{type}} з {{source_link}}"
no_results: "Нічога не знойдзена"
layouts:
welcome_user: "Вітаем, {{user_link}}"
search: Пошук
where_am_i: "Дзе я?"
submit_text: "=>"
- searching: "Пошук..."
search_help: "напрыклад: 'Мінск', 'Regent Street, Cambridge', 'CB2 5AQ', ці 'post offices near Lünen' <a href='http://wiki.openstreetmap.org/wiki/Search'>больш прыкладаў...</a>"
key:
map_key: "Ключ карты"
add_marker: "Markierung zur Karte hinzufügen"
view_larger_map: "Größere Karte anzeigen"
geocoder:
+ search:
+ title:
+ latlon: 'Suchergebnisse von <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Suchergebnisse von <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Suchergebnisse von <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Suchergebnisse von <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Suchergebnisse von <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Suchergebnisse von <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "Suchergebnisse"
- type_from_source: "{{type}} von {{source_link}}"
no_results: "Keine Ergebnisse"
layouts:
project_name:
search: Suchen
where_am_i: "Wo bin ich?"
submit_text: "Go"
- searching: "Suche..."
search_help: "Beispiele: 'München', 'Heinestraße, Würzburg', 'CB2 5AQ', oder 'post offices near Lünen' <a href='http://wiki.openstreetmap.org/wiki/Search'>mehr Beispiele...</a>"
key:
map_key: "Legende"
add_marker: "Add a marker to the map"
view_larger_map: "View Larger Map"
geocoder:
+ search:
+ title:
+ latlon: 'Results from <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Results from <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Results from <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Results from <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Results from <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Results from <a href="http://www.geonames.org/">GeoNames</a>'
+ search_osm_namefinder:
+ prefix: "{{type}} "
+ suffix_place: ", {{distance}} {{direction}} of {{placename}}"
+ suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} of {{parentname}})"
+ suffix_suburb: "{{suffix}}, {{parentname}}"
+ description:
+ title:
+ osm_namefinder: '{{types}} from <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Location from <a href="http://www.geonames.org/">GeoNames</a>'
+ types:
+ cities: Cities
+ towns: Towns
+ places: Places
results:
- results: "Results"
- type_from_source: "{{type}} from {{source_link}}"
no_results: "No results found"
- namefinder:
- prefix: "{{type}} "
- suffix_place: ", {{distance}} {{direction}} of {{placename}}"
- suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} of {{parentname}})"
- suffix_suburb: "{{suffix}}, {{parentname}}"
- distance:
- zero: "less than 1km"
- one: "about 1km"
- other: "about {{count}}km"
- direction:
- south_west: "south-west"
- south: "south"
- south_east: "south-east"
- east: "east"
- north_east: "north-east"
- north: "north"
- north_west: "north-west"
- west: "west"
+ distance:
+ zero: "less than 1km"
+ one: "about 1km"
+ other: "about {{count}}km"
+ direction:
+ south_west: "south-west"
+ south: "south"
+ south_east: "south-east"
+ east: "east"
+ north_east: "north-east"
+ north: "north"
+ north_west: "north-west"
+ west: "west"
layouts:
project_name:
# in <title>
search: Search
where_am_i: "Where am I?"
submit_text: "Go"
- searching: "Searching..."
search_help: "examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', or 'post offices near Lünen' <a href='http://wiki.openstreetmap.org/wiki/Search'>more examples...</a>"
key:
map_key: "Map key"
add_marker: "Añadir un marcador al mapa"
view_larger_map: "Ver mapa más grande"
geocoder:
+ search:
+ title:
+ latlon: 'Resultados en <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Resultados en <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Resultados en <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Resultados en <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Resultados en <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Resultados en <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "Resultados"
- type_from_source: "{{type}} en {{source_link}}"
no_results: "No se han encontrado resultados"
layouts:
project_name:
search: "Buscar"
where_am_i: "¿Dónde estoy?"
submit_text: "Ir"
- searching: "Buscando..."
trace:
edit:
points: "Puntos:"
search: "Recherche"
where_am_i: "Où suis-je ?"
submit_text: "Envoyer"
- searching: "En cours de recherche..."
search_help: "exemples : 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', ou 'bureaux de poste près de Lünen' <a href='http://wiki.openstreetmap.org/wiki/Search'>Autres d'exemples...</a>"
key:
map_key: "Légende de la carte"
view_larger_map: "View Larger Map"
geocoder:
results:
- results: "Results"
- type_from_source: "{{type}} from {{source_link}}"
no_results: "No results found"
layouts:
welcome_user: "{{user_link}}ברוך הבא"
search: Search
where_am_i: "Where am I?"
submit_text: "Go"
- searching: "Searching..."
search_help: "examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', or 'post offices near Lünen' <a href='http://wiki.openstreetmap.org/wiki/Search'>more examples...</a>"
key:
map_key: "Map key"
view_larger_map: "View Larger Map"
geocoder:
results:
- results: "Results"
- type_from_source: "{{type}} from {{source_link}}"
no_results: "No results found"
layouts:
welcome_user: "Welcome, {{user_link}}"
search: Search
where_am_i: "Where am I?"
submit_text: "Go"
- searching: "Searching..."
search_help: "examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', or 'post offices near Lünen' <a href='http://wiki.openstreetmap.org/wiki/Search'>more examples...</a>"
key:
map_key: "Map key"
add_marker: "Bæta við punkt á kortið"
view_larger_map: "Skoða á stærra korti"
geocoder:
+ search:
+ title:
+ latlon: 'Niðurstöður frá <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Niðurstöður frá <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Niðurstöður frá <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Niðurstöður frá <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Niðurstöður frá <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Niðurstöður frá <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "Niðurstöður"
- type_from_source: "{{type}} frá {{source_link}}"
no_results: "Ekkert fannst"
namefinder:
prefix: "{{type}} "
search: "Leita"
where_am_i: "Hvar er ég?"
submit_text: "Ok"
- searching: "Leita..."
search_help: "dæmi: „Akureyri“, „Laugavegur, Reykjavík“ eða „post offices near Lünen“. Sjá einnig <a href='http://wiki.openstreetmap.org/index.php?uselang=is&title=Search'>leitarhjálpina</a>."
key:
map_key: "Kortaskýringar"
add_marker: "Aggiungi un marcatore alla mappa"
view_larger_map: "Visualizza una mappa più ampia"
geocoder:
+ search:
+ title:
+ latlon: 'Risultati da <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Risultati da <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Risultati da <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Risultati da <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Risultati da <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Risultati da <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "Risultati"
- type_from_source: "{{type}} da {{source_link}}"
no_results: "Nessun risultato"
layouts:
welcome_user: "Benvenuto, {{user_link}}"
search: Cerca
where_am_i: "Dove sono?"
submit_text: "Vai"
- searching: "Ricerca in corso..."
search_help: "esempi: 'Trieste', 'Via Dante Alighieri, Trieste', 'CB2 5AQ', oppure 'post offices near Trieste' <a href='http://wiki.openstreetmap.org/wiki/Search'>altri esempi...</a>"
key:
map_key: "Legenda"
add_marker: "マーカーを地図に追加する"
view_larger_map: "大きな地図を表示..."
geocoder:
+ search:
+ title:
+ latlon: '<a href="http://openstreetmap.org/">Internal</a>からの結果'
+ us_postcode: '<a href="http://geocoder.us/">Geocoder.us</a>からの結果'
+ uk_postcode: '<a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>からの結果'
+ ca_postcode: '<a href="http://geocoder.ca/">Geocoder.CA</a>からの結果'
+ osm_namefinder: '<a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>からの結果'
+ geonames: '<a href="http://www.geonames.org/">GeoNames</a>からの結果'
results:
- results: "結果"
- type_from_source: "{{source_link}}からの{{type}}"
no_results: "見つかりませんでした。"
layouts:
project_name:
search: "検索"
where_am_i: "いまどこ?"
submit_text: "行く"
- searching: "検索中..."
search_help: "例: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', or 'post offices near Lünen' <a href='http://wiki.openstreetmap.org/wiki/Search'>他の例...</a>"
#いずれ、wiki.openstreetmap.org/wiki/Ja:Searchを作成すること
key:
view_larger_map: "큰 지도 보기"
geocoder:
results:
- results: "Results"
- type_from_source: "{{type}} from {{source_link}}"
no_results: "No results found"
layouts:
project_name:
search: Search
where_am_i: "Where am I?"
submit_text: "Go"
- searching: "Searching..."
search_help: "examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', or 'post offices near L체nen' <a href='http://wiki.openstreetmap.org/wiki/Search'>more examples...</a>"
key:
map_key: "Map key"
add_marker: "Marker op de kaart zetten"
view_larger_map: "Grotere kaart zien"
geocoder:
+ search:
+ title:
+ latlon: 'Resultaten van <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Resultaten van <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Resultaten van <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Resultaten van <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Resultaten van <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Resultaten van <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "Resultaten"
- type_from_source: "{{type}} van {{source_link}}"
no_results: "Geen resultaten gevonden"
layouts:
welcome_user: "Welkom, {{user_link}}"
search: Zoeken
where_am_i: "Waar ben ik?"
submit_text: "Ga"
- searching: "Zoeken..."
search_help: "voorbeelden: 'Alkmaar', 'Spui, Amsterdam', 'CB2 5AQ', of 'post offices near Leiden' <a href='http://wiki.openstreetmap.org/wiki/Search'>meer voorbeelden...</a>"
key:
map_key: "Legenda"
add_marker: "Dodaj pinezkę na mapie"
view_larger_map: "Większy widok mapy"
geocoder:
+ search:
+ title:
+ latlon: 'Wyniki z <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Wyniki z <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Wyniki z <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Wyniki z <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Wyniki z <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Wyniki z <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "Wyniki"
- type_from_source: "{{type}} z {{source_link}}"
no_results: "Nie znaleziono"
layouts:
welcome_user: "Witaj, {{user_link}}"
search: Wyszukiwanie
where_am_i: "Gdzie jestem?"
submit_text: "Szukaj"
- searching: "Wyszukiwanie..."
search_help: "przykłady: 'Wąchock', 'Franciszkańska, Poznań', 'CB2 5AQ', lub 'post offices near Mokotów' <a href='http://wiki.openstreetmap.org/wiki/Search'>więcej przykładów...</a>"
key:
map_key: "Legenda"
add_marker: "Adicionar um marcador ao mapa"
view_larger_map: "Ver Mapa Ampliado"
geocoder:
+ search:
+ title:
+ latlon: 'Resultados de <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Resultados de <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Resultados de <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Resultados de <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Resultados de <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Resultados de <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "Resultados"
- type_from_source: "{{type}} de {{source_link}}"
no_results: "Não foram encontrados resultados"
layouts:
project_name:
search: "Buscar"
where_am_i: "Onde estou?"
submit_text: "Ir"
- searching: "Buscando..."
search_help: "exemplos: 'Belo Horizonte', 'Av. Paulista, São Paulo', 'CB2 5AQ', or 'post offices near Porto Alegre' <a href='http://wiki.openstreetmap.org/wiki/Pt-br:Search'>mais exemplos...</a>"
key:
map_key: "Map key"
add_marker: "Добавить маркер на карту"
view_larger_map: "Посмотреть бо́льшую карту"
geocoder:
+ search:
+ title:
+ latlon: 'Результаты из <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Результаты из <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Результаты из <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Результаты из <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Результаты из <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Результаты из <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "Результаты"
- type_from_source: "{{type}} из {{source_link}}"
no_results: "Ничего не найдено"
layouts:
welcome_user: "Добро пожаловать, {{user_link}}"
search: Поиск
where_am_i: "Где я?"
submit_text: "->"
- searching: "Поиск..."
search_help: "примеры: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', или 'post offices near LУМnen' <a href='http://wiki.openstreetmap.org/wiki/Search'>больше примеров...</a>"
key:
map_key: "Легенда"
add_marker: "Dodaj zaznamek na zemljevid"
view_larger_map: "Večji zemljevid"
geocoder:
+ search:
+ title:
+ latlon: 'Zadetki iz <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: 'Zadetki iz <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: 'Zadetki iz <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: 'Zadetki iz <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: 'Zadetki iz <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: 'Zadetki iz <a href="http://www.geonames.org/">GeoNames</a>'
+ search_osm_namefinder:
+ prefix: "{{type}} "
+ suffix_place: ", {{distance}} {{direction}} od {{placename}}"
+ suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} od {{parentname}})"
+ suffix_suburb: "{{suffix}}, {{parentname}}"
results:
- results: "Zadetki"
- type_from_source: "{{type}} iz {{source_link}}"
no_results: "Ni zadetkov"
- namefinder:
- prefix: "{{type}} "
- suffix_place: ", {{distance}} {{direction}} od {{placename}}"
- suffix_parent: "{{suffix}} ({{parentdistance}} {{parentdirection}} od {{parentname}})"
- suffix_suburb: "{{suffix}}, {{parentname}}"
- distance:
- zero: "manj kot 1 km"
- one: "približno {{count}} km"
- other: "približno {{count}} km"
- direction:
- south_west: "jugozahodno"
- south: "južno"
- south_east: "jugovzhodno"
- east: "vzhodno"
- north_east: "severovzhodno"
- north: "severno"
- north_west: "severozahodno"
- west: "zahodno"
+ distance:
+ zero: "manj kot 1 km"
+ one: "približno {{count}} km"
+ other: "približno {{count}} km"
+ direction:
+ south_west: "jugozahodno"
+ south: "južno"
+ south_east: "jugovzhodno"
+ east: "vzhodno"
+ north_east: "severovzhodno"
+ north: "severno"
+ north_west: "severozahodno"
+ west: "zahodno"
layouts:
project_name:
# in <title>
search: Iskanje
where_am_i: "Kje sem?"
submit_text: "Išči"
- searching: "Iščem..."
search_help: "primeri: 'Bovec', 'Prešernova, Celje', 'Živalski vrt' ali 'vzpenjača' <a href='http://wiki.openstreetmap.org/wiki/Search'>Več primerov...</a>"
key:
map_key: "Legenda"
view_larger_map: "View Larger Map"
geocoder:
results:
- results: "Results"
- type_from_source: "{{type}} from {{source_link}}"
no_results: "No results found"
layouts:
project_name:
search: Search
where_am_i: "Ni bo ni mo wa?"
submit_text: "Lo"
- searching: "Searching..."
search_help: "examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', or 'post offices near Lünen' <a href='http://wiki.openstreetmap.org/wiki/Search'>more examples...</a>"
key:
map_key: "Map key"
add_marker: "标记地图"
view_larger_map: "查看放大地图"
geocoder:
+ search:
+ title:
+ latlon: '结果 从 <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: '结果 从 <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: '结果 从 <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: '结果 从 <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: '结果 从 <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: '结果 从 <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "结果"
- type_from_source: "{{type}} 从 {{source_link}}"
no_results: "没有发现结果"
layouts:
welcome_user: "欢迎, {{user_link}}"
search: 搜索
where_am_i: "我在哪儿?"
submit_text: "开始"
- searching: "搜索中..."
search_help: "例如: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', 或者 'post offices near L??nen' <a href='http://wiki.openstreetmap.org/wiki/Search'>更多例子...</a>"
key:
map_key: "地图符号"
add_marker: "加入標記至地圖"
view_larger_map: "檢視較大的地圖"
geocoder:
+ search:
+ title:
+ latlon: '結果 從 <a href="http://openstreetmap.org/">Internal</a>'
+ us_postcode: '結果 從 <a href="http://geocoder.us/">Geocoder.us</a>'
+ uk_postcode: '結果 從 <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
+ ca_postcode: '結果 從 <a href="http://geocoder.ca/">Geocoder.CA</a>'
+ osm_namefinder: '結果 從 <a href="http://gazetteer.openstreetmap.org/namefinder/">OpenStreetMap Namefinder</a>'
+ geonames: '結果 從 <a href="http://www.geonames.org/">GeoNames</a>'
results:
- results: "結果"
- type_from_source: "{{type}} 從 {{source_link}}"
no_results: "找不到任何結果"
layouts:
project_name:
search: "搜尋"
where_am_i: "我在哪裡?"
submit_text: "走"
- searching: "搜尋中..."
search_help: "範例: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', 或 'post offices near L羹nen' <a href='http://wiki.openstreetmap.org/wiki/Search'>更多範例...</a>"
key:
map_key: "圖例"
# geocoder
map.connect '/geocoder/search', :controller => 'geocoder', :action => 'search'
+ map.connect '/geocoder/search_latlon', :controller => 'geocoder', :action => 'search_latlon'
+ map.connect '/geocoder/search_us_postcode', :controller => 'geocoder', :action => 'search_uk_postcode'
+ map.connect '/geocoder/search_uk_postcode', :controller => 'geocoder', :action => 'search_us_postcode'
+ map.connect '/geocoder/search_ca_postcode', :controller => 'geocoder', :action => 'search_ca_postcode'
+ map.connect '/geocoder/search_osm_namefinder', :controller => 'geocoder', :action => 'search_osm_namefinder'
+ map.connect '/geocoder/search_geonames', :controller => 'geocoder', :action => 'search_geonames'
map.connect '/geocoder/description', :controller => 'geocoder', :action => 'description'
+ map.connect '/geocoder/description_osm_namefinder', :controller => 'geocoder', :action => 'description_osm_namefinder'
+ map.connect '/geocoder/description_geonames', :controller => 'geocoder', :action => 'description_geonames'
# export
map.connect '/export/start', :controller => 'export', :action => 'start'
padding-bottom: 6px;
}
-#search_active {
- display: none;
- color: red;
-}
-
.rsssmall {
position: relative;
top: 4px;
margin-bottom: 0px;
}
+.search_searching {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+
.olControlAttribution {
display: none !important;
}