// 处理实时数据 public void DealRealData(Model.RealData data) { var position = new MapLngLat(data.Longitude, data.Latitude, data.Altitude); Plane plane = CreateStateModel(data, position); trackMgr.AddTrackPoint(plane.Name, data.TargetType, position); if (!planeMgr.HasModel(plane)) { if (CreatePlane(plane)) { planeMgr.AddModel(plane); } } else { planeMgr.UpdataModel(plane); UpdatePlanePosition(plane); if (trackMgr.IsShowTrack(plane.Name)) { UpdateTrackPoint(plane); } } // 目标跟踪 if (trackPicture != null) { MapLngLat pos = trackPicture.GetLngLat(); mapLogic.GetToolBox().ZoomToPosition(pos); EventPublisher.PublishJumpToGlobeViewEvent(this, new Model.JumpToGlobeViewEventArgs(trackPicture.ElementName, pos)); } }
/// <summary> /// 跳转到某目标 /// </summary> /// <param name="name"></param> public void JumpToPlane(byte type, string elementName) { if (mapLogic == null) { return; } IMFLayer layer = mapLogic.GetLayer(GetModelLayerName(type)); if (layer == null) { return; } IMFElement element = layer.GetElement(elementName); if (element == null) { return; } IMFPicture model = element as IMFPicture; if (model == null) { return; } MapLngLat position = model.GetLngLat();; IMFToolBox toolBox = mapLogic.GetToolBox(); if (toolBox == null) { return; } toolBox.ZoomToPosition(position); }
// 跳转到三维 private void 跳转到三维ToolStripMenuItem_Click(object sender, EventArgs e) { if (prevPicture != null) { EventPublisher.PublishJumpToGlobeViewEvent(this, new Model.JumpToGlobeViewEventArgs(prevPicture.ElementName, prevPicture.GetLngLat())); } }