Exemplo 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 MapUtil.MapOperation();

            switch (GlobeVariables.CurrentOperation)
            {
            case MapUtil.MapOperationType.ZoomIn:
                oMapOper.ZoomInMap(mapControl.TrackRectangle(), ref mapControl);
                break;

            case MapUtil.MapOperationType.ZoomOut:
                oMapOper.ZoomOutMap(mapControl.TrackRectangle(), ref mapControl);
                break;

            case MapUtil.MapOperationType.Pan:
                mapControl.Pan();
                break;

            case MapUtil.MapOperationType.Measure:
                this._measureLine    = mapControl.TrackLine();
                this.labMeasure.Text = string.Format("长度 : {0} 米", oMapOper.ComputeDistance(this._measureLine).ToString());
                break;

            case MapUtil.MapOperationType.Identify:
                MapUtil.FeatureInformations oFeatureInfos = oMapOper.GetIdentifyFeatureInfos(oMousePosition, this.mapControl, GlobeVariables.MapInfosCollection);
                this._frmIdentify.UpdateFeatureInfos(oFeatureInfos, MousePosition);
                break;

            case MapUtil.MapOperationType.FetchPoint:
                this.OnPointFetched(oMousePosition);
                break;

            default:
                break;
            }
        }
Exemplo 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 MapUtil.MapOperation();

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