示例#1
0
文件: frmMap.cs 项目: yifeidong/gvms
        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;
            }
        }
示例#2
0
文件: CarSearch.cs 项目: uwitec/gvms
        public DataTable SearchByCarLocation(Point centerPoint, double searchRaduis)
        {
            DataTable dtResult = new RealtimeMonite.TrackingDataTableStruct();
            Point oCarLocation = new PointClass();
            MapUtil.MapOperation oMapOper = new GPSTrackingMonitor.MapUtil.MapOperation();

            foreach (DataRow dr in this._realtimeCarInfos.Rows)
            {
                oCarLocation.X = Convert.ToDouble(dr["x"]);
                oCarLocation.Y = Convert.ToDouble(dr["y"]);

                if (oMapOper.ComputeDistance(centerPoint, oCarLocation) <= searchRaduis)
                    dtResult.Rows.Add(dr.ItemArray);
            }

            return dtResult;
        }
示例#3
0
        public DataTable SearchByCarLocation(Point centerPoint, double searchRaduis)
        {
            DataTable dtResult     = new RealtimeMonite.TrackingDataTableStruct();
            Point     oCarLocation = new PointClass();

            MapUtil.MapOperation oMapOper = new GPSTrackingMonitor.MapUtil.MapOperation();

            foreach (DataRow dr in this._realtimeCarInfos.Rows)
            {
                oCarLocation.X = Convert.ToDouble(dr["x"]);
                oCarLocation.Y = Convert.ToDouble(dr["y"]);

                if (oMapOper.ComputeDistance(centerPoint, oCarLocation) <= searchRaduis)
                {
                    dtResult.Rows.Add(dr.ItemArray);
                }
            }

            return(dtResult);
        }
示例#4
0
文件: frmMap.cs 项目: uwitec/gvms
        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;
            }
        }