perliedman on master
Duplicate property defined, fix… (compare)
overview=fullgive a full resolution version, but the reason for not always using it is that it requires more bandwidth/resources and might be slow when changing the route, for example while dragging.
@RomanSurface_twitter Hi Roman, so I had the same issue and I'm fairly certain its due to a recent change on the Mapbox side. Im finding that I only see this behavior when using the walking mode, when I change to driving or bicycling it seems to work fine. And I actually sent them a support ticket about the issue which Ive copied below:
Adrian (May 13, 5:46 AM PDT):
The Mapbox Directions API for walking mode seems to be returning invalid responses for the encoded polyline (geometry) information.
For example, this query:
Produces this field in the output (the first geometry field):
"s~fpqAbgokwCu@zAkAdEGdFFzJNzA" appears to be an invalid encoded polyline as it seems to decode to a point at the north pole (verified using: https://developers.google.com/maps/documentation/utilities/polylineutility)
If you run the Directions query instead with the cycling mode, it seems to produce correct polyline output:
Mapbox Support Response:
The encoding is correct but the resulting output is in reverse order. You will need to decode the polyline with something like https://github.com/mapbox/polyline and then reverse the order of the output like:
"coordinates": [ [ -79.896706,43.274234 ],
[ -79.896752,43.274261 ],
[ -79.896851,43.274299 ],
[ -79.896966,43.274303 ],
[ -79.897156,43.274299 ],
[ -79.897202 ,43.274291] ]
Does this help or answer your questions?
@alaurenz thanks for explaining and sharing. I have opened a ticket too and the response is this : =>>>>>
The issue appears to be with a a character being in the URL. Can you try this URL to confirm it works?
master_plan.spliceWaypoints(oldIndex, 1). I am trying to do this
@perliedman Hey man, thanks for getting back to me!! I appreciate your feedback. I made a start on a POC today and I'm feeling a little more confident about building it. But yes, I've already come across some weird stuff, like if a GPS coordinate is on the other side of the road from the way you are going it does really strange stuff! Anyway, I'll have a crack at getting something going over the next few weeks and post the results somewhere.
@hutch120 I am following up on your post "I've got a client who needs turn-by-turn audible instructions and next turn visual instruction highlighted (based on current GPS coordinates). Has anyone done that? I was thinking of using the "Web Speech API"... We have done this with the web speech api, but need to present the next turn visually on the screen. Did you implement this functionality?