修改地图 测试
This commit is contained in:
@@ -83,6 +83,7 @@ const TaskMonitorPage: React.FC = () => {
|
||||
const [messageApi, contextHolder] = message.useMessage();
|
||||
|
||||
const controllerRef = useRef<DeviceController | null>(null);
|
||||
const mapRef = useRef<any>(null);
|
||||
|
||||
// 初始化实时数据控制器
|
||||
useEffect(() => {
|
||||
@@ -414,7 +415,7 @@ const TaskMonitorPage: React.FC = () => {
|
||||
overflow: 'hidden',
|
||||
border: '1px solid #f0f0f0'
|
||||
}}>
|
||||
<CesiumMap from="taskMonitor" mapLayer={currentStation?.siteMapName} focusLocation={focusLocation}
|
||||
<CesiumMap ref={mapRef} from="taskMonitor" mapLayer={currentStation?.siteMapName} focusLocation={focusLocation}
|
||||
devices={mapDevices}
|
||||
/>
|
||||
|
||||
@@ -452,7 +453,16 @@ const TaskMonitorPage: React.FC = () => {
|
||||
))}
|
||||
</div>
|
||||
|
||||
|
||||
<div style={{ position: 'absolute', bottom: 20, right: 20, display: 'flex', gap: 8, zIndex: 10 }}>
|
||||
<Button size="small" style={{ borderRadius: 4 }} icon={<MapIcon size={14} />} onClick={() => {
|
||||
mapRef.current?.setMapType('google-satellite');
|
||||
mapRef.current?.toggle3D(true);
|
||||
}}>卫星全景</Button>
|
||||
<Button size="small" style={{ borderRadius: 4 }} icon={<LayoutGrid size={14} />} onClick={() => {
|
||||
mapRef.current?.setMapType('google-streets');
|
||||
mapRef.current?.toggle3D(false);
|
||||
}}>2D普通</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
@@ -475,7 +485,14 @@ const TaskMonitorPage: React.FC = () => {
|
||||
const lon = Number(pos.longitude ?? pos.lng);
|
||||
const lat = Number(pos.latitude ?? pos.lat);
|
||||
if (Number.isFinite(lon) && Number.isFinite(lat)) {
|
||||
setFocusLocation({ lon, lat, type: item.deviceType === 'UAV' ? 'drone' : 'robot', });
|
||||
setFocusLocation({
|
||||
lon,
|
||||
lat,
|
||||
type: item.deviceType === 'UAV' ? 'drone' : 'robot',
|
||||
height: 1000, // 增加高度以实现飞入效果
|
||||
heading: 0,
|
||||
pitch: -45
|
||||
});
|
||||
}
|
||||
}}
|
||||
aria-pressed={selectedDeviceSerial === item.serialNumber}
|
||||
|
||||
Reference in New Issue
Block a user