<p></p>
<p><b>@tomhughes</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5302#discussion_r1970337940">app/controllers/geocoder_controller.rb</a>:</p>
<pre style='color:#555'>> @@ -148,7 +148,11 @@ def search_osm_nominatim_reverse
:type => object_type, :id => object_id)
end
- render :action => "results"
+ if params[:format] == "json"
+ render :json => @results
+ else
+ render :action => "results"
+ end
</pre>
<p dir="auto">This should probably use <a href="https://api.rubyonrails.org/classes/ActionController/MimeResponds.html#method-i-respond_to" rel="nofollow">respond_to</a>.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5302#discussion_r1970339095">app/assets/javascripts/user.js</a>:</p>
<pre style='color:#555'>> + return;
+ }
+
+ const geocodeUrl = "/geocoder/search_osm_nominatim_reverse";
+ const params = {
+ format: "json",
+ lat,
+ lon,
+ zoom: 3
+ };
+
+ if (locationInput.request) {
+ locationInput.request.abort();
+ }
+
+ locationInput.request = $.ajax({
</pre>
<p dir="auto">This should be changed to use <code class="notranslate">fetch</code> now.</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/5302#pullrequestreview-2642090400">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMZC7ELRRX2YKFH4UL2RS2IPAVCNFSM6AAAAABRF74QGWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMNBSGA4TANBQGA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPNUZBBQG7MR3FMPVT2RS2IPA5CNFSM6AAAAABRF74QGWWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTU5PMM2A.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/5302/review/2642090400</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/5302#pullrequestreview-2642090400",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5302#pullrequestreview-2642090400",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>