<p></p>
<p><b>@tomhughes</b> requested changes on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4895#discussion_r1640053774">app/controllers/geocoder_controller.rb</a>:</p>
<pre style='color:#555'>> @@ -15,8 +15,32 @@ def search
if @params[:lat] && @params[:lon]
@sources.push "latlon"
@sources.push "osm_nominatim_reverse"
+
+ # get query parameters
+ lat = params[:lat]
+ lon = params[:lon]
+ zoom = params[:zoom]
+
+ # create URL for nominatim reverse search
+ @cached_osm_nominatim_parameters = "reverse?format=html&lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{http_accept_language.user_preferred_languages.join(',')}"
</pre>
<p dir="auto">This, and the equivalent code for forward searches, is just duplicating the work that the search methods do.</p>
<p dir="auto">It would be better to move that code into private <code class="notranslate">nominatim_reverse_url</code> and <code class="notranslate">nominatim_url</code> methods that can then be used in both places.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4895#discussion_r1640054624">app/views/geocoder/search.html.erb</a>:</p>
<pre style='color:#555'>> @@ -3,10 +3,17 @@
<%= render "sidebar_header", :title => t("site.sidebar.search_results") %>
<% @sources.each do |source| %>
- <h4>
- <%= t(".title.results_from_html", :results_link => link_to(t(".title.#{source}"),
- t(".title.#{source}_url"))) %>
- </h4>
+ <% if source.include?("osm_nominatim") %>
</pre>
<p dir="auto">Rather than having this look at the name of the source it would be better to make <code class="notranslate">@sources</code> an array of hashes, each with a <code class="notranslate">:name</code> and an optional <code class="notranslate">:url</code> key.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4895#pullrequestreview-2118759066">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLM5DAYDDW7IF6OYVMDZHMKH5AVCNFSM6AAAAABJJ75LHKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMJYG42TSMBWGY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLKSHBECGIN2OZAUWTDZHMKH5A5CNFSM6AAAAABJJ75LHKWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTT6JGZJU.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4895/review/2118759066</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4895#pullrequestreview-2118759066",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4895#pullrequestreview-2118759066",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>