Beispiel #1
0
        private void button28_Click(object sender, EventArgs e)
        {
            GeoGridLayer layer = new GeoGridLayer();

            _canvas.LayerContainer.Layers.Add(layer);
            _canvas.Refresh(enumRefreshType.All);
        }
        private void AddGeoGrid(ICanvas c)
        {
            GeoGridLayer lyr = new GeoGridLayer();

            lyr.GridSpan     = 5;
            lyr.GridColor    = _gridColor;//Color.Gray;
            lyr.LatLabelStep = 2;
            lyr.LonLabelStep = 2;
            c.LayerContainer.Layers.Add(lyr);
            _geoGridLayer = lyr;
        }
Beispiel #3
0
        private void AddGeoGrid(ICanvas c)
        {
            GeoGridLayer lyr = new GeoGridLayer();

            lyr.GridSpan     = 10;         //经纬网间隔5
            lyr.GridColor    = _gridColor; //网格颜色
            lyr.LatLabelStep = 5;          //纬度步长2
            lyr.LonLabelStep = 5;          //经度步长2
            _geoGridLayer    = lyr;
            c.LayerContainer.Layers.Add(_geoGridLayer);
        }
Beispiel #4
0
 public void Free()
 {
     if (_maskLayer != null)
     {
         _maskLayer.Dispose();
         _maskLayer = null;
     }
     if (_toolLayer != null)
     {
         _toolLayer.Dispose();
         _toolLayer = null;
     }
     if (_geoGridLayer != null)
     {
         _geoGridLayer.Dispose();
         _geoGridLayer = null;
     }
 }
Beispiel #5
0
 void UCGbalFirRevise_Disposed(object sender, EventArgs e)
 {
     if (_vectorMapHostLayer != null)
     {
         (_vectorMapHostLayer as VectorHostLayer).Dispose();
         _vectorMapHostLayer = null;
     }
     if (_geoGridLayer != null)
     {
         _geoGridLayer.Dispose();
         _geoGridLayer = null;
     }
     if (this.canvasHost1 != null)
     {
         this.canvasHost1.Canvas.Dispose();
         this.canvasHost1.Dispose();
     }
 }
 void UCSimpleMapControl_Disposed(object sender, EventArgs e)
 {
     if (_objHosts != null && _objHosts.Count != 0)
     {
         foreach (string key in _objHosts.Keys)
         {
             ISimpleVectorObjectHost host = _objHosts[key];
             if (host != null)
             {
                 host.Dispose();
             }
         }
         _objHosts.Clear();
     }
     if (_aoiContainer != null)
     {
         (_aoiContainer as AOIContainerLayer).Dispose();
         _aoiContainer = null;
     }
     if (_vectorHostLayer != null)
     {
         (_vectorHostLayer as VectorHostLayer).Dispose();
         _vectorHostLayer = null;
     }
     if (_geoGridLayer != null)
     {
         _geoGridLayer.Dispose();
         _geoGridLayer = null;
     }
     if (canvasHost1 != null)
     {
         canvasHost1.Canvas.Dispose();
         canvasHost1.Dispose();
         //canvasHost1 = null;
     }
 }
Beispiel #7
0
        /// <summary>
        /// 添加经纬网格
        /// </summary>
        /// <param name="argument">经纬网格间隔:"1"</param>
        public override void Execute(string argument)
        {
            ICanvas     canvas = null;
            ILayoutHost host   = null;

            if (_smartSession.SmartWindowManager.ActiveViewer is ICanvasViewer)
            {
                canvas = GetCanvasByCanvasViewer();
            }
            else if (_smartSession.SmartWindowManager.ActiveViewer is ILayoutViewer)
            {
                canvas = GetCanvasByLayoutDataFrame(out host);
            }
            if (canvas == null)
            {
                return;
            }
            //无坐标的图片
            if (canvas.IsRasterCoord)
            {
                return;
            }
            //判断是否已经有经纬网格层的存在
            double intervel = 1f;
            bool   ok       = double.TryParse(argument, out intervel);

            if (!ok)
            {
                return;
            }
            List <ILayer> layers    = canvas.LayerContainer.Layers;
            GeoGridLayer  gridLayer = null;

            foreach (ILayer layer in layers)
            {
                if (layer is GeoGridLayer)
                {
                    gridLayer = (layer as GeoGridLayer);
                }
                else
                {
                    continue;
                }
            }
            //如果没有经纬网格的存在则新建经纬网格,并添加
            if (gridLayer == null)
            {
                gridLayer          = new GeoGridLayer();
                gridLayer.GridSpan = intervel;
                canvas.LayerContainer.Layers.Add(gridLayer);
            }
            //如果已经有经纬网格的存在则修改经纬网格的属性即可
            else
            {
                gridLayer.GridSpan = intervel;
            }
            canvas.Refresh(enumRefreshType.All);
            if (host != null)
            {
                //专题图中默认网格颜色为蓝色
                gridLayer.GridColor = Color.Blue;
                //刷新专题图
                host.Render(true);
            }
            //
            TryRefreshLayerManager();
        }