Esempio n. 1
0
        private void Demo_Load(object sender, EventArgs e)
        {
            this.polygonLayer = map.AddLayer(shpRName) as DotSpatial.Controls.MapPolygonLayer;
            this.map.ZoomToMaxExtent();
            this.map.SizeChanged += map_SizeChanged;
            // this.map.MouseClick += map_MouseClick;
            if (polygonLayer != null)
            {
            }
            map.ActivateMapFunction(new DotSpatial.Controls.MapFunctionZoom(map));
            map.ActivateMapFunction(new DotSpatial.Controls.MapFunctionSelect(map));
            map.MouseMove += map_MouseMove;

            this.pointLayer = map.AddLayer(shpPName) as DotSpatial.Controls.MapPointLayer;
            if (this.pointLayer == null)
            {
                throw new Exception("加载点数据失败");
            }
            this.lineLayer = map.AddLayer(shpLName) as DotSpatial.Controls.MapLineLayer;
            if (this.lineLayer == null)
            {
                throw new Exception("加载线数据失败");
            }
            this.lineLayer.SelectionChanged    += lineLayer_SelectionChanged;
            this.pointLayer.SelectionChanged   += pointLayer_SelectionChanged;
            this.polygonLayer.SelectionChanged += polygonLayer_SelectionChanged;
            this.OutputLog("加载成功");
        }