<?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 Re: timeout for Map#addLayers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/timeout-for-map-addlayers/m-p/365737#M33915</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply Manish.&amp;nbsp; I don't think though that your suggestion will address my problem.&amp;nbsp; I'm already checking for the timeout on individual layer, e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
setLayerTimeouts: function() {
&amp;nbsp;&amp;nbsp; //setup timeouts for each layer to load
&amp;nbsp;&amp;nbsp; this.layerTimeouts = {};
&amp;nbsp;&amp;nbsp; dojo.forEach(this.mapServices, function(svc) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.layerTimeouts[svc.id] = setTimeout(dojo.partial(this.layerTimeoutHandler, svc), 5000);
&amp;nbsp;&amp;nbsp; }, this);
},

layerTimeoutHandler: function(mapservice) {
&amp;nbsp;&amp;nbsp; logger.warn("failed to load layer "+mapservice.id);
&amp;nbsp;&amp;nbsp; mapservice.suspend();
},
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My issue is that if I wish to take advantage of the DeferredList and not have to track the status of the collection myself, I'm subject to the 60 second timeout before the onLayersAddResult event fires.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--john&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:00:01 GMT</pubDate>
    <dc:creator>JohnCartwright</dc:creator>
    <dc:date>2021-12-11T17:00:01Z</dc:date>
    <item>
      <title>timeout for Map#addLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/timeout-for-map-addlayers/m-p/365735#M33913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm looking for a way to set the timeout for the addLayers method on esri.Map, similar to the way in which one sets a timeout on esriRequest.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I add a list of mapservices to a Map, and one of them is unresponsive, I have to wait for 60 seconds before the layers-add-result event fires.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone please help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--john&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 21:19:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/timeout-for-map-addlayers/m-p/365735#M33913</guid>
      <dc:creator>JohnCartwright</dc:creator>
      <dc:date>2013-10-08T21:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: timeout for Map#addLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/timeout-for-map-addlayers/m-p/365736#M33914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello All,&lt;BR /&gt;&lt;BR /&gt;I'm looking for a way to set the timeout for the addLayers method on esri.Map, similar to the way in which one sets a timeout on esriRequest.&lt;BR /&gt;&lt;BR /&gt;When I add a list of mapservices to a Map, and one of them is unresponsive, I have to wait for 60 seconds before the layers-add-result event fires.&lt;BR /&gt;&lt;BR /&gt;Can someone please help?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;--john&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can try the below function change the values as required. you can use a conditional check such as while you add layer to map provide a Id to it. and check map.getLayer(Id). if this is not undefined then add another else you can set the timeout.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Add the layers, after pausing briefly &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;setTimeout(function()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("pausing a few seconds");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayers(mapLayers); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;},1000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 02:04:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/timeout-for-map-addlayers/m-p/365736#M33914</guid>
      <dc:creator>ManishkumarPatel</dc:creator>
      <dc:date>2013-10-09T02:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: timeout for Map#addLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/timeout-for-map-addlayers/m-p/365737#M33915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply Manish.&amp;nbsp; I don't think though that your suggestion will address my problem.&amp;nbsp; I'm already checking for the timeout on individual layer, e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
setLayerTimeouts: function() {
&amp;nbsp;&amp;nbsp; //setup timeouts for each layer to load
&amp;nbsp;&amp;nbsp; this.layerTimeouts = {};
&amp;nbsp;&amp;nbsp; dojo.forEach(this.mapServices, function(svc) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.layerTimeouts[svc.id] = setTimeout(dojo.partial(this.layerTimeoutHandler, svc), 5000);
&amp;nbsp;&amp;nbsp; }, this);
},

layerTimeoutHandler: function(mapservice) {
&amp;nbsp;&amp;nbsp; logger.warn("failed to load layer "+mapservice.id);
&amp;nbsp;&amp;nbsp; mapservice.suspend();
},
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My issue is that if I wish to take advantage of the DeferredList and not have to track the status of the collection myself, I'm subject to the 60 second timeout before the onLayersAddResult event fires.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--john&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:00:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/timeout-for-map-addlayers/m-p/365737#M33915</guid>
      <dc:creator>JohnCartwright</dc:creator>
      <dc:date>2021-12-11T17:00:01Z</dc:date>
    </item>
  </channel>
</rss>

