[openstreetmap/openstreetmap-website] Simplify routing endpoint interface, always do reverse geocoding (PR #5064)
Tom Hughes
notifications at github.com
Fri Sep 6 17:15:03 UTC 2024
@tomhughes commented on this pull request.
I'm not sure I agree with either part of the title of this PR as I don't really see any simplification - quite the opposite if anything. The "always do reverse geocoding" is also misleading because it implies extending an existing use when in fact this introduces reverse geocoding for the first time?
> 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 }));
Why should it be an error to route to or from a location that can't be reverse geocoded? Surely we should just stick with the coordinates the user gave in that case? If there is a good reason for it then I definitely think we need to replace `alert` with something better.
> 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";
Do we need to control the match precision here? Might this cause a location to "snap" to something a long way away?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5064#pullrequestreview-2286764681
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5064/review/2286764681 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240906/af0f3df2/attachment-0001.htm>
More information about the rails-dev
mailing list