[openstreetmap/openstreetmap-website] Fix route path 'hovering' when marker positions are changed (#1755)

Jamie Guthrie notifications at github.com
Wed Feb 14 20:02:15 UTC 2018


If you have a route already on screen, and then type in a new location in either the start or end destinations and click anywhere except for basically the Go button, then the marker position moves, but the route remains going to the old position.

Likewise, if you then type in a new destination for the other marker and click anywhere except the Go button, then you end up with 2 markers in their respective positions and a route path just gliding across the screen unconnected from everything!

I propose that getRoute() is called everytime the input text is changed because chances are, the marker will move and a new route will need to be calculated.

I do this by simply setting `awaitingGeocode = true` when the input text changes.

___
I also included in some refactoring which should probably be in another PR.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/1755

-- Commit Summary --

  * Fix route path 'hovering' when marker positions are changed

-- File Changes --

    M app/assets/javascripts/index/directions.js (8)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/1755.patch
https://github.com/openstreetmap/openstreetmap-website/pull/1755.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1755
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180214/8175fcb5/attachment.html>


More information about the rails-dev mailing list