Select to view content in your preferred language

map.addLayers hangs and onLayersAddResult event does not fire reliably

614
1
11-12-2012 06:08 AM
BradBarnell
Regular Contributor
If the map service URL is spelled wrong, then map.addLayers hangs and the onLayersAddResult event does not fire.  It works fine if only the map service name part of the URL is spelled wrong, but if the path to it is wrong it hangs.  Also, if any part of the first map service URL (bottom most map service) is spelled wrong, it hangs.  Not sure if it makes a difference, but I'm using jQuery with the ESRI API.

Hangs:
http://server.BADPATH.arcgisonline.com/ArcGIS/rest/services/World_Street_Map
http://server.arcgisonline.com/ArcGIS/rest/services/BadName_World_Street_Map (if bottom most map service)

Works:
http://server.arcgisonline.com/ArcGIS/rest/services/BadName_World_Street_Map (if NOT bottom most map service)
0 Kudos
1 Reply
JohnGravois
Deactivated User
hi brad,

it seems appropriate to me that if the application has trouble loading the layer (because the URL is not declared correctly), that the layer won't be added successfully and the onLayersAddResult event isn't going to be triggered.  the reason for the hang is because your web browser is attempting to access a resource which it temporarily can't decide exists.

what would be the reason for supplying a bad path?
0 Kudos