Do I have to remove the layer from the map, re-create the layer with the next URL, and add the layer back to the map?
Note: if you add a dojo.connect statement to the layer, the statement ceases to exist when you delete the layer; when the layer is re-created and added to the map, you also have to re-create the connect statement.
var listener = dojo.connect(layerName, "onError", removeLayer); function removeLayer() { //disconnect the listener dojo.disconnect(listener); //code to remove the layer }
my URL switch code didn't work when more than one URL was invalid.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.