private IGlobeGraphicsElementProperties GetElementProperties()
        {
            IGlobeGraphicsElementProperties elementProperties = new GlobeGraphicsElementPropertiesClass();
            elementProperties.Rasterize = true;

            return elementProperties;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建图元
        /// </summary>
        /// <param name="kml">图元的kml</param>
        /// <param name="layer">图元所在的图层</param>
        /// <returns></returns>
        public IMFElement CreateElement(Kml kml, ILayer layer)
        {
            KmlPolygon polygonKml = kml.Placemark.Graph as KmlPolygon;

            if (polygonKml == null)
            {
                return(null);
            }
            if (polygonKml.PositionList == null)
            {
                return(null);
            }

            int index = -1;
            Polygon_ArcGlobe polygonElement = null;

            this.Dosomething((Action) delegate()
            {
                //图层
                IGlobeGraphicsLayer graphicsLayer = layer as IGlobeGraphicsLayer;
                //实例化图元
                polygonElement = new Polygon_ArcGlobe(graphicsLayer, polygonKml);

                //设置属性
                GlobeGraphicsElementPropertiesClass properties = new GlobeGraphicsElementPropertiesClass();
                properties.Rasterize = polygonKml.Rasterize;
                graphicsLayer.AddElement(polygonElement, properties, out index);
                polygonElement.Index       = index;                                 //指定索引
                polygonElement.ElementName = kml.Placemark.Name;
            }, true);

            return(polygonElement);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 创建图元
        /// </summary>
        /// <param name="kml"></param>
        /// <param name="layer"></param>
        /// <returns></returns>
        public IMFElement CreateElement(Kml kml, ILayer layer)
        {
            KmlPoint pointKml = kml.Placemark.Graph as KmlPoint;

            if (pointKml.Position == null)
            {
                return(null);
            }

            int index = -1;

            //图层
            IGlobeGraphicsLayer graphicsLayer = layer as IGlobeGraphicsLayer;

            //图元
            Point_ArcGlobe pointElement = new Point_ArcGlobe(graphicsLayer, pointKml);

            this.Dosomething((Action) delegate()
            {
                IGlobeGraphicsElementProperties properties = new GlobeGraphicsElementPropertiesClass();
                properties.Rasterize = pointKml.Rasterize;                  //栅格化
                graphicsLayer.AddElement(pointElement, properties, out index);

                pointElement.Index       = index;                           //指定索引
                pointElement.ElementName = kml.Placemark.Name;
            }, true);

            return(pointElement);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 添加图元
        /// </summary>
        /// <param name="kml"></param>
        /// <param name="layer"></param>
        /// <returns></returns>
        public IMFElement CreateElement(Kml kml, ILayer layer)
        {
            KmlCircle circleKml = kml.Placemark.Graph as KmlCircle;

            if (circleKml.Position == null)
            {
                return(null);
            }

            int             index         = -1;
            Circle_ArcGlobe circleElement = null;

            this.Dosomething((Action) delegate()
            {
                //图元
                IGlobeGraphicsLayer graphicsLayer = layer as IGlobeGraphicsLayer;

                circleElement = new Circle_ArcGlobe(graphicsLayer, circleKml);
                IGlobeGraphicsElementProperties properties = new GlobeGraphicsElementPropertiesClass();
                properties.Rasterize = circleKml.Rasterize;
                graphicsLayer.AddElement(circleElement, properties, out index);
                circleElement.Index       = index;
                circleElement.ElementName = kml.Placemark.Name;
            }, true);

            return(circleElement);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 创建图元
        /// </summary>
        /// <param name="kml"></param>
        /// <param name="layer"></param>
        /// <returns></returns>
        public IMFElement CreateElement(Kml kml, ILayer layer)
        {
            KmlText textKml = kml.Placemark.Graph as KmlText;

            if (textKml == null)
            {
                return(null);
            }
            if (textKml.Position == null)
            {
                return(null);
            }

            int index = -1;

            //图层
            IGlobeGraphicsLayer graphicsLayer = layer as IGlobeGraphicsLayer;

            MapFrame.ArcGlobe.Element.Text_ArcGlobe textElement = null;
            this.Dosomething((Action) delegate()
            {
                //图元
                textElement = new MapFrame.ArcGlobe.Element.Text_ArcGlobe(graphicsLayer, textKml);
                GlobeGraphicsElementPropertiesClass properties = new GlobeGraphicsElementPropertiesClass();
                properties.Rasterize = textKml.Rasterize;
                graphicsLayer.AddElement(textElement, properties, out index);
                textElement.Index       = index; //指定索引
                textElement.ElementName = kml.Placemark.Name;
            }, true);

            return(textElement);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 设置图层栅格化
        /// </summary>
        /// <param name="layerName">图层名称</param>
        /// <param name="bRasterize">是否栅格化</param>
        public void SetRasterize(string layerName, bool bRasterize)
        {
            if (!layerDic.ContainsKey(layerName))
            {
                return;
            }

            ILayer pLayer = layerDic[layerName];

            Dosomething((Action) delegate()
            {
                IScene m_scene = globeControl.Globe as IScene;                                      // 提供数据给成员控制场景
                m_scene.ActiveGraphicsLayer = pLayer;                                               // 活动的图层,如果没有则创建一个
                IGlobeGraphicsLayer pGL     = pLayer as IGlobeGraphicsLayer;                        //提供数据给地图图形图层

                IGlobeDisplay m_globeDisplay           = globeControl.Globe.GlobeDisplay;           // 提供数据给成员操作地图显示
                IGlobeDisplayLayers pGlobeLayer        = m_globeDisplay as IGlobeDisplayLayers;     // 提供数据给成员操作地图显示图层
                IGlobeLayerProperties pGlobeLayerProps = pGlobeLayer.FindGlobeProperties(pLayer);   // 提供数据给成员操纵图层属性,返回图层的属性
                IGlobeGraphicsElementProperties pGEP   = new GlobeGraphicsElementPropertiesClass(); // 图层的其他属性
                pGEP.DrapeElement = true;
                pGEP.DrapeZOffset = 10;
                pGEP.Rasterize    = bRasterize;                  //是否栅格化
                pGlobeLayerProps.ApplyDisplayProperties(pLayer); //应用属性到此图层
            }, true);
        }
Ejemplo n.º 7
0
        private IGlobeGraphicsElementProperties GetElementProperties()
        {
            IGlobeGraphicsElementProperties elementProperties = new GlobeGraphicsElementPropertiesClass();

            elementProperties.Rasterize = true;

            return(elementProperties);
        }
        private IGlobeGraphicsElementProperties GetElementProperties()
        {
            IGlobeGraphicsElementProperties elementProperties = new GlobeGraphicsElementPropertiesClass();
            elementProperties.DrapeElement = true;
            elementProperties.Illuminate = true;

            return elementProperties;
        }
Ejemplo n.º 9
0
        private IGlobeGraphicsElementProperties GetElementProperties()
        {
            IGlobeGraphicsElementProperties elementProperties = new GlobeGraphicsElementPropertiesClass();

            elementProperties.DrapeElement = true;
            elementProperties.Illuminate   = true;

            return(elementProperties);
        }
Ejemplo n.º 10
0
        private IGlobeGraphicsElementProperties GetElementProperties()
        {
            IGlobeGraphicsElementProperties elementProperties = new GlobeGraphicsElementPropertiesClass();

            elementProperties.FixedScreenSize = true;
            elementProperties.DrapeElement    = true;

            return(elementProperties);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 创建图元
        /// </summary>
        /// <param name="kml">模型的kml</param>
        /// <param name="layer">模型所在的图层</param>
        /// <returns></returns>
        public IMFElement CreateElement(Kml kml, ILayer layer)
        {
            KmlModel3d modelkml = kml.Placemark.Graph as KmlModel3d;

            if (modelkml == null)
            {
                return(null);
            }
            if (modelkml.Position == null)
            {
                return(null);
            }
            if (!File.Exists(modelkml.ModelFilePath))
            {
                return(null);
            }
            int index = -1;

            //图层
            IGlobeGraphicsLayer graphicLayer = layer as IGlobeGraphicsLayer;

            if (graphicLayer == null)
            {
                return(null);
            }

            //实例化图元
            Model3d_ArcGlobe modelElement = null;

            //添加图元
            this.Dosomething((Action) delegate()
            {
                IImport3DFile import3Dfile = null;
                if (!filePathDic.ContainsKey(modelkml.ModelFilePath))
                {
                    import3Dfile = new Import3DFileClass();
                    import3Dfile.CreateFromFile(modelkml.ModelFilePath);
                    filePathDic.Add(modelkml.ModelFilePath, import3Dfile);
                }
                else//模型已创建
                {
                    import3Dfile = filePathDic[modelkml.ModelFilePath];
                }

                modelElement = new Model3d_ArcGlobe(graphicLayer, modelkml, import3Dfile);

                //设置属性
                GlobeGraphicsElementPropertiesClass properties = new GlobeGraphicsElementPropertiesClass();
                properties.Rasterize = modelkml.Rasterize;

                graphicLayer.AddElement(modelElement, properties, out index);
                modelElement.Index       = index;
                modelElement.ElementName = kml.Placemark.Name;
            }, true);

            return(modelElement);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 创建线图元
        /// </summary>
        /// <param name="kml">线的kml</param>
        /// <param name="layer">图元所在的图层</param>
        /// <returns></returns>
        public IMFElement CreateElement(Kml kml, ILayer layer)
        {
            KmlLineString lineKml = kml.Placemark.Graph as KmlLineString;

            if (lineKml.PositionList == null || lineKml.PositionList.Count < 1)
            {
                return(null);
            }

            int index = -1;
            //图层
            IGlobeGraphicsLayer graphicLayer = layer as IGlobeGraphicsLayer;

            if (graphicLayer == null)
            {
                return(null);
            }

            //图元
            Line_ArcGlobe lineElement = null;

            Dosomething((Action) delegate()
            {
                //属性
                GlobeGraphicsElementPropertiesClass properties = new GlobeGraphicsElementPropertiesClass();
                properties.Rasterize = lineKml.Rasterize;

                //添加图元
                lineElement = new Line_ArcGlobe(graphicLayer, lineKml);
                graphicLayer.AddElement(lineElement, properties, out index);
                lineElement.Index       = index;                                //指定索引
                lineElement.ElementName = kml.Placemark.Name;
            }, true);

            return(lineElement);
        }
        private IGlobeGraphicsElementProperties GetElementProperties()
        {
            IGlobeGraphicsElementProperties elementProperties = new GlobeGraphicsElementPropertiesClass();
            elementProperties.FixedScreenSize = true;
            elementProperties.DrapeElement = true;

            return elementProperties;
        }