Use reverse geocoders for any lat/lon queries

This simplifies the implementation, allows code sharing with
"Where am I?", and produces friendlier results for lat/lon
searches (actual reverse geocode results rather than a raw
lat/lon display).
This commit is contained in:
John Firebaugh 2013-10-09 10:06:28 -07:00 committed by Tom Hughes
parent efc6aaf215
commit aaeca5b534
8 changed files with 108 additions and 138 deletions

View file

@ -1,13 +0,0 @@
<% @sources.each do |source| %>
<% if source[:types] %>
<h4><%= raw(t("geocoder.description.title.#{source[:name]}", :types => t("geocoder.description.types.#{source[:types]}"))) %></h4>
<% else %>
<h4><%= raw(t("geocoder.description.title.#{source[:name]}")) %></h4>
<% end %>
<div class='search_results_entry inner12' id='<%= "description_#{source[:name]}_#{source[:types]}" %>'>
<%= image_tag "searching.gif", :class => "search_searching" %>
</div>
<script type="text/javascript">
$("#description_<%= source[:name] %>_<%= source[:types] %>").load("<%= raw url_for :action => "description_#{source[:name]}", :lat => params[:lat], :lon => params[:lon], :zoom => params[:zoom], :types => source[:types], :max => source[:max] %>");
</script>
<% end %>

View file

@ -4,6 +4,6 @@
<%= image_tag "searching.gif", :class => "search_searching" %>
</div>
<script type="text/javascript">
$("#search_<%= source %>").load("<%= raw url_for :action => "search_#{source}", :query => @query, :minlat => params[:minlat], :minlon => params[:minlon], :maxlat => params[:maxlat], :maxlon => params[:maxlon] %>");
$("#search_<%= source %>").load("<%= raw url_for params.merge(:action => "search_#{source}") %>");
</script>
<% end %>