Ejemplo n.º 1
0
 /// <summary>
 /// 加载地图控件。
 /// </summary>
 /// <param name="mapControl">需要操作的地图控件</param>
 public virtual void OnLoad(MapControl mapControl)
 {
     Map = mapControl;
     Map.MouseClick += new System.Windows.Forms.MouseEventHandler(Map_MouseClick);
     Map.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(Map_MouseDoubleClick);
     Map.MouseDown += new System.Windows.Forms.MouseEventHandler(Map_MouseDown);
     Map.MouseEnter += new EventHandler(Map_MouseEnter);
     Map.MouseLeave += new EventHandler(Map_MouseLeave);
     Map.MouseMove += new System.Windows.Forms.MouseEventHandler(Map_MouseMove);
     Map.MouseUp += new System.Windows.Forms.MouseEventHandler(Map_MouseUp);
     Map.MouseWheel += new System.Windows.Forms.MouseEventHandler(Map_MouseWheel);
     Map.KeyDown += new System.Windows.Forms.KeyEventHandler(Map_KeyDown);
     Map.KeyUp += new System.Windows.Forms.KeyEventHandler(Map_KeyUp);
 }
Ejemplo n.º 2
0
        public SQLForm(string mapUrl, string mapName, MapControl mapControl)
        {
            InitializeComponent();
            this._mapName = mapName;
            this._mapUrl = mapUrl;

            _map = new Map(_mapUrl);
            defaultMapParameter = _map.GetDefaultMapParameter(mapName);
            _mapControl = mapControl;
            publicResultForm = new PublicResultForm();
            publicResultForm.Name = "QueryBySql";
            publicResultForm.Text = "SQL查询结果";
            publicResultForm.MapControl = mapControl;
            InitializeSQL();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 加载对应的地图控件。
 /// </summary>
 /// <param name="mapControl">需要加载的地图控件。</param>
 public override void OnLoad(MapControl mapControl)
 {
     base.OnLoad(mapControl);
     ActionDescription = "拖动地图";
 }
Ejemplo n.º 4
0
        public override void OnLoad(MapControl mapControl)
        {
            base.OnLoad(mapControl);
            this.ActionDescription = "矩形圈选删除";
            if (_layer == null)
            {
                _layer = new GraphicsLayer(Guid.NewGuid().ToString(), "DelByRectActionLayer");

            }
            this.ServiceUrl = ((MapLayer)mapControl.MapLayer).ServiceUrl;
            this._mapName = ((MapLayer)mapControl.MapLayer).MapName;
            if (!mapControl.GraphicsLayers.Contains(_layer, new LayerComparer()))
            {
                mapControl.GraphicsLayers.Add(_layer);
            }
            if (_rect == null)
            {
                _rect = new Polygon(Guid.NewGuid().ToString(), new List<Point2D>(), Draw.Color.FromArgb(100, 0, 0, 255), Draw.Color.FromArgb(255, 0, 0, 255), 1);
            }
        }
Ejemplo n.º 5
0
        public override void OnLoad(MapControl mapControl)
        {
            base.OnLoad(mapControl);
            this.ActionDescription = "点选删除";
            if (_layer == null)
            {
                _layer = new GraphicsLayer(Guid.NewGuid().ToString(), "DelByPointActionLayer");

            }
            this.ServiceUrl = ((MapLayer)mapControl.MapLayer).ServiceUrl;
            this._mapName = ((MapLayer)mapControl.MapLayer).MapName;
            if (!mapControl.GraphicsLayers.Contains(_layer, new LayerComparer()))
            {
                mapControl.GraphicsLayers.Add(_layer);
            }
        }
Ejemplo n.º 6
0
        public override void OnLoad(MapControl mapControl)
        {
            base.OnLoad(mapControl);
            this.ActionDescription = "画多边形";
            if (_layer == null)
            {
                _layer = new GraphicsLayer(Guid.NewGuid().ToString(), "QueryByPolygonActionLayer");

            }
            this.ServiceUrl = ((MapLayer)mapControl.MapLayer).ServiceUrl;
            this._mapName = ((MapLayer)mapControl.MapLayer).MapName;
            if (!mapControl.GraphicsLayers.Contains(_layer, new LayerComparer()))
            {
                mapControl.GraphicsLayers.Add(_layer);
            }
            if (_polygon == null)
            {
                _polygon = new Polygon(Guid.NewGuid().ToString(), new List<Point2D>(), Draw.Color.FromArgb(100, 0, 0, 255), Draw.Color.FromArgb(255, 0, 0, 255), 1);
            }
            if (_points == null)
            {
                _points = new List<Point2D>();
            }
            _resultForm.MapControl = mapControl;
        }
Ejemplo n.º 7
0
        public override void OnLoad(MapControl mapControl)
        {
            base.OnLoad(mapControl);
            this.ActionDescription = "距离量算";
            if (_layer == null)
            {
                _layer = new GraphicsLayer(Guid.NewGuid().ToString(), "MeasureDistanceActionLayer");

            }
            this.ServiceUrl = ((MapLayer)mapControl.MapLayer).ServiceUrl;
            this._mapName = ((MapLayer)mapControl.MapLayer).MapName;
            if (!mapControl.GraphicsLayers.Contains(_layer, new LayerComparer()))
            {
                mapControl.GraphicsLayers.Add(_layer);
            }
            if (_line == null)
            {
                _line = new Line(Guid.NewGuid().ToString(), new List<Point2D>(), 1, Draw.Color.FromArgb(255, 0, 0, 255));
            }
            if (_points == null)
            {
                _points = new List<Point2D>();
            }
        }