If I add transit points through the editor with a mouse, then the next attempt to change the route addresses via multiRoute.model.setReferencePoints ([[], []]) gives an error: {code: 500, message: "internal server error"} and the address is not is changing.

If the transit does not add, then everything is fine.

I hope I completely described the problem. How can I change the route addresses all the same?

Here is an example https://jsfiddle.net/helight59/o120gdhb/

  • Gather a minimal example reproducing the problem on jsfiddle. While it is not clear which way to dig) - se0ga
  • @ se0ga added an example - Nikolay
  • @ se0ga wait for help? - Nikolay
  • setReferencePoints takes the via-point with the second parameter; if you do not pass it, it passes the previous state, that is, the first point is the via-point. Pass the second parameter and everything works jsfiddle.net/spwfq7j2 - se0ga
  • @ se0ga fuh. You can throw as an answer. Add in docs please this. I am 2 hours washed. I went over the options and decided to re-request multiRoute, but your answer decided the question. - Nikolay

1 answer 1

setReferencePoints takes the via-points with the second parameter; if you do not pass it, it passes the previous state, that is, in your case, the first point is the via-point and therefore an error occurs. Pass the second parameter and everything works.

 multiRoute.model.setReferencePoints([ [55.789085, 37.493621], [55.789424, 37.481948] ], []); 

jsfiddle.net/spwfq7j2