<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Layer onLoad event, how to handle an error in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125014#M11627</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So to load a layer is straight forward as taken from the "JavaScript API Concepts" page. Sniplet below...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function init() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var layer = new esri.layers.ArcGISDynamicMapServiceLayer(...);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dojo.connect(layer, "onLoad", printInitialExtent);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do you catch an event if the layer never gets loaded? Maybe the service is down. If the layer does not get loaded I want to inform the user (rather than a blank map).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Nov 2010 18:40:41 GMT</pubDate>
    <dc:creator>mikewebster</dc:creator>
    <dc:date>2010-11-03T18:40:41Z</dc:date>
    <item>
      <title>Layer onLoad event, how to handle an error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125014#M11627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So to load a layer is straight forward as taken from the "JavaScript API Concepts" page. Sniplet below...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function init() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var layer = new esri.layers.ArcGISDynamicMapServiceLayer(...);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dojo.connect(layer, "onLoad", printInitialExtent);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do you catch an event if the layer never gets loaded? Maybe the service is down. If the layer does not get loaded I want to inform the user (rather than a blank map).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 18:40:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125014#M11627</guid>
      <dc:creator>mikewebster</dc:creator>
      <dc:date>2010-11-03T18:40:41Z</dc:date>
    </item>
    <item>
      <title>Check Layer error through xmlHttpObject ?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125015#M11628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would be interrested in a solution to that problem as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My first approach was, checking the url seperately by an independent request through a xmlHttpObject. But I couldn't get it running from my jsp till now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone a solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 12:07:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125015#M11628</guid>
      <dc:creator>MarcelKleinmann</dc:creator>
      <dc:date>2010-11-04T12:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Layer onLoad event, how to handle an error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125016#M11629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I use the following...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;dojo.connect(layer, "onError", errorHandling);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...with errorHandling a function that tells the user the GIS isn't available.&amp;nbsp; I do a redirect to a standard GIS unavailable page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this is what you are looking for...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 13:52:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125016#M11629</guid>
      <dc:creator>StewartMcCall</dc:creator>
      <dc:date>2010-11-04T13:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Layer onLoad event, how to handle an error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125017#M11630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, that is what I expected. That is the first thing I tried and my onError event for that layer never gets called. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function init() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var layer = new esri.layers.ArcGISDynamicMapServiceLayer(...);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dojo.connect(layer, "onError", errorHandling);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dojo.connect(layer, "onLoad", loadHandling);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will try it again in a simple app and see if I can get it working.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 15:32:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125017#M11630</guid>
      <dc:creator>mikewebster</dc:creator>
      <dc:date>2010-11-04T15:32:23Z</dc:date>
    </item>
    <item>
      <title>Thanks</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125018#M11631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This dojo.connect(layer, "onError", errorHandling); does it for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 16:01:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125018#M11631</guid>
      <dc:creator>MarcelKleinmann</dc:creator>
      <dc:date>2010-11-04T16:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Layer onLoad event, how to handle an error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125019#M11632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yes it was this simple. i had a elementary mistake in my code. now the onError event works as expected. thanks for confirming the event works as expected.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 19:54:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125019#M11632</guid>
      <dc:creator>mikewebster</dc:creator>
      <dc:date>2010-11-04T19:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Layer onLoad event, how to handle an error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125020#M11633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So to load a layer is straight forward as taken from the "JavaScript API Concepts" page. Sniplet below...&lt;BR /&gt;&lt;BR /&gt;function init() {&lt;BR /&gt;&amp;nbsp; var layer = new esri.layers.ArcGISDynamicMapServiceLayer(...);&lt;BR /&gt;&amp;nbsp; dojo.connect(layer, "onLoad", printInitialExtent);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;How do you catch an event if the layer never gets loaded? Maybe the service is down. If the layer does not get loaded I want to inform the user (rather than a blank map).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;function init() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var layer = new esri.layers.ArcGISDynamicMapServiceLayer(...);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dojo.connect(layer, "onLoad", printInitialExtent);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dojo.connect(layer, "onError", function(error){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert ("There is a problem on loading the layer!");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Dec 2010 18:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-onload-event-how-to-handle-an-error/m-p/125020#M11633</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2010-12-17T18:33:09Z</dc:date>
    </item>
  </channel>
</rss>

