[openstreetmap/openstreetmap-website] Fixed displacing points specified from context menu (PR #4904)
Nenad Vujicic
notifications at github.com
Thu Jul 25 12:43:05 UTC 2024
@nenad-vujicic commented on this pull request.
> });
- endpoint.setValue = function (value, latlng) {
+ endpoint.setValue = function (value, force_reverse_geocoding, latlng) {
@AntonKhorev I've just pushed the latest fixes.
We improved logic of what is displayed in input boxes after right-clicking and selecting option from context menu. Now, if nominatim doesn't return anything or it returns something that is more than 200m away from clicked position, we will display coordinates (Number, Number), otherwise we will display what nominatim returned. The logic behind is "in input boxes should be displayed user-friendly text iff user entered it manually or user clicked on / or near the object recognized by nominatim, otherwise, coordinates will be displayed".
For calculating distance between position where user clicked and position of what nominatim returned, we used distanceTo method provided by Leaflet's LatLng which reduces it to calculating distance on great circle. After testing on Longyearbyen and Longyearbyen, it seems this approximation works fine.
Please, let me know if we can further improve it.
Thanks,
Nenad.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4904#discussion_r1691377936
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4904/review/2199187670 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240725/49afcfea/attachment.htm>
More information about the rails-dev
mailing list