<?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 How to get startTime for each layer in a time enabled service in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-starttime-for-each-layer-in-a-time/m-p/556651#M51925</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to see if it is possible to get the startTime for each layer in a time enabled service.&amp;nbsp; What I am doing is very similar to the Sample &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/time_slider_layerDef.html"&gt;Time Slider with Dynamic map Service&lt;/A&gt;&lt;SPAN&gt;, but with one minor addition.&amp;nbsp; Where the sample sets a hardcoded startTime, I want to get it from a specific layer in the service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have added the following code to the sample as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;var timeExtent = new esri.TimeExtent();&lt;BR /&gt; timeExtent.startTime = results[2].layer.timeInfo.timeExtent.startTime;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The "results" array is passed into the function initSlider(results).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code works but it always gets the startTime of the first array item of results and not the item that I am asking for (ex. results[2]).&amp;nbsp; I am not a JavaScript expert at all, so I was wondering if someone knows of a way to get at a particular array item of results?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Charlie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Nov 2012 19:42:44 GMT</pubDate>
    <dc:creator>DougCollins</dc:creator>
    <dc:date>2012-11-27T19:42:44Z</dc:date>
    <item>
      <title>How to get startTime for each layer in a time enabled service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-starttime-for-each-layer-in-a-time/m-p/556651#M51925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to see if it is possible to get the startTime for each layer in a time enabled service.&amp;nbsp; What I am doing is very similar to the Sample &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/time_slider_layerDef.html"&gt;Time Slider with Dynamic map Service&lt;/A&gt;&lt;SPAN&gt;, but with one minor addition.&amp;nbsp; Where the sample sets a hardcoded startTime, I want to get it from a specific layer in the service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have added the following code to the sample as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;var timeExtent = new esri.TimeExtent();&lt;BR /&gt; timeExtent.startTime = results[2].layer.timeInfo.timeExtent.startTime;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The "results" array is passed into the function initSlider(results).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code works but it always gets the startTime of the first array item of results and not the item that I am asking for (ex. results[2]).&amp;nbsp; I am not a JavaScript expert at all, so I was wondering if someone knows of a way to get at a particular array item of results?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Charlie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Nov 2012 19:42:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-starttime-for-each-layer-in-a-time/m-p/556651#M51925</guid>
      <dc:creator>DougCollins</dc:creator>
      <dc:date>2012-11-27T19:42:44Z</dc:date>
    </item>
  </channel>
</rss>

