mapbox-gl-directions icon indicating copy to clipboard operation
mapbox-gl-directions copied to clipboard

.setOrigin() and .setDestination() only works when you set both

Open patricktargun opened this issue 8 years ago • 3 comments

.setOrigin() and .setDestination() only works when you set both.

Example of it working: https://jsfiddle.net/0u0zfku4/

Doesn't plot when only setting one location: Commented out setOrigin on line 67 https://jsfiddle.net/0u0zfku4/1/

patricktargun avatar Feb 16 '17 23:02 patricktargun

Thanks for reporting your issue @Targun and for providing a minimal test case. Can you update to the most recent version (3.1.1) to ensure this is still an issue? Thanks!

mollymerp avatar Mar 06 '17 03:03 mollymerp

Thanks for the follow up @mollymerp

I updated the fiddle with v3.1.1, and still seeing the same problem: https://jsfiddle.net/0u0zfku4/2/

Hope this helps. No rush for a fix on my end

patricktargun avatar Mar 07 '17 01:03 patricktargun

If map.addControl(mapDirections, 'top-left'); is moved outside the callback function it works:

https://jsfiddle.net/0u0zfku4/28/

auswahl_260

pathmapper avatar Apr 29 '18 06:04 pathmapper