/// <summary> /// 设置地图中的导航路线(可以设为null表示清空) /// </summary> /// <param name="route"></param> internal void SetRoute(BRoute route) { _b_route = route; _bPointTipControl.Visible = false; _bPOITipControl.Visible = false; _bMarkerEditorControl.Visible = false; _bMarkerTipControl.Visible = false; if (_theRouteStart != null && _theRouteEnd != null) //定位到路线中心 { Center = new LatLngPoint((_theRouteEnd.Location.Lng + _theRouteStart.Location.Lng) / 2, (_theRouteStart.Location.Lat + _theRouteEnd.Location.Lat) / 2); Zoom = 13; Locate(false); SyncControlsLocation(); } Invalidate(); }
/// <summary> /// 路线选中 /// </summary> /// <param name="bRoute"></param> void item_RouteSelected(BRoute bRoute) { foreach (Control c in flpRoutes.Controls) { if (c as BTransitRouteItem != null && (c as BTransitRouteItem).DataSource != bRoute) { (c as BTransitRouteItem).Selected = false; } if (c as BWalkingRouteItem != null && (c as BWalkingRouteItem).DataSource != bRoute) { (c as BWalkingRouteItem).Selected = false; } if (c as BDrivingRouteItem != null && (c as BDrivingRouteItem).DataSource != bRoute) { (c as BDrivingRouteItem).Selected = false; } } if (BMapControl != null) { BMapControl.SetRoute(bRoute); //更新地图中的路线 } }