1 <div id="search_results">
2 <table class="search_results_title" width="100%">
4 <td align="left" id="search_title">Search Results</td>
5 <td align="right"><a href="javascript:closeSearchResults()">Close</a></td>
8 <div id="search_results_content">
12 <script type="text/javascript">
15 $("search_results").style.display = "block";
16 $("search_results_content").innerHTML = "<p><img src='images/keymapnik11.png' /></p>";
17 $("search_title").innerHTML = "Map key";
21 function startSearch() {
22 $("search_results_content").innerHTML = "<p class='search_results_entry'>Searching...</p>";
23 $("search_title").innerHTML = "Search Results";
24 $("search_field").style.display = "none";
25 $("search_active").style.display = "inline";
28 function endSearch() {
29 $("search_field").style.display = "inline";
30 $("search_active").style.display = "none";
33 function openSearchResults() {
34 $("search_results").style.display = "block";
38 function closeSearchResults() {
39 $("search_results").style.display = "none";
43 function describeLocation() {
44 var position = getPosition();
46 <%= remote_function(:loading => "startSearch()",
47 :complete => "endSearch()",
48 :url => { :controller => :geocoder, :action => :description },
49 :with => "'lat=' + position.lat + '&lon=' + position.lon") %>
52 <% if params[:query] %>
53 <%= remote_function(:loading => "startSearch()",
54 :complete => "endSearch()",
55 :url => { :controller => :geocoder, :action => :search, :query => params[:query] }) %>
60 <% content_for "optionals" do %>
61 <div class="optionalbox">
62 <span class="oboxheader">Search</span>
63 <span class="whereami"><a href="javascript:describeLocation()">Where am I?</a></span>
64 <div class="search_form">
65 <span id="search_field">
66 <% form_remote_tag(:loading => "startSearch()",
67 :complete => "endSearch()",
68 :url => { :controller => :geocoder, :action => :search }) do %>
69 <%= text_field_tag :query, params[:query] %>
72 <p id="search_active">Searching...</p>
74 <p class="search_help">
75 examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ',
76 or 'post offices near Lünen'
77 <a href="http://wiki.openstreetmap.org/index.php/Search">more examples...</a>