<?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>idea Improvements to time support for WMSLayers in ArcGIS JavaScript Maps SDK Ideas</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idi-p/1046838</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;Version 4.17 introduced &lt;EM&gt;Time support for WMSLayers&lt;/EM&gt;&amp;nbsp; which is very welcomed. There are, however, a few quirks, at least for our use case.&lt;/P&gt;&lt;P&gt;Our application utilizes multiple meteorological layers from multiple WMS-servers. The layers have different TimeDimensions (both start/end and intervals) and user is able to mix and match these as he deems fit. The user is also thereafter able to replay the data via a TimeSlider, and view the Time dimensions for the different layers.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Peek 2021-04-14 14-42.gif" style="width: 891px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10819i400BEF90EB009F6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Peek 2021-04-14 14-42.gif" alt="Peek 2021-04-14 14-42.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The above is what we are trying to replicate in ArcGIS. It shows the data from 4 layers from three different servers. The layers all have different start/end times (visualized by the colored bars) and different intervals (the number inside the parentheses and the vertical lines across the colored bars)&lt;/P&gt;&lt;P&gt;The ArcGIS WMSLayer docs state that "The timeInfo property is automatically set at layer initialization if the layer has one or more time dimensions." This is true to some extent, no pun intended, however, there's room for improvement.&lt;/P&gt;&lt;P&gt;WMSLayer.timeInfo.fullTimeExtent{start|end} seem to currently be set to the min/max values of ALL the layers available on the provided WMS server, regardless of the fact that only a few layers are selected in WMSLayer.sublayers. This becomes problematic for WMS servers with hundreds of layers available of which one only wants to use a few (whose time dimensions are subsets of the servers min/max).&lt;/P&gt;&lt;P&gt;Furthermore WMSLayer.timeInfo.interval doesn't seem to be set at all, even though the information is present in getCapabilities.&lt;/P&gt;&lt;P&gt;Here's a &lt;A href="https://codepen.io/Kiachma/pen/QWdGRvz" target="_self"&gt;code-pen&lt;/A&gt; describing my problems with the API.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Emil Aura&lt;/P&gt;</description>
    <pubDate>Wed, 14 Apr 2021 11:46:21 GMT</pubDate>
    <dc:creator>snlasystem</dc:creator>
    <dc:date>2021-04-14T11:46:21Z</dc:date>
    <item>
      <title>Improvements to time support for WMSLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idi-p/1046838</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;Version 4.17 introduced &lt;EM&gt;Time support for WMSLayers&lt;/EM&gt;&amp;nbsp; which is very welcomed. There are, however, a few quirks, at least for our use case.&lt;/P&gt;&lt;P&gt;Our application utilizes multiple meteorological layers from multiple WMS-servers. The layers have different TimeDimensions (both start/end and intervals) and user is able to mix and match these as he deems fit. The user is also thereafter able to replay the data via a TimeSlider, and view the Time dimensions for the different layers.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Peek 2021-04-14 14-42.gif" style="width: 891px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/10819i400BEF90EB009F6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Peek 2021-04-14 14-42.gif" alt="Peek 2021-04-14 14-42.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The above is what we are trying to replicate in ArcGIS. It shows the data from 4 layers from three different servers. The layers all have different start/end times (visualized by the colored bars) and different intervals (the number inside the parentheses and the vertical lines across the colored bars)&lt;/P&gt;&lt;P&gt;The ArcGIS WMSLayer docs state that "The timeInfo property is automatically set at layer initialization if the layer has one or more time dimensions." This is true to some extent, no pun intended, however, there's room for improvement.&lt;/P&gt;&lt;P&gt;WMSLayer.timeInfo.fullTimeExtent{start|end} seem to currently be set to the min/max values of ALL the layers available on the provided WMS server, regardless of the fact that only a few layers are selected in WMSLayer.sublayers. This becomes problematic for WMS servers with hundreds of layers available of which one only wants to use a few (whose time dimensions are subsets of the servers min/max).&lt;/P&gt;&lt;P&gt;Furthermore WMSLayer.timeInfo.interval doesn't seem to be set at all, even though the information is present in getCapabilities.&lt;/P&gt;&lt;P&gt;Here's a &lt;A href="https://codepen.io/Kiachma/pen/QWdGRvz" target="_self"&gt;code-pen&lt;/A&gt; describing my problems with the API.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Emil Aura&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 11:46:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idi-p/1046838</guid>
      <dc:creator>snlasystem</dc:creator>
      <dc:date>2021-04-14T11:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Improvements to time support for WMSLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1050343#M43</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/472824"&gt;@snlasystem&lt;/a&gt;&amp;nbsp;- thank you so much for your feedback! We plan to work on some improvements in the 4.20 release that will allow you to access the individual dimensions on the WMSLayer. I will keep you updated on this effort. Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 20:32:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1050343#M43</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2021-04-22T20:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Improvements to time support for WMSLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1114788#M82</link>
      <description>&lt;P&gt;Hi Anne,&lt;/P&gt;&lt;P&gt;Is it possible to make this work?&amp;nbsp;&lt;A href="https://pavics.ouranos.ca/twitcher/ows/proxy/thredds/wms/birdhouse/cccs_portal/indices/Final/ANUSPLIN_v1/tn_max/YS/nrcan_canada_1950-2013_tn_max_YS.nc?SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=tn_max&amp;amp;WIDTH=1119&amp;amp;HEIGHT=586&amp;amp;CRS=EPSG:3857&amp;amp;BBOX=-20037508.342788905,5315560.336420793,1847273.8962958835,16782337.571646746&amp;amp;Timeextent=1950-01-01T00:00:00.000Z/2013-01-01T00:00:00.000Z" target="_blank" rel="noopener"&gt;https://pavics.ouranos.ca/twitcher/ows/proxy/thredds/wms/birdhouse/cccs_portal/indices/Final/ANUSPLIN_v1/tn_max/YS/nrcan_canada_1950-2013_tn_max_YS.nc?SERVICE=WMS&amp;amp;REQUEST=GetMap&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;STYLES=&amp;amp;VERSION=1.3.0&amp;amp;LAYERS=tn_max&amp;amp;WIDTH=1119&amp;amp;HEIGHT=586&amp;amp;CRS=EPSG:3857&amp;amp;BBOX=-20037508.342788905,5315560.336420793,1847273.8962958835,16782337.571646746&amp;amp;Timeextent=1950-01-01T00:00:00.000Z/2013-01-01T00:00:00.000Z&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I cannot use Javascript to load this to a simple web app. However, I am able to get this from ipyleaflet easily:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IpyLeafLet.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26957i4A82EF294C32E2C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="IpyLeafLet.PNG" alt="IpyLeafLet.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The WMS layer can be added to a web map from enterprise Portal too. Are there any tricks in order to make it work using the latest JavaScript API?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the &lt;A href="https://codepen.io/sherryanee/pen/WNEKpRd" target="_self"&gt;code pen&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 19:54:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1114788#M82</guid>
      <dc:creator>JYI</dc:creator>
      <dc:date>2021-11-10T19:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Improvements to time support for WMSLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1115699#M83</link>
      <description>&lt;P&gt;At 4.20 we added support for `dimensions` - allowing users to access the time dimensions for their WMSLayer. Here's the documentation:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#dimensions" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#dimensions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And here's a codepen example:&amp;nbsp;&lt;A href="https://codepen.io/annefitz/pen/gOmEZjz?editors=1000" target="_blank"&gt;https://codepen.io/annefitz/pen/gOmEZjz?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 16:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1115699#M83</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2021-11-10T16:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Improvements to time support for WMSLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1116027#M85</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115266"&gt;@AnneFitz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just for displaying the WMS layer, This one works:&amp;nbsp;&lt;A href="https://codepen.io/sherryanee/pen/mdMjgME" target="_self"&gt;Leaflet code pen&lt;/A&gt;&lt;/P&gt;&lt;P&gt;ArcGIS JavaScript API one does not work: &lt;A href="https://codepen.io/sherryanee/pen/WNEKpRd" target="_self"&gt;ArcGIS JS codepen&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 15:01:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1116027#M85</guid>
      <dc:creator>JYI</dc:creator>
      <dc:date>2021-11-11T15:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Improvements to time support for WMSLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1120197#M87</link>
      <description>&lt;P&gt;Finally, I got this work, using ArcGIS JavaScript API 4.21. Just to share the experience, here is the picture:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WMSlayer.PNG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/28244i98D0983148C9B261/image-size/large?v=v2&amp;amp;px=999" role="button" title="WMSlayer.PNG" alt="WMSlayer.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;the code (put the code under your web server, say, C:\inetpub\wwwroot\wms)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta
      name="viewport"
      content="initial-scale=1,maximum-scale=1,user-scalable=no"
    /&amp;gt;
    &amp;lt;title&amp;gt;TimeSlider widget | Sample | ArcGIS API for JavaScript 4.21&amp;lt;/title&amp;gt;
    &amp;lt;link
      rel="stylesheet"
      href="https://js.arcgis.com/4.21/esri/themes/light/main.css"
    /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.21/"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;style&amp;gt;
      html,
      body,
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
      }

      #timeSlider {
        position: absolute;
        left: 5%;
        right: 5%;
        bottom: 20px;
      }
    &amp;lt;/style&amp;gt;
    &amp;lt;script&amp;gt;
      require([
        "esri/Map",
        "esri/views/MapView",
        "esri/layers/WMSLayer",
        "esri/widgets/TimeSlider",		
		"esri/core/urlUtils"
      ], function (Map, MapView, WMSLayer, TimeSlider, urlUtils) {        
          urlUtils.addProxyRule({
			urlPrefix: "https://pavics.ouranos.ca",
			proxyUrl: "../proxy/proxy.ashx"
		  });				
          const map = new Map({
			basemap: "hybrid"
		  });
          const view = new MapView({
            map,
            container: "viewDiv"
          });
          const layer = new WMSLayer({
            url: "https://pavics.ouranos.ca/twitcher/ows/proxy/thredds/wms/birdhouse/cccs_portal/indices/Final/ANUSPLIN_v1/rx1day/YS/nrcan_canada_1950-2013_rx1day_YS.nc"
          });
          layer.load().then(function(lyr){
			  const precipitation = layer.allSublayers.find((l) =&amp;gt; l.name === "rx1day");					  
			  layer.sublayers = [precipitation];
			  map.add(layer);
			  
			  const { dimensions } = precipitation;
			  const timeDimension = dimensions.find((d) =&amp;gt; d.name === "time");
			  const dates = timeDimension.extent;
			  const start = dates[1];
			  const end = dates[63];			  			 			  
			  const timeSlider = new TimeSlider({
				container: "timeSlider",
				view,
				mode: "instant",
				timeVisible: true,
				loop: true,
				fullTimeExtent: {
				  start,
				  end
				},
				stops: {
				  interval: {
					value: 1,
					unit: "years"
				  }
				}
			 });			  
          });		  
      });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div id="timeSlider"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tricks are the following:&lt;/P&gt;&lt;P&gt;1. Add &lt;A href="https://github.com/Esri/resource-proxy" target="_self"&gt;proxy&lt;/A&gt;: copy the contents inside the DotNet folder to your web server, say, C:\inetpub\wwwroot\proxy. This is required as the WMS layer server does not support CORS.&lt;/P&gt;&lt;P&gt;2. Make changes to the proxy.ashx file: In the&amp;nbsp;copyRequestHeaders method, add&amp;nbsp;&lt;STRONG&gt;case "origin":&lt;/STRONG&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="proxy.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/28247i0B57DD2F6C96AAFB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="proxy.PNG" alt="proxy.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I.e., make sure "the proxy does not send the Origin". This is the key. Thanks to&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115266"&gt;@AnneFitz&lt;/a&gt;&amp;nbsp;for it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 02:00:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1120197#M87</guid>
      <dc:creator>JYI</dc:creator>
      <dc:date>2021-11-25T02:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Improvements to time support for WMSLayers - Status changed to: Implemented</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1208362#M167</link>
      <description>&lt;P&gt;This was implemented at version 4.20 (July 2021)&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 18:30:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-ideas/improvements-to-time-support-for-wmslayers/idc-p/1208362#M167</guid>
      <dc:creator>BjornSvensson</dc:creator>
      <dc:date>2022-08-31T18:30:58Z</dc:date>
    </item>
  </channel>
</rss>

