Network Analysis Service will not Solve Route

931
3
Jump to solution
07-19-2014 01:24 AM
JohnPapageorgiou
New Contributor III

Hi,

I created a network analysis service of the Phoenix Metro area that works in ArcMap, the route solves.  However, when I insert the NA Service REST URL in a basic javascript api, the route will not solve.  Any ideas as to why this may be?  The data is in NAD83 Arizona State Plane Central Intl Feet.  I followed the steps here ArcGIS Help 10.1 to create the service, and used the code sample at the end to test it.  I also used the code here Find a route | ArcGIS API for JavaScript to test as well.  Attached is the code with the REST service URL I used, the map zooms to the area of interest.  The errors that appear in the javascript console in Chrome do not make sense me (I have attached them as well).  Any help is appreciated.

thanks,

John

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

John,

  The first issue I see is the URL to the route service:

routeTask = new RouteTask("http://masgis2.asu.edu:6080/arcgis/rest/services/jpapageo/Road_Network_Maricopa_Co_v4/MapServer/NAServer/Route");

should be:

routeTask = new RouteTask("http://masgis2.asu.edu:6080/arcgis/rest/services/jpapageo/Road_Network_Maricopa_Co_v4/NAServer/Route");

Robert

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

John,

  The first issue I see is the URL to the route service:

routeTask = new RouteTask("http://masgis2.asu.edu:6080/arcgis/rest/services/jpapageo/Road_Network_Maricopa_Co_v4/MapServer/NAServer/Route");

should be:

routeTask = new RouteTask("http://masgis2.asu.edu:6080/arcgis/rest/services/jpapageo/Road_Network_Maricopa_Co_v4/NAServer/Route");

Robert

JohnPapageorgiou
New Contributor III

Robert,

THANK YOU!  This has been a headache for days.  The instructions gave me the impression that all I needed to do  was copy and paste the REST URL, apparently "MapServer" needs to be eliminated and "Route" needs to be added at the end.  Hopefully that can be added to the instructions somehow, or maybe it was written somewhere and I missed it.  Either way thanks, it works now, the routes it gives are a little odd, but nevertheless it does draw one from point A to point B, better than before.

Thanks,

John

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

John,

   Glad I could help. Do you mind marking my post as the "Correct Answer"?

You can refer to this document if you need to: How to help in the GeoNet Community

Robert

0 Kudos