Ejemplo n.º 1
0
        private void mapControl_MouseDownEvent(object sender, AxMapObjects2._DMapEvents_MouseDownEvent e)
        {
            MapObjects2.Point oMousePosition = mapControl.ToMapPoint(e.x, e.y);
            MapUtil.MapOperation oMapOper = new GPSTrackingMonitor.MapUtil.MapOperation();

            switch (GlobeVariables.CurrentOperation)
            {
                case GPSTrackingMonitor.MapUtil.MapOperationType.ZoomIn:
                    oMapOper.ZoomInMap(mapControl.TrackRectangle(),ref mapControl);
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.ZoomOut:
                    oMapOper.ZoomOutMap(mapControl.TrackRectangle(), ref mapControl);
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.Pan:
                    mapControl.Pan();
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.Measure:
                    this._measureLine = mapControl.TrackLine();
                    this.labMeasure.Text = string.Format("长度 : {0} 米", oMapOper.ComputeDistance(this._measureLine).ToString());
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.Identify:                  
                    MapUtil.FeatureInformations oFeatureInfos = oMapOper.GetIdentifyFeatureInfos(oMousePosition, this.mapControl,GlobeVariables.MapInfosCollection);
                    this._frmIdentify.UpdateFeatureInfos(oFeatureInfos, MousePosition);
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.FetchPoint:
                    this.OnPointFetched(oMousePosition);
                    break;
                default:
                    break;
            }
        }
Ejemplo n.º 2
0
        private void mapControl_MouseDownEvent(object sender, AxMapObjects2._DMapEvents_MouseDownEvent e)
        {
            MapObjects2.Point oMousePosition = mapControl.ToMapPoint(e.x, e.y);
            MapUtil.MapOperation oMapOper = new GPSTrackingMonitor.MapUtil.MapOperation();

            switch (GlobeVariables.CurrentOperation)
            {
                case GPSTrackingMonitor.MapUtil.MapOperationType.ZoomIn:
                    oMapOper.ZoomInMap(mapControl.TrackRectangle(),ref mapControl);
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.ZoomOut:
                    oMapOper.ZoomOutMap(mapControl.TrackRectangle(), ref mapControl);
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.Pan:
                    mapControl.Pan();
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.Measure:
                    this._measureLine = mapControl.TrackLine();
                    this.labMeasure.Text = string.Format("���� �� {0} ��", oMapOper.ComputeDistance(this._measureLine).ToString());
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.Identify:
                    MapUtil.FeatureInformations oFeatureInfos = oMapOper.GetIdentifyFeatureInfos(oMousePosition, this.mapControl,GlobeVariables.MapInfosCollection);
                    this._frmIdentify.UpdateFeatureInfos(oFeatureInfos, MousePosition);
                    break;
                case GPSTrackingMonitor.MapUtil.MapOperationType.FetchPoint:
                    this.OnPointFetched(oMousePosition);
                    break;
                default:
                    break;
            }
        }