[openstreetmap/openstreetmap-website] Fixed displacing points specified from context menu (PR #4904)

Anton Khorev notifications at github.com
Tue Aug 6 15:04:56 UTC 2024


@AntonKhorev commented on this pull request.



> -        geocodeCallback();
-      });
+          if (endpoint.latlng.distanceTo(L.latLng(json.lat, json.lon)) > 200.0) {
+            input.val(endpoint.value);
+          } else {
+            endpoint.value = json.display_name;
+            input.val(json.display_name);
+          }
+
+          geocodeCallback();
+        });
+      } else {
+        $.getJSON(OSM.NOMINATIM_URL + "search?q=" + encodeURIComponent(endpoint.value) + "&format=json&viewbox=" + viewbox, function (json) {
+          endpoint.awaitingGeocode = false;
+          endpoint.hasGeocode = true;
+          if (!json || json.length === 0) {

`let/const`, template literals, `?.` etc - we should decide on these in a separate issue, not in this PR.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4904#discussion_r1705703716
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4904/review/2221579087 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240806/7ed72c43/attachment-0001.htm>


More information about the rails-dev mailing list