<?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 show message if map service unavailable in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/show-message-if-map-service-unavailable/m-p/240285#M22295</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems like this should be fairly straight forward but I haven't found a great solution yet. I would like to show my users a message, and possibly alter the way our interface looks, if and when there is a problem with one of our map services. In my application I have a basemap (ArcGISTiledMapServiceLayer), a dynamic layer (ArcGISDynamicMapServiceLayer) and a couple feature layers (FeatureLayer). For the basemap and dynamic layer, I am just doing a straightforward constructor and then map.addLayer to add them to the map. For the feature layers, I am doing a constructor, applying a setDefinitionExpression and then using map.addLayer to add to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If any of the services are down I want to be able to tell the user, at minimum with an alert or message. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought I could use onLayerAddResult(layer, error) but it doesn't seem to be getting called if the layer based on a stopped/bad service is added to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see similar examples using esri.request but it doesn't seem like I should have to do an extra call to the service since in the console I see these types of calls to each service:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;http: //myserver/ArcGIS/rest/services/Streets/Mask/MapServer?f=json&amp;amp;dpi=96&amp;amp;transparent=true&amp;amp;format=png8&amp;amp;layers=show%3A-1&amp;amp;callback=dojo.io.script.jsonp_dojoIoScript2._jsonpCallback&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With a response of either:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;dojo.io.script.jsonp_dojoIoScript2._jsonpCallback({"serviceDescription" : null,"mapName":"Layers","description":"","copyrightText":"","layers":[{"id":0,"name":"LMBCO_Mask","parentLayerId":-1,"defaultVisibility":true,"subLayerIds":null}],"tables":[],"spatialReference":{"wkid":2263},"singleFusedMapCache":false,"initialExtent":{"xmin":806353.163236593,"ymin":139639.306949227,"xmax":1165380.94101437,"ymax":327833.751393672,"spatialReference":{"wkid":2263}},"fullExtent":{"xmin":824755.941014371,"ymin":38597.6402825604,"xmax":1146978.16323659,"ymax":323319.862504783,"spatialReference":{"wkid":2263}},"units":"esriFeet","supportedImageFormatTypes":"PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP","documentInfo":{"Title":"","Author":"","Comments":"","Subject":"","Category":"","Keywords":"","AntialiasingMode":"Normal","TextAntialiasingMode":"Force"},"capabilities":"Map,Query,Data"});&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if the service is up and running, or:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;dojo.io.script.jsonp_dojoIoScript2._jsonpCallback({"error":{"code":400,"message":"Unable to complete&amp;nbsp; operation.","details":["Service 'NYCStreets/LMBCO_Mask' of type 'MapServer' does not exist or is inaccessible."]}});&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if the service is not available.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to handle this reponse that comes back?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chad Wilcomb&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 May 2012 19:26:27 GMT</pubDate>
    <dc:creator>ChadWilcomb</dc:creator>
    <dc:date>2012-05-08T19:26:27Z</dc:date>
    <item>
      <title>show message if map service unavailable</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/show-message-if-map-service-unavailable/m-p/240285#M22295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems like this should be fairly straight forward but I haven't found a great solution yet. I would like to show my users a message, and possibly alter the way our interface looks, if and when there is a problem with one of our map services. In my application I have a basemap (ArcGISTiledMapServiceLayer), a dynamic layer (ArcGISDynamicMapServiceLayer) and a couple feature layers (FeatureLayer). For the basemap and dynamic layer, I am just doing a straightforward constructor and then map.addLayer to add them to the map. For the feature layers, I am doing a constructor, applying a setDefinitionExpression and then using map.addLayer to add to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If any of the services are down I want to be able to tell the user, at minimum with an alert or message. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought I could use onLayerAddResult(layer, error) but it doesn't seem to be getting called if the layer based on a stopped/bad service is added to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see similar examples using esri.request but it doesn't seem like I should have to do an extra call to the service since in the console I see these types of calls to each service:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;http: //myserver/ArcGIS/rest/services/Streets/Mask/MapServer?f=json&amp;amp;dpi=96&amp;amp;transparent=true&amp;amp;format=png8&amp;amp;layers=show%3A-1&amp;amp;callback=dojo.io.script.jsonp_dojoIoScript2._jsonpCallback&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With a response of either:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;dojo.io.script.jsonp_dojoIoScript2._jsonpCallback({"serviceDescription" : null,"mapName":"Layers","description":"","copyrightText":"","layers":[{"id":0,"name":"LMBCO_Mask","parentLayerId":-1,"defaultVisibility":true,"subLayerIds":null}],"tables":[],"spatialReference":{"wkid":2263},"singleFusedMapCache":false,"initialExtent":{"xmin":806353.163236593,"ymin":139639.306949227,"xmax":1165380.94101437,"ymax":327833.751393672,"spatialReference":{"wkid":2263}},"fullExtent":{"xmin":824755.941014371,"ymin":38597.6402825604,"xmax":1146978.16323659,"ymax":323319.862504783,"spatialReference":{"wkid":2263}},"units":"esriFeet","supportedImageFormatTypes":"PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP","documentInfo":{"Title":"","Author":"","Comments":"","Subject":"","Category":"","Keywords":"","AntialiasingMode":"Normal","TextAntialiasingMode":"Force"},"capabilities":"Map,Query,Data"});&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if the service is up and running, or:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;dojo.io.script.jsonp_dojoIoScript2._jsonpCallback({"error":{"code":400,"message":"Unable to complete&amp;nbsp; operation.","details":["Service 'NYCStreets/LMBCO_Mask' of type 'MapServer' does not exist or is inaccessible."]}});&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if the service is not available.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to handle this reponse that comes back?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chad Wilcomb&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 19:26:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/show-message-if-map-service-unavailable/m-p/240285#M22295</guid>
      <dc:creator>ChadWilcomb</dc:creator>
      <dc:date>2012-05-08T19:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: show message if map service unavailable</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/show-message-if-map-service-unavailable/m-p/240286#M22296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I see similar examples using esri.request but it doesn't seem like I should have to do an extra call to the service&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FWIW, I'd suggest that esri.request is a good approach to take here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2012 04:12:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/show-message-if-map-service-unavailable/m-p/240286#M22296</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2012-05-09T04:12:41Z</dc:date>
    </item>
  </channel>
</rss>

