Insert Stop Along a Route

1062
0
05-20-2014 08:09 AM
LukeCatania
New Contributor III
I have an app in which a user can drop points for stops and solve the route.  I want to be able to have the user add a stop point along the route between two current stops and then drag that point to another place and update the route.  I already have the functionality to select any stop and drag that to a new location.

I am not sure how to add a new stop along the route.  My first attempt is to have the user select two current stop point and those will change color to indicate they are selected, then the user drops a point along the route between those two points to add the point. The code would iterate through the stops and insert the new stop point and then I would update the stops (NAFeaturesAsFeature).  The user can then drag that new stop to another location on the map and the route would update.

I would like to avoid the selection of the two stops and just let the user click on the current route and have the stop inserted it at the correct location in the NAFeaturesAsFeature variable.  If the route was a simple straight line it would be straight forward mathematics to accomplish this.  And can't just simply add the new stop to the NAFeaturesAsFeature variable because it would just take the new stop as a new endpoint to the route.
0 Kudos
0 Replies