I'm using JS 3.28 and the Directions dijit and a custom route service. All is well with 10.6.1 (and earlier!), but the same service fails when published to 10.7.
It is failing in Directions.js at _getCostAttribute()
_getCostAttribute: function(a) {
for (var b = this.serviceDescription && this.serviceDescription.networkDataset.networkAttributes || [], c, d = 0; d < b.length; d++)
if (b.name === a && "esriNAUTCost" === b.usageType) {
c = b;
break
}
return c
},
b is a collection of networkattributes ('OneWay, Length, Time') and 'a' is the impedanceAttributeName. The impedance on the published service is "Time", but in the code 'a' is always "TravelTime", so in the loop above 'c=b' is never hit and this function always returns null.
This are also other places in Directions.js with lines like, which seems odd:
|| this.serviceDescription && 10.6 <= this.serviceDescription.currentVersion;
Anyway, the route stops are plotted, but the route is never returned because it always fails with the error:
TypeError: Cannot read property 'units' of undefined
Is this broken for 10.7? or do I need to do something different?
Thanks