Пример #1
0
        void wc_DownloadStringCompleted(object sender, System.Net.DownloadStringCompletedEventArgs e)
        {
            if (e.Error != null) return;
            Newtonsoft.Json.Linq.JObject jObject = Newtonsoft.Json.Linq.JObject.Parse(e.Result);
            foreach (var r in jObject["results"])
            {
                if ((string)r["type"] == "WMS")
                {
                    StoredLayer sl = new StoredLayer();
                    sl.Type = "wms";
                    sl.Path = this.Path;
                    sl.Id = (string) r["url"];
                    sl.Title = (string) r["title"];

                    //wl.Layers = new string[] { "inspireadressen" };
                    //AppState.ViewDef.Layers.ChildLayers.Add(wl);
                    //wl.Initialize();
                    Result.Add(sl);


                }
                
                if ((string)r["type"]=="Feature Service")
                {
                    StoredLayer sl = new StoredLayer();
                    sl.Type = "Feature Service";
                    sl.Path = this.Path;
                    sl.Id = (string)r["url"];
                    sl.Title = (string)r["title"];

                    //wl.Layers = new string[] { "inspireadressen" };
                    //AppState.ViewDef.Layers.ChildLayers.Add(wl);
                    //wl.Initialize();
                    Result.Add(sl);
                }

                if ((string)r["type"] == "Map Service")
                {
                    StoredLayer sl = new StoredLayer();
                    sl.Type = "Map Service";
                    sl.Path = this.Path;
                    sl.Id = (string)r["url"];
                    sl.Title = (string)r["title"];

                    //wl.Layers = new string[] { "inspireadressen" };
                    //AppState.ViewDef.Layers.ChildLayers.Add(wl);
                    //wl.Initialize();
                    //Result.Add(sl);
                }

                //if ((string)r["type"] == "Feature Service")
                //{
                //    FeatureLayer fl = new FeatureLayer() { };
                //    fl.FeatureSymbol = new SimpleMarkerSymbol() { Style = SimpleMarkerSymbol.SimpleMarkerStyle.Circle, Color = Brushes.Green, Size = 30 };
                //    fl.Url = (string)r["item"];
                //    fl.Initialized += (s, es) =>
                //    {

                //    };
                //    AppState.ViewDef.Layers.ChildLayers.Add(fl);
                //    fl.Initialize();
                //}

                //if ((string)r["type"] == "Map Service")
                //{

                //    ArcGISDynamicMapServiceLayer ml = new ArcGISDynamicMapServiceLayer();
                //    ml.Url = (string)r["item"];
                //    ml.ID = (string)r["title"];
                //    AppState.ViewDef.Layers.ChildLayers.Add(ml);
                //    ml.Initialize();


                //}
            }

        }
Пример #2
0
 public static void SetStored(UIElement element, StoredLayer value)
 {
     element.SetValue(StoredProperty, value);
 }