定位的逻辑
This commit is contained in:
@@ -629,8 +629,13 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
// }
|
||||
//}
|
||||
|
||||
void _handleGotoLocation() {
|
||||
_mapController.move(_currentLatLng!, 18);
|
||||
}
|
||||
|
||||
/// ===============================
|
||||
/// 企业级定位初始化(已修复坐标系)
|
||||
///
|
||||
Future<void> _initLocationEnterprise() async {
|
||||
// 1. 设置轨迹模式为 LOCATION(核心:确保模式正确)
|
||||
_traceManager.setMode(TPMode.LOCATION);
|
||||
@@ -692,8 +697,8 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
|
||||
// 4. 重置轨迹管理器
|
||||
_traceManager.reset();
|
||||
if (_isValidLatLng(_mapCenter.latitude, _mapCenter.longitude)) {
|
||||
_mapController.move(_mapCenter, savedZoom);
|
||||
if (_currentLatLng != null && _isValidLatLng(_currentLatLng!.latitude, _currentLatLng!.longitude)) {
|
||||
_mapController.move(_currentLatLng!, savedZoom);
|
||||
} else {
|
||||
// 使用兜底的有效坐标(确保在高德瓦片覆盖范围内)
|
||||
final defaultCenter = _getDefaultValidCenter();
|
||||
@@ -2154,6 +2159,7 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
_currentWorkMode = mode;
|
||||
debugPrint('外部收到作业模式:$mode');
|
||||
},
|
||||
handleGotoLocation: _handleGotoLocation,
|
||||
onRefreshTap: _handleRefresh, // 推荐用局部刷新
|
||||
onVideoTap: _handleVideo,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user