Service area demo not working in UK

1431
1
10-29-2013 03:57 AM
SzymonPiskula
New Contributor
Hi,

I've been trying to user service area demo (http://developers.arcgis.com/en/javascript/samples/routetask_basic_servicearea/) in area of UK. Every time i click on map withing UK or anywhere else outside of US i get an error in the console:"dojo.io.script error
Error: Unable to complete operation."

When examinig the error object in the debugger i can see in the details of the error:"Location \"Location 1\" in \"Facilities\" is unlocated.  0 location(s) in \"Facilities\" are valid.  Need at least 1 valid location(s).  Insufficient number of valid locations in \"Facilities\"."

Seems like geocoding issue ?, but not sure how to fix it to make the demo work for UK? I got the same error for Austalia,SA Germany and few others.

Thanks,
Szymon
0 Kudos
1 Reply
JanelYang
New Contributor III
It's because the data behind the network analysis service that this sample uses (http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Service Area) only covers the US and Canada. This service does not have the road network data for the UK.

You can either use the ArcGIS World Network Analysis Service, which covers 145 countries including the UK, OR set up your own network analysis service with UK road data.

If you already have an ArcGIS.com subscription, just replace the URL in line 49 in the service area demo with the URL to the service area task on the world network analysis server:
serviceAreaTask = new esri.tasks.ServiceAreaTask("https://route.arcgis.com/arcgis/rest/services/World/ServiceAreas/NAServer/ServiceArea_World");

It would prompt a log-in box to ask for your ArcGIS.com account credentials when executing the service area task.
0 Kudos