Пример #1
0
 protected void OnUrlChosen(UrlChosenEventArgs args)
 {
     if (UrlChosen != null)
     {
         UrlChosen(this, args);
     }
 }
        private void addGeoRssLayer(UrlChosenEventArgs e)
        {
            if (e.Url == null)
                return;
            Uri targetUri = null;
            if (!Uri.TryCreate(e.Url, UriKind.Absolute, out targetUri))
            {
                return;
            }
            if (View.Instance != null)
            {

                CustomGeoRssLayer geoRssLayer = new CustomGeoRssLayer()
                {
                    Source = targetUri,
                    ID = Guid.NewGuid().ToString("N"),
                };
                Core.LayerExtensions.SetDisplayUrl(geoRssLayer, e.Url);                
                geoRssLayer.SetValue(ESRI.ArcGIS.Client.Extensibility.MapApplication.LayerNameProperty, targetUri.Host);
                geoRssLayer.MapSpatialReference = View.Instance.Map.SpatialReference;
                geoRssLayer.UpdateCompleted +=new EventHandler(applyAutomaticClustering);
                View.Instance.Map.Layers.Add(geoRssLayer); 
            }
            MapApplication.Current.HideWindow(enterUrlDialog);
            OnUrlChosen(e);
        }
Пример #3
0
        private void addGeoRssLayer(UrlChosenEventArgs e)
        {
            if (e.Url == null)
            {
                return;
            }
            Uri targetUri = null;

            if (!Uri.TryCreate(e.Url, UriKind.Absolute, out targetUri))
            {
                return;
            }
            if (View.Instance != null)
            {
                CustomGeoRssLayer geoRssLayer = new CustomGeoRssLayer()
                {
                    Source = targetUri,
                    ID     = Guid.NewGuid().ToString("N"),
                };
                Core.LayerExtensions.SetDisplayUrl(geoRssLayer, e.Url);
                geoRssLayer.SetValue(ESRI.ArcGIS.Client.Extensibility.MapApplication.LayerNameProperty, targetUri.Host);
                geoRssLayer.MapSpatialReference = View.Instance.Map.SpatialReference;
                geoRssLayer.UpdateCompleted    += new EventHandler(applyAutomaticClustering);
                View.Instance.Map.Layers.Add(geoRssLayer);
            }
            MapApplication.Current.HideWindow(enterUrlDialog);
            OnUrlChosen(e);
        }
 protected void OnUrlChosen(UrlChosenEventArgs args)
 {
     if (UrlChosen != null)
         UrlChosen(this, args);
 }