Select to view content in your preferred language

Routing with Barriers - from Silverlight Samples (not working in the application)

1343
2
06-09-2011 05:45 AM
srikanthpilli
Emerging Contributor
Could you please help me on putting your suggestions as what to do.

I created a new project and I copied the code that is present in the Arc GIS API for Silverlight Samples.

The code that i copied from the samples are "Legend with Templates" & "Routing with Barriers" - here, when I copied the code and replaced the map service in Mainpage.xaml with another rest service --- legend with templates is working perfect, but for the "Route with Barriers"  i am able to add the stop point and barriers - but its not building the path.

Could you please tell me what changes should i do for working it properly. I am also attaching the code files for your reference.

Thanks for viewing the thread.
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
As your map is not using geographical coordinates, you must set the outspatialreference of the routing task:
if (_stops.Count > 1)
{
 _routeParams.OutSpatialReference = MyMap.SpatialReference;
 if (_routeTask.IsBusy)
   _routeTask.CancelAsync();
 _routeTask.SolveAsync(_routeParams);
}
0 Kudos
by Anonymous User
Not applicable
Original User: spill002

Thanks a lot for taking someof your precious time from your schedule and helping me.
0 Kudos