예제 #1
0
        public frmMapCar95() {
            InitializeComponent();
            barButtonItem11.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
            btFullScrean.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            barSubItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            rMap1 = new RMap();

            rMap1.MouseWheelZoomType = MouseWheelZoomType.MousePositionWithoutCenter;
            rMap1.Dock = DockStyle.Fill;
            Controls.Add(rMap1);
            mapview = rMap1;
            rMap1.Manager.Mode = GMap.NET.AccessMode.ServerOnly;
            GoogleChinaMap map = GoogleChinaMap.Instance;
            map.TryCorrectVersion = false;
            rMap1.MapProvider = map;
            //rMap1.Position = new PointLatLng(46.6, 130);
            rMap1.MaxZoom = 16;
            rMap1.MinZoom = 9;
            mapServer = ClientServer.PlatformServer.GetService<TONLI.MapCore.IMapServer>();

            objects = new GMapOverlay(rMap1, "objects");
            routes = new GMapOverlay(rMap1, "LineCode");
            
            rMap1.Overlays.Add(routes);
            rMap1.Overlays.Add(objects);

            routes.Markers.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
            
            oInstances = new OperationInstances(rMap1);
            curOperation = oInstances.LineOperation;
            curOperation.CanEditMarker = true;
            rMap1.OnMapZoomChanged += new MapZoomChanged(rMap1_OnMapZoomChanged);
            rMap1.MouseEnter += new EventHandler(rMap1_MouseEnter);
            rMap1.MouseMove += new MouseEventHandler(rMap1_MouseMove);
            rMap1.MouseMove += new MouseEventHandler(MainMap_MouseMove);
            rMap1.MouseDown += new MouseEventHandler(MainMap_MouseDown);
            rMap1.MouseUp += new MouseEventHandler(MainMap_MouseUp);
            rMap1.OnMarkerEnter += new MarkerEnter(MainMap_OnMarkerEnter);
            rMap1.OnMarkerLeave += new MarkerLeave(MainMap_OnMarkerLeave);
            rMap1.OnTileLoadStart += new TileLoadStart(MainMap_OnTileLoadStart);

            rMap1.OnTileLoadComplete += new TileLoadComplete(MainMap_OnTileLoadComplete);
            barButtonItem10.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.Check;
            barButtonItem10.AllowAllUp = true;
            barButtonItem4.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.Check;
            barButtonItem4.DownChanged += new DevExpress.XtraBars.ItemClickEventHandler(测距_DownChanged);
            barButtonItem10.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;

            //加载设备列表
            ucLayerCar = new UCLayerCar();
            ucLayerCar.Dock = DockStyle.Fill;
            dockPanel1_Container.Controls.Add(ucLayerCar);
            bxdh = new UCPJ_21gzbxdh();
            bxdh.Dock = DockStyle.Fill;
            dockPanel2_Container.Controls.Add(bxdh);
            bxdh.OnBeginLocation += new ObjectEventHandler<PJ_21gzbxdh>(OnBeginLocation);
            bxdh.OnTQLocation += new ObjectEventHandler<PJ_21gzbxdh>(bxdh_OnTQLocation);
            this.WindowState = FormWindowState.Maximized;
            btGzdj.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
        }
예제 #2
0
        public frmMapNetwork() {
            InitializeComponent();
            rMap1 = new RMap();

            rMap1.MouseWheelZoomType = MouseWheelZoomType.MousePositionWithoutCenter;
            rMap1.Dock = DockStyle.Fill;
            Controls.Add(rMap1);
            mapview = rMap1;
            rMap1.Manager.Mode = GMap.NET.AccessMode.ServerOnly;
            GoogleChinaMap map = GoogleChinaMap.Instance;
            map.TryCorrectVersion = false;
            rMap1.MapProvider = map;
            //rMap1.Position = new PointLatLng(46.6, 130);
            rMap1.MaxZoom = 16;
            rMap1.MinZoom = 9;
            //mapServer = ClientServer.PlatformServer.GetService<TONLI.MapCore.IMapServer>();

            objects = new GMapOverlay(rMap1, "objects");
            routes = new GMapOverlay(rMap1, "LineCode");
            
            rMap1.Overlays.Add(routes);
            rMap1.Overlays.Add(objects);

            routes.Markers.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
            
            oInstances = new OperationInstances(rMap1);
            curOperation = oInstances.LineOperation;
            rMap1.OnMapZoomChanged += new MapZoomChanged(rMap1_OnMapZoomChanged);
            rMap1.MouseEnter += new EventHandler(rMap1_MouseEnter);
            rMap1.MouseMove += new MouseEventHandler(rMap1_MouseMove);
            rMap1.MouseMove += new MouseEventHandler(MainMap_MouseMove);
            rMap1.MouseDown += new MouseEventHandler(MainMap_MouseDown);
            rMap1.MouseUp += new MouseEventHandler(MainMap_MouseUp);
            rMap1.OnMarkerEnter += new MarkerEnter(MainMap_OnMarkerEnter);
            rMap1.OnMarkerLeave += new MarkerLeave(MainMap_OnMarkerLeave);
            rMap1.OnTileLoadStart += new TileLoadStart(MainMap_OnTileLoadStart);

            rMap1.OnTileLoadComplete += new TileLoadComplete(MainMap_OnTileLoadComplete);
            barButtonItem10.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.Check;
            barButtonItem10.AllowAllUp = true;
            barButtonItem4.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.Check;
            barButtonItem4.DownChanged += new DevExpress.XtraBars.ItemClickEventHandler(测距_DownChanged);
            barButtonItem10.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            ucLayer = ucMapLayer1;
            dockPanel1.Text = "网络图图纸库";
            barSubItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
        }
예제 #3
0
 void 测距_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
     if (barButtonItem4.Down)
         CurOperation = oInstances.DistanceOperation;
     else
         CurOperation = oInstances.LineOperation;
 }
예제 #4
0
 void barTJ_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
     if (barTJ.Down) {
         CurOperation = oInstances.TjOperation;
     } else {
         oInstances.TjOperation.Reset();
         CurOperation = oInstances.LineOperation;
     }
 }