<?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: Refresh WMS Layer in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275550#M7190</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thats what I needed to do.&amp;nbsp; &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;Brian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jun 2010 14:58:14 GMT</pubDate>
    <dc:creator>BrianGustafson</dc:creator>
    <dc:date>2010-06-16T14:58:14Z</dc:date>
    <item>
      <title>Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275542#M7182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a timer set up so that at each tick the WMS layer(weather radar) will update.&amp;nbsp; When I use the refresh method the WMS is not updated until I pan the map.&amp;nbsp; Is there some other way to update WMS layers without needing to pan the map?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 19:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275542#M7182</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2010-06-15T19:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275543#M7183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's likely because your browser is caching the response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A trick to make it work is to add a value to the request that changes each time to trick the browser to think its a new request. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + "&amp;amp;t=" + DateTime.Now.Ticks.ToString()&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 20:06:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275543#M7183</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2010-06-15T20:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275544#M7184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am not sure where in the application to add the date time.&amp;nbsp; When I take the code and put it at the back of a url from fiddler I am getting the correct response.&amp;nbsp; Below is the code from the tick method, does it need to go in the proxy handler?&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;WMS.WMSMapServiceLayer AGSWMSLayer = MyMap.Layers["AGSWMSLayer"] as WMSMapServiceLayer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;AGSWMSLayer.url = &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi" rel="nofollow" target="_blank"&gt;http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi&lt;/A&gt;&lt;SPAN&gt;" + "&amp;amp;t=" + DateTime.Now.Ticks.ToString();&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AGSWMSLayer.Refresh();&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 20:39:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275544#M7184</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2010-06-15T20:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275545#M7185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I added the code to the proxy handler and in fiddler I can see that each request is different.&amp;nbsp; However, a request is not made until the map is moved, not when the refresh method is called.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 20:50:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275545#M7185</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2010-06-15T20:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275546#M7186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you use a System.Windows.Threading.DispatcherTimer or a System.Threading.Timer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jun 2010 03:04:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275546#M7186</guid>
      <dc:creator>DanielWalton</dc:creator>
      <dc:date>2010-06-16T03:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275547#M7187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If it's just a display issue, you can try to change the layer visiblity to false and then true.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did that in one of my code (but there is probably a better way:) )&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
featureLayer.Update();
featureLayer.Visible = false;
featureLayer.Visible = true;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:26:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275547#M7187</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T13:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275548#M7188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using a DispatchTimer.&amp;nbsp; It looks like the issue is now that when the tick method is run a call is not made to the WMS service when it refreshes, I still need to pan the map to get the new info to download.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void weatherTimer_Tick(object sender, EventArgs e)&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;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WMSMapServiceLayer AGSWMSLayer = MyMap.Layers["AGSWMSLayer"] as WMSMapServiceLayer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSWMSLayer.Refresh();&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jun 2010 12:37:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275548#M7188</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2010-06-16T12:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275549#M7189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Morten's workaround worked for me. Inside the GetUrl() method of the WMS layer class, add the following line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;mapURL.AppendFormat("&amp;amp;t={0:hhmmss}", DateTime.Now);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: One problem with this feature is that the browser will queue the WMS requests while the app window is not visible (minimized or on a hidden tab) and execute all of them when you make the app visible. You might want to add some Javascript to your host page to help you stop the refresh timer when the app is not visible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jun 2010 14:12:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275549#M7189</guid>
      <dc:creator>DanielWalton</dc:creator>
      <dc:date>2010-06-16T14:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275550#M7190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thats what I needed to do.&amp;nbsp; &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;Brian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jun 2010 14:58:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275550#M7190</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2010-06-16T14:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275551#M7191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to accomplish a similar thing (refresh WMS containing moving vehicles) and this thread seems promising. However, I am not sure where exactly should I append the row&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;mapURL.AppendFormat("&amp;amp;t={0:hhmmss}", DateTime.Now);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mentioned by Daniel Walton. Am I to edit the source code of ESRI Silverlight Toolkit and build my own version of it? Sounds scary...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, if someone should have an example of how to make Javascript and Silverlight interact to stop the timer, this too would be appreciated. I have experimented with &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;HtmlPage.Window.AttachEvent("onblur", stopAutoRefresh);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in App.xaml.cs but this seems to work for Mozilla but not IE...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samuli&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 11:30:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275551#M7191</guid>
      <dc:creator>samulineuvonen</dc:creator>
      <dc:date>2014-02-07T11:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275552#M7192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Put it in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public override void GetUrl(Envelope extent, int width, int height, DynamicMapServiceLayer.OnUrlComplete onComplete)
{
...
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri provides the source to these classes because they know folks will want to modify them. So go ahead and modify &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:26:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275552#M7192</guid>
      <dc:creator>DanielWalton</dc:creator>
      <dc:date>2021-12-11T13:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275553#M7193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, I was able to get it working. Thanks to you, Dan!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I think I was able to implement some sort of control over the queueing requests, not by Javascrit but by using the LostFocus- and GotFocus-events of the MainPage (RootVisual) and another timer checking if the focus was lost and not returned for more than 5 seconds (in which case the actual timer was stopped). We'll see how this works in production...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samuli&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2014 12:54:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275553#M7193</guid>
      <dc:creator>samulineuvonen</dc:creator>
      <dc:date>2014-02-12T12:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh WMS Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275554#M7194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One more update to this, although a bit of topic: I was able to use this same approach to implement a sort-of "TimeAware" WMS layer. I added both a property named "Autorefresh" and the code below in the GetURL-function in the WMS.cs and then created a custom TimeSlider-control, which updates the VisibleTimeExtent-property of the referenced WMS layers. Seems to work nicely, so just in case someone else is trying to solve this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;S&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if (this.Autorefresh==true)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; //autorefresh
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapURL.AppendFormat("&amp;amp;t={0:hhmmss}", DateTime.Now);
}
else if (this.VisibleTimeExtent != null)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.VisibleTimeExtent.Start == this.VisibleTimeExtent.End)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapURL.AppendFormat("&amp;amp;TIME={0:yyyy-MM-ddTHH:mm:ss.sssZ}", this.VisibleTimeExtent.Start);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapURL.AppendFormat("&amp;amp;TIME={0:yyyy-MM-ddTHH:mm:ss.sssZ}/{1:yyyy-MM-ddTHH:mm:ss.sssZ}", this.VisibleTimeExtent.Start, this.VisibleTimeExtent.End);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:26:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/refresh-wms-layer/m-p/275554#M7194</guid>
      <dc:creator>samulineuvonen</dc:creator>
      <dc:date>2021-12-11T13:26:08Z</dc:date>
    </item>
  </channel>
</rss>

