xx
This commit is contained in:
@@ -34,6 +34,7 @@ import 'package:maibu_satabot_v2/components/input_confirm_dialog.dart';
|
||||
import 'package:maibu_satabot_v2/features/home/presentation/widgets/common/tracepoint.dart';
|
||||
import 'package:maibu_satabot_v2/features/home/presentation/widgets/map/CenterLocation.dart';
|
||||
import 'package:maibu_satabot_v2/features/home/presentation/widgets/map/HeadingPointer.dart';
|
||||
import 'package:maibu_satabot_v2/features/home/presentation/widgets/map/dji_tile_layer.dart';
|
||||
import 'package:maibu_satabot_v2/features/home/presentation/widgets/obsToast.dart';
|
||||
import 'package:maibu_satabot_v2/features/home/presentation/widgets/startpoint_area.dart';
|
||||
import 'package:image/image.dart' as _image; // 注意命名空间冲突,使用 as img
|
||||
@@ -130,9 +131,24 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
double _workDistance = 0.0; // 作业行距(单位:米)
|
||||
double _angle = 0.0; // 航线方向角(单位:度)
|
||||
|
||||
// 大疆地图
|
||||
bool isDjMapShow = false;
|
||||
late DJIStation _currentStation;
|
||||
|
||||
// 所有可用的场站列表(根据你的实际瓦片目录配置)
|
||||
final List<DJIStation> _stationList = [
|
||||
const DJIStation(name: 'liaoning', displayName: '一号场站'),
|
||||
const DJIStation(name: 'station_b', displayName: '二号场站'),
|
||||
const DJIStation(name: 'station_c', displayName: '三号场站'),
|
||||
// 新增场站只需在这里添加,无需修改其他逻辑
|
||||
];
|
||||
|
||||
// 其他
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_currentStation = _stationList.first;
|
||||
_traceManager = TracePoint<PlotPoint>();
|
||||
_initLocationEnterprise();
|
||||
//_traceManager.onCurrentPointUpdated = (point) {
|
||||
@@ -690,6 +706,8 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
_currentLatLng = null;
|
||||
_currentWgsLatLng = null;
|
||||
_mapCenter = _getDefaultValidCenter(); // 仅用兜底坐标初始化地图中心
|
||||
|
||||
isDjMapShow = false;
|
||||
});
|
||||
|
||||
// 3. 重新初始化定位
|
||||
@@ -1233,6 +1251,7 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
),
|
||||
maxZoom: 18,
|
||||
),
|
||||
//if (isDjMapShow) DJITileLayer(stationName: _currentStation.name, mapController: _mapController),
|
||||
|
||||
// 绘制path折线(Line模式)
|
||||
if (gcjPathPoints.isNotEmpty)
|
||||
@@ -2155,6 +2174,12 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
_isWorkPanelOpen = false;
|
||||
});
|
||||
},
|
||||
onDjShow: (bool isOpen) {
|
||||
setState(() {
|
||||
isDjMapShow = isOpen;
|
||||
});
|
||||
},
|
||||
|
||||
onWorkModeSelected: (mode) {
|
||||
_currentWorkMode = mode;
|
||||
debugPrint('外部收到作业模式:$mode');
|
||||
|
||||
Reference in New Issue
Block a user