I am using WAB (Developer Edition) to create web maps. I have a custom Geocoding Service and a custom routing service for these web maps. I have the directions tool set up for these web maps and routing works without any issues. However, If I try to add a barrier nothing happens. In the Console I receive the following error:
init.js:formatted:33882 Uncaught TypeError: Cannot read property 'spatialReference' of undefined
at init.js:formatted:33882
at Object.forEach (init.js:formatted:1664)
at Object.geodesicLengths (init.js:formatted:33880)
at Object.<anonymous> (Directions.js:716)
at Object.onDrawComplete (init.js:formatted:1503)
at Object._drawEnd (Directions.js:546)
at Object._onMouseUpHandler (Directions.js:559)
at Object.<anonymous> (init.js:formatted:1503)
at Object.c [as onMouseUp] (init.js:formatted:3049)
at Object._fire (init.js:formatted:32744)
Is there a setting I am missing? My data and all my maps are in JGD 15.
I just ran in to the same error:
Uncaught TypeError: Cannot read property 'spatialReference' of undefined
The Directions widget works fine until trying to place a barrier.
Did you have any luck finding a solution to this?
Still no luck. Are you using a projection other than Web Mercator as well? I think that might be the source of the issue for me.
I am not using Web Mercator either. I have been looking around for a while and I am starting to suspect that as well.
I spoke to the guys over at the Esri Dev Conference last week and am sending more info on this error. I'll let you know the resolution if I receive one.