The Weather Underground widget sample fails to update accurately after saving and re-opening the view.
上次发布: April 8, 2019ArcGIS Runtime SDK for WPF
漏洞 ID 编号
BUG-000082614
已提交
October 15, 2014
上次修改时间
August 1, 2025
适用范围
ArcGIS Runtime SDK for WPF
找到的版本
10.2.3
修正版本
Q1 2015
状态
Fixed
此漏洞已得到修复。 有关详细信息,请参阅“版本修复”和“其他信息”(如果适用)。
解决办法
The issue is specific to the call to webClient.DownloadStringAsync.Block the user interface (UI) thread and get the values synchronously, and the value is updated properly.Also, rewrite the UpdateWeather method to use the async await pattern, and the value is updated properly.For example:private async void UpdateWeather(){if (NoDeveloperKey) return;// Find the new center of the extent of the map in lat, long.client.Geometry.MapPoint centerPoint = _map.Extent.GetCenter();client.Geometry.MapPoint geographicPoint = Transform.WebMercatorToGeographic(centerPoint);// Get a new weather observation.WebClient webClient = new WebClient();//webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted);string x = await webClient.DownloadStringTaskAsync(new Uri(String.Format("{0}{1},{2}.json", _weatherServiceUrl, geographicPoint.Y, geographicPoint.X)));JavaScriptSerializer serializer = new JavaScriptSerializer();Response response = serializer.Deserialize<Response>(x);this.observation = response.current_observation;this.satelliteImage = response.satellite;}