Esempio n. 1
0
        } // public string getFieldAlias(string fieldname)

        /// <summary>
        /// create Layer according to its Type
        /// </summary>
        /// <param name="id"></param>
        /// <param name="vis"></param>
        /// <returns></returns>
        private Layer createLayer(string id, bool vis)
        {
            string typ = lyrType;

            ESRI.ArcGIS.Client.Layer res = null;

            if (typ == "ArcGISTiledMapServiceLayer")
            {
                var lr = new ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer();
                lr.Url      = lyrUrl;
                lr.ProxyURL = proxy;
                res         = lr;
            }
            else if (typ == "OpenStreetMapLayer")
            {
                var lr = new ESRI.ArcGIS.Client.Toolkit.DataSources.OpenStreetMapLayer();
                res = lr;
            }
            else if (typ == "ArcGISDynamicMapServiceLayer")
            {
                var lr = new ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer();
                lr.Url      = lyrUrl;
                lr.ProxyURL = proxy;
                res         = lr;
            }
            else if (typ == "FeatureLayer")
            {
                var lr = new ESRI.ArcGIS.Client.FeatureLayer();
                lr.Url      = lyrUrl;
                lr.ProxyUrl = proxy;
                res         = lr;
            }
            else if (typ == "GraphicsLayer")
            {
                var gl = setContent(id, lyrUrl);
                res = gl;
            }

            if (res != null)
            {
                ESRI.ArcGIS.Client.Extensibility.LayerProperties.SetIsPopupEnabled(res, popupOn);

                // sublayers popups on/off
                if (identifyLayerIds.Length <= 3)
                {
                    ;
                }
                else
                {
                    var xmlszn = new System.Xml.Serialization.XmlSerializer(typeof(System.Collections.ObjectModel.Collection <int>));
                    var sr     = new StringReader(identifyLayerIds);
                    var ids    = xmlszn.Deserialize(sr) as System.Collections.ObjectModel.Collection <int>;
                    ESRI.ArcGIS.Mapping.Core.LayerExtensions.SetIdentifyLayerIds(res, ids);
                }
            }

            return(res);
        } // private Layer createLayer(string id, bool vis)
Esempio n. 2
0
 public void addArcGisTiledService(string url, string layerID, double opacity, string ProxyUrl)
 {
     try
     {
         if (layerID == "")
         {
             layerID = Guid.NewGuid().ToString();
         }
         ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer lyr = new ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer();
         lyr.Url      = url;
         lyr.ID       = layerID;
         lyr.Opacity  = opacity;
         lyr.Visible  = true;
         lyr.ProxyURL = ProxyUrl;
         _map.Layers.Insert(0, lyr);
         //_map.Layers.Add(lyr);
     }
     catch (Exception ex)
     {
         DebugConsole.debug("MapHelper: " + ex.ToString());
     }
 }
Esempio n. 3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ControlsBasicsWindow = ((KinectEsriV2.MainWindow)(target));

            #line 12 "..\..\MainWindow.xaml"
                this.ControlsBasicsWindow.Loaded += new System.Windows.RoutedEventHandler(this.ControlsBasicsWindow_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.kinectRegion = ((Microsoft.Kinect.Wpf.Controls.KinectRegion)(target));
                return;

            case 3:

            #line 15 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Grid_Loaded);

            #line default
            #line hidden
                return;

            case 4:
                this.MyMap = ((ESRI.ArcGIS.Client.Map)(target));
                return;

            case 5:
                this.LayerNight = ((ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer)(target));
                return;

            case 6:
                this.StreetLayer = ((ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer)(target));
                return;

            case 7:
                this.textBox3 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 8:
                this.textBox1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 9:
                this.textBox2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 10:
                this.textBox4 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.scrollViewer = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 12:
                this.ColorImage = ((System.Windows.Controls.Image)(target));
                return;
            }
            this._contentLoaded = true;
        }
Esempio n. 4
0
        }         // public void initRelations()

        private Layer createLayer(string id, bool vis)
        {
            // create Layer according to its Type
            string typ = lyrType;

            ESRI.ArcGIS.Client.Layer res = new ESRI.ArcGIS.Client.GraphicsLayer();

            if (typ == "ArcGISTiledMapServiceLayer")
            {
                var lr = new ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer();
                lr.Url      = lyrUrl;
                lr.ProxyURL = proxy;
                res         = lr;
            }
            else if (typ == "OpenStreetMapLayer")
            {
                var lr = new ESRI.ArcGIS.Client.Toolkit.DataSources.OpenStreetMapLayer();
                res = lr;
            }
            else if (typ == "ArcGISDynamicMapServiceLayer")
            {
                var lr = new ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer();
                lr.Url         = lyrUrl;
                lr.ProxyURL    = proxy;
                lr.ImageFormat = imageFormat;
                res            = lr;
            }
            else if (typ == "FeatureLayer")
            {
                var lr = new ESRI.ArcGIS.Client.FeatureLayer()
                {
                    Url = lyrUrl, ProxyUrl = proxy
                };
                lr.OutFields.Add("*");
                lr.Mode = FeatureLayer.QueryMode.OnDemand;
                lr.Initialize();                 // retrieve attribs from server
                var rr = rendererFromJson(renderer);
                if (rr != null)
                {
                    lr.Renderer = rr;
                }
                res = lr;
            }
            else if (typ == "GraphicsLayer")
            {
                var gl = setContent(id, lyrUrl);
                var rr = rendererFromJson(renderer);
                if (rr != null)
                {
                    gl.Renderer = rr;
                }
                res = gl;
            }

            if (res != null)
            {
                ESRI.ArcGIS.Client.Extensibility.LayerProperties.SetIsPopupEnabled(res, popupOn);

                // sublayers popups on/off
                if (identifyLayerIds.Length <= 3)
                {
                    ;
                }
                else
                {
                    var xmlszn = new System.Xml.Serialization.XmlSerializer(typeof(System.Collections.ObjectModel.Collection <int>));
                    var sr     = new StringReader(identifyLayerIds);
                    var ids    = xmlszn.Deserialize(sr) as System.Collections.ObjectModel.Collection <int>;
                    ESRI.ArcGIS.Mapping.Core.LayerExtensions.SetIdentifyLayerIds(res, ids);
                }
            }

            return(res);
        }         // private Layer createLayer(string id, bool vis)