[openstreetmap/openstreetmap-website] Simplify routing endpoint interface, always do reverse geocoding (PR #5064)
Anton Khorev
notifications at github.com
Sun Sep 8 07:48:46 UTC 2024
@AntonKhorev commented on this pull request.
> input.val(json[0].display_name);
changeCallback();
});
}
+ function getReverseGeocode() {
+ var latlng = endpoint.latlng.clone();
+ var reverseGeocodeUrl = OSM.NOMINATIM_URL + "reverse?lat=" + latlng.lat + "&lon=" + latlng.lng + "&format=json";
+
+ endpoint.geocodeRequest = $.getJSON(reverseGeocodeUrl, function (json) {
+ delete endpoint.geocodeRequest;
+ if (!json || !json.display_name) {
+ input.addClass("is-invalid");
+ alert(I18n.t("javascripts.directions.errors.no_place", { place: endpoint.value }));
It shouldn't be an error but it currently is, that's why I kept it. That's not the only thing wrong about error handling here.
Removed `addClass` and `alert` now.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5064#discussion_r1749123679
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5064/review/2288471886 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240908/32fe5535/attachment-0001.htm>
More information about the rails-dev
mailing list