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

Anton Khorev notifications at github.com
Sat Jul 20 14:51:20 UTC 2024


@AntonKhorev commented on this pull request.



> @@ -402,8 +440,10 @@ OSM.Directions = function (map) {
       }
     }
 
-    endpoints[0].setValue(params.from || "", from);
-    endpoints[1].setValue(params.to || "", to);
+    var ll_from_search_form = decodeURIComponent(location.search).match(/^\?from=([+-]?\d+(\.\d*)?)(?:\s+|\s*[/,]\s*)([+-]?\d+(\.\d*)?)$/);

Does this regexp ever match anything?

"Directions from here" generate `location.search` like `?from=52.54124,13.56290&to=` which doesn't match. Do you want it to match?

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

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


More information about the rails-dev mailing list