I'm developing an application with WAB and the JS 3.22 API to calculate routes over a multimodal networks dataset.
When I add barriers I find that several lines of network 1 of the network dataset (subway for example) has the same geometry that several lines in network 2 (bus for example). And when I add barriers in the coordinates of the lines with the same geometry, the barrier applies to both networks (subway and bus), and I need that the barrieres applies only to one network.
I am adding the barriers in this way:
var polylineJson = {
"paths":[[[x1, y1], [x2, y2]
]],
"spatialReference":{"wkid":this.config.spatialReference}
};
var polyline = new Polyline(polylineJson);
var myGraphic = new Graphic(polyline, null);
myGraphic.setAttributes(…);
routeParams.polylineBarriers.features.push(myGraphic);
But I do not know how to indicate that the barrier affects only the network that I want.
I don`t know if I have to change my JS code or the Network Dataset
Does this problem have a solution?
Thanks, greetings.
Alberto,
Do both networks (subways and bus) use the same routeTask URL?
Yes.
Thanks.
I am not aware of a way to apply barriers to a specific subset of the Geometry network.