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

Nenad Vujicic notifications at github.com
Fri Aug 9 19:02:14 UTC 2024


@nenad-vujicic commented on this pull request.



>      });
 
-    endpoint.setValue = function (value, latlng) {
+    endpoint.setValue = function (value, force_reverse_geocoding, latlng, fitMap) {

> Why would a single endpoint control fitting?
> 

Because the route can change on single endpoint update, so, it can go out of viewing area and we need to fit bounds.

> Then below you have:
> 
> ```
> endpoints[0].setValue(params.from || "", !ll_from_search_form, from, false);
> endpoints[1].setValue(params.to || "", !ll_from_search_form, to, true);
> ```
> 
> And not it's not clear why the first endpoint gets `fitMap = false` but the second one gets `fitMap = true`.

Because in some situations there is a flickering if we are doing fitting both times.

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

Message ID: <openstreetmap/openstreetmap-website/pull/4904/review/2230870168 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240809/1bf5e7d5/attachment.htm>


More information about the rails-dev mailing list