mapbox / mapbox-gl-directions

Directions plugin for mapbox-gl-js using Mapbox Directions API.
https://mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/
ISC License
237 stars 127 forks source link

New waypoint created by dragging is always inserted at first postion in waypoint array #184

Open pathmapper opened 6 years ago

pathmapper commented 6 years ago

mapbox-gl-directions: v3.1.3 mapbox-gl-js: v0.44.2 (not used v0.45.0 because of https://github.com/mapbox/mapbox-gl-js/issues/6642)

A new waypoint created by dragging is always inserted at first postion in the waypoint array, which results in unexpected routing results if there is already at least one waypoint present and the drag didn't start on the first leg of the route:

drag_issue

Example: http://jsbin.com/yukacocuco/edit?html,output

The position in the waypoint array should be choosen according to the leg of the route where the drag action started.

patrix commented 5 years ago

PR #200 fix the problem

nicolas-marien commented 5 years ago

Any plan on merging the provided fix ? Thank you :)