Merge remote-tracking branch 'origin/master'
19 files modified
1 files renamed
2 files added
| | |
| | | import { cockpitAggregationApi } from '@/api/dataCockpit' |
| | | import layerControlIcon from '@/assets/images/dataCockpit/layerControl.png' |
| | | import equipmentIcon from '@/assets/images/dataCockpit/map/equipment.png' |
| | | import offlineEquipmentIcon from '@/assets/images/dataCockpit/map/offline-equipment.png' |
| | | import droneIcon from '@/assets/images/dataCockpit/map/drone.png' |
| | | import aggregationIcon from '@/assets/images/dataCockpit/map/aggregation.png' |
| | | import commandPostIcon from '@/assets/images/dataCockpit/map/command-post.png' |
| | |
| | | const POLYGON_HEIGHT_M = 0.2 |
| | | |
| | | const props = defineProps({ |
| | | onlineDevices: { |
| | | allDevices: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | |
| | | const deviceEntries = [] |
| | | const devicePositions = [] |
| | | devices.forEach((item, index) => { |
| | | const isOnline = String(item.status) === '0' |
| | | |
| | | const position = getDevicePosition(item) |
| | | if (!position) return |
| | | const entityId = `online-device-${item.id ?? index}-${index}` |
| | |
| | | devicePositions.push({ lng: position.longitude, lat: position.latitude }) |
| | | const billboard = deviceBillboardCollection.add({ |
| | | position: Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, 0), |
| | | image: equipmentIcon, |
| | | image: isOnline ? equipmentIcon : offlineEquipmentIcon, |
| | | width: 40, |
| | | height: 56, |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | }) |
| | | billboard.id = entityId |
| | | devicePickMap.set(entityId, { data: item, billboard }) |
| | | deviceEntries.push({ position, rangeMeters, billboard }) |
| | | deviceEntries.push({ position, rangeMeters, billboard, isOnline }) |
| | | }) |
| | | if (selectedTargetType.value === 'device' && selectedDeviceBillboard && !devicePickMap.has(selectedDeviceBillboard.id)) { |
| | | closePopup() |
| | |
| | | centerHeight |
| | | ) |
| | | } |
| | | if (!entry.isOnline) return |
| | | if (!Number.isFinite(entry.rangeMeters) || entry.rangeMeters <= 0) return |
| | | const primitive = createDeviceRangePrimitiveWithHeight(entry.position, entry.rangeMeters, centerHeight) |
| | | if (!primitive) return |
| | |
| | | |
| | | |
| | | watch( |
| | | () => props.onlineDevices, |
| | | () => props.allDevices, |
| | | devices => { |
| | | renderDeviceEntities(devices || []) |
| | | }, |
| | |
| | | const height = viewer?.camera?.positionCartographic?.height |
| | | const stage = getStageByHeight(height) |
| | | updateStageDisplay(stage) |
| | | renderDeviceEntities(props.onlineDevices) |
| | | renderDeviceEntities(props.allDevices) |
| | | loadPartitions() |
| | | loadAggregation() |
| | | loadCommandPosts() |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { buildEllipsePositions } from '../shapeUtils' |
| | | |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { buildEllipsePositions } from '../shapeUtils' |
| | | |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | |
| | | const POINT_ENTITY_NAME = 'draw-polygon-point' |
| | |
| | | |
| | | this.polygonEntity = this.dataSource.entities.add({ |
| | | polygon: { |
| | | hierarchy: new Cesium.CallbackProperty( |
| | | () => new Cesium.PolygonHierarchy(getPreviewPositions()), |
| | | false |
| | | ), |
| | | hierarchy: new Cesium.CallbackProperty(() => new Cesium.PolygonHierarchy(getPreviewPositions()), false), |
| | | material: this.style.fill, |
| | | outline: false, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { getBoundsFromCartesians, rectanglePositionsFromBounds } from '../shapeUtils' |
| | | |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { buildEllipsePositions, cartesianToLocal } from '../shapeUtils' |
| | | |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { |
| | | getBoundsFromLngLats, |
| | |
| | | const minorFromMeta = Number.isFinite(meta?.semiMinor) ? Number(meta.semiMinor) : 0 |
| | | const majorPoint = resolveCartographic(meta?.majorPoint) |
| | | const minorPoint = resolveCartographic(meta?.minorPoint) |
| | | const majorDistance = |
| | | majorFromMeta || (majorPoint ? getMetersBetween(centerCarto, majorPoint) : 0) |
| | | const minorDistance = |
| | | minorFromMeta || (minorPoint ? getMetersBetween(centerCarto, minorPoint) : 0) |
| | | const majorDistance = majorFromMeta || (majorPoint ? getMetersBetween(centerCarto, majorPoint) : 0) |
| | | const minorDistance = minorFromMeta || (minorPoint ? getMetersBetween(centerCarto, minorPoint) : 0) |
| | | if (majorDistance > 0) this.semiMajor = Math.max(1, majorDistance) |
| | | if (minorDistance > 0) this.semiMinor = Math.max(1, minorDistance) |
| | | if (this.semiMinor > this.semiMajor) this.semiMinor = this.semiMajor |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | |
| | | const POINT_ENTITY_NAME = 'edit-polygon-point' |
| | |
| | | createEntities() { |
| | | this.polygonEntity = this.dataSource.entities.add({ |
| | | polygon: { |
| | | hierarchy: new Cesium.CallbackProperty( |
| | | () => new Cesium.PolygonHierarchy(this.positions), |
| | | false |
| | | ), |
| | | hierarchy: new Cesium.CallbackProperty(() => new Cesium.PolygonHierarchy(this.positions), false), |
| | | material: this.style.fill, |
| | | outline: false, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { MapTooltip } from '../Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | import { ToolBase } from '../ToolBase' |
| | | import { getBoundsFromLngLats, rectanglePositionsFromBounds } from '../shapeUtils' |
| | | |
| | |
| | | } |
| | | |
| | | getCornerCartographics() { |
| | | return rectanglePositionsFromBounds(this.bounds).map(position => |
| | | Cesium.Cartographic.fromCartesian(position) |
| | | ) |
| | | return rectanglePositionsFromBounds(this.bounds).map(position => Cesium.Cartographic.fromCartesian(position)) |
| | | } |
| | | |
| | | getPositionFromScreen(screenPosition) { |
| | |
| | | export { DrawManager } from './DrawManager' |
| | | export { EditManager } from './EditManager' |
| | | export { buildEllipsePositions, getBoundsFromCartesians, getBoundsFromLngLats, rectanglePositionsFromBounds, getCenterFromBounds, getMetersBetween, cartesianToLocal } from './shapeUtils' |
| | | export { |
| | | buildEllipsePositions, |
| | | getBoundsFromCartesians, |
| | | getBoundsFromLngLats, |
| | | rectanglePositionsFromBounds, |
| | | getCenterFromBounds, |
| | | getMetersBetween, |
| | | cartesianToLocal, |
| | | } from './shapeUtils' |
| | | export { DrawPolygonTool } from './draw/DrawPolygonTool' |
| | | export { DrawRectangleTool } from './draw/DrawRectangleTool' |
| | | export { DrawEllipseTool } from './draw/DrawEllipseTool' |
| | |
| | | export { EditEllipseTool } from './edit/EditEllipseTool' |
| | | export { EditBufferCircleTool } from './edit/EditBufferCircleTool' |
| | | export { ToolBase } from './ToolBase' |
| | | export { MapTooltip as Tooltip } from './Tooltip' |
| | | export { MapTooltip as Tooltip } from '@ztzf/utils' |
| | |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | import positionIcon from '@/assets/images/areaManage/positionIcon.png' |
| | | import { MapTooltip } from '@/utils/cesium/shapeTools/Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | |
| | | const initForm = () => ({ |
| | | address: '', // 位置 |
| | |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="指挥点位置" prop="longitude"> |
| | | <el-input |
| | | class="command-input" |
| | | :model-value="commandPointText" |
| | | disabled |
| | | placeholder="请选择指挥点位置" |
| | | > |
| | | <el-input class="command-input" :model-value="commandPointText" disabled placeholder="请选择指挥点位置"> |
| | | <template #suffix> |
| | | <span class="suffix-action">地图选点</span> |
| | | </template> |
| | |
| | | import { buildEllipsePositions } from '@/utils/cesium/shapeTools' |
| | | import { cartesian3Convert } from '@/utils/cesium/mapUtil' |
| | | import { AREA_TYPE_STYLE_MAP, BUFFER_LEVEL_STYLES, DEFAULT_AREA_STYLE } from '@ztzf/constants' |
| | | import { MapTooltip } from '@/utils/cesium/shapeTools/Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | |
| | | }) |
| | | |
| | | const commandPointText = computed(() => { |
| | | // 你也可以改成 `${lng}, ${lat}` |
| | | if (!formData.value.longitude) { |
| | | return '' |
| | | } |
| | | return `${formData.value.longitude}, ${formData.value.latitude}`; |
| | | }); |
| | | // 你也可以改成 `${lng}, ${lat}` |
| | | if (!formData.value.longitude) { |
| | | return '' |
| | | } |
| | | return `${formData.value.longitude}, ${formData.value.latitude}` |
| | | }) |
| | | |
| | | const emit = defineEmits(['success']) |
| | | const formRef = ref(null) // 表单实例 |
| | |
| | | const resolved = resolveLngLatPoint(point) |
| | | const normalized = normalizeShapePoint(resolved) |
| | | if (!normalized) return |
| | | positions.push( |
| | | Cesium.Cartesian3.fromDegrees(normalized.lng, normalized.lat, normalized.height) |
| | | ) |
| | | positions.push(Cesium.Cartesian3.fromDegrees(normalized.lng, normalized.lat, normalized.height)) |
| | | }) |
| | | } |
| | | if (shape?.drawType === 'buffer' && shape?.meta?.center && Array.isArray(shape?.meta?.bufferRadii)) { |
| | |
| | | sceneConfigList.value = res?.data?.data ?? [] |
| | | } |
| | | |
| | | |
| | | // 获取场景配置名称 |
| | | function getSceneConfigName(id) { |
| | | if (!id) return '' |
| | |
| | | fitViewToSceneAreas() |
| | | } |
| | | |
| | | onMounted(() => { |
| | | }) |
| | | onMounted(() => {}) |
| | | |
| | | watch( |
| | | () => formData.value.defenseSceneId, |
| | |
| | | } |
| | | } |
| | | ) |
| | | |
| | | |
| | | defineExpose({ |
| | | open, |
| | |
| | | * @Author : yuan |
| | | * @Date : 2026-01-17 14:51:39 |
| | | * @LastEditors : yuan |
| | | * @LastEditTime : 2026-01-30 15:20:56 |
| | | * @LastEditTime : 2026-01-31 16:03:51 |
| | | * @FilePath : \applications\drone-command\src\views\dataCockpit\components\LegendBar.vue |
| | | * @Description : |
| | | * Copyright 2026 OBKoro1, All Rights Reserved. |
| | |
| | | import droneIcon from '@/assets/images/dataCockpit/legend/drone.png' |
| | | import commandPostIcon from '@/assets/images/dataCockpit/legend/command-post.png' |
| | | import equipmentIcon from '@/assets/images/dataCockpit/legend/equipment.png' |
| | | import offlineEquipmentIcon from '@/assets/images/dataCockpit/legend/offline-equipment.png' |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | * @Author : yuan |
| | | * @Date : 2026-01-07 15:17:54 |
| | | * @LastEditors : yuan |
| | | * @LastEditTime : 2026-01-20 09:19:16 |
| | | * @LastEditTime : 2026-01-31 15:47:40 |
| | | * @FilePath : \applications\drone-command\src\views\dataCockpit\components\RightContainer.vue |
| | | * @Description : |
| | | * Copyright 2026 OBKoro1, All Rights Reserved. |
| | |
| | | } |
| | | }) |
| | | |
| | | const emit = defineEmits(['update:collapsed', 'update:onlineDevices']) |
| | | const emit = defineEmits(['update:collapsed', 'update:allDevices']) |
| | | |
| | | const collapsedModel = computed({ |
| | | get: () => props.collapsed, |
| | |
| | | const startAt = Date.now() |
| | | loading.value = true |
| | | try { |
| | | const params = { current: 1, size: 20, deviceStatusList: '0' } |
| | | const params = { current: 1, size: 9999, deviceStatusList: '0,1,2' } |
| | | const res = await deviceSearchApi(params) |
| | | const records = res?.data?.data?.records ?? [] |
| | | counterDeviceStatusList.value = records.map(formatDeviceItem) |
| | | emit('update:onlineDevices', records) |
| | | let onlineData = records.filter(item => String(item.status) === '0') |
| | | counterDeviceStatusList.value = onlineData.map(formatDeviceItem) |
| | | emit('update:allDevices', records) |
| | | } finally { |
| | | const elapsed = Date.now() - startAt |
| | | if (elapsed < minLoadingMs) { |
| | |
| | | * @Author : yuan |
| | | * @Date : 2026-01-06 16:35:50 |
| | | * @LastEditors : yuan |
| | | * @LastEditTime : 2026-01-16 17:17:24 |
| | | * @LastEditTime : 2026-01-31 15:40:15 |
| | | * @FilePath : \applications\drone-command\src\views\dataCockpit\index.vue |
| | | * @Description : |
| | | * Copyright 2026 OBKoro1, All Rights Reserved. |
| | |
| | | <template> |
| | | <div class="page-container"> |
| | | <DeviceMapContainer |
| | | :online-devices="onlineDevices" |
| | | :all-devices="allDevices" |
| | | :alarm-drones="realWarningData" |
| | | :left-collapsed="leftCollapsed" |
| | | container-id="data-cockpit-map" |
| | |
| | | @real-warning-counter="handleAlarmAction('counter', $event)" |
| | | @real-warning-favorite="handleAlarmFavorite" |
| | | /> |
| | | <RightContainer class="right-container" v-model:collapsed="rightCollapsed" v-model:onlineDevices="onlineDevices" /> |
| | | <RightContainer class="right-container" v-model:collapsed="rightCollapsed" |
| | | v-model:allDevices="allDevices" /> |
| | | <CenterContainer @select-warning="onSelectWarning" @select-equipment="onSelectEquipment" /> |
| | | <LegendBar class="legend-container" /> |
| | | </div> |
| | |
| | | const leftCollapsed = ref(false); |
| | | |
| | | const rightCollapsed = ref(false); |
| | | const onlineDevices = ref([]); |
| | | const allDevices = ref([]); |
| | | const realWarningData = ref([]); |
| | | const realWarningLoading = ref(true); |
| | | const minLoadingMs = 400; |
| | |
| | | const startAt = Date.now(); |
| | | realWarningLoading.value = true; |
| | | try { |
| | | const params = { current: 1, size: 20, alarmType: '1' }; |
| | | const params = { current: 1, size: 9999, alarmType: '1' }; |
| | | const res = await alarmLogApi(params); |
| | | const records = res?.data?.data?.records ?? []; |
| | | realWarningData.value = records.map((record) => ({ |
| | |
| | | <div class="right-container"> |
| | | <div class="header"> |
| | | <span>{{ formTitle }}</span> |
| | | |
| | | |
| | | <el-icon class="close-btn" @click.stop="visible = false"><Close /></el-icon> |
| | | </div> |
| | | |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设备位置" prop="deployLocation"> |
| | | <el-input |
| | | class="command-input" |
| | | v-model="formData.deployLocation" |
| | | disabled |
| | | placeholder="请选择位置" |
| | | > |
| | | <el-input class="command-input" v-model="formData.deployLocation" disabled placeholder="请选择位置"> |
| | | <template #suffix> |
| | | <span class="suffix-action">地图选点</span> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="设备编号" prop="deviceSn"> |
| | | <el-input |
| | | class="command-input" |
| | | v-model="formData.deviceSn" |
| | | disabled |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | <el-input class="command-input" v-model="formData.deviceSn" disabled placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="设备型号" prop="deviceModel"> |
| | | <el-input |
| | | class="command-input" |
| | | v-model="formData.deviceModel" |
| | | disabled |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | <el-input class="command-input" v-model="formData.deviceModel" disabled placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="覆盖范围(m)" prop="effectiveRangeKm"> |
| | | <el-input-number |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="footer"> |
| | | <el-button v-if="dialogMode != 'view'" color="#2B2B4C" @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button v-if="dialogMode != 'view'" color="#2B2B4C" @click="handleCancel"> |
| | | {{ dialogReadonly ? '关闭' : '取消' }} |
| | | </el-button> |
| | | <el-button |
| | | color="#284FE3" |
| | | v-if="!dialogReadonly" |
| | |
| | | import * as Cesium from 'cesium' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | import { MapTooltip } from '@/utils/cesium/shapeTools/Tooltip' |
| | | import { MapTooltip } from '@ztzf/utils' |
| | | |
| | | import equipment from '@/assets/images/dataCockpit/legend/equipment.png' |
| | | |
| | |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | const {longitude, latitude} = parseDeployLocation(formData.value.deployLocation) |
| | | const { longitude, latitude } = parseDeployLocation(formData.value.deployLocation) |
| | | const normalizedRange = normalizeRange(formData.value.effectiveRangeKm) |
| | | |
| | | const payload = { |
| | |
| | | effectiveRangeKmIsNotNull: normalizedRange != null ? 1 : 2, |
| | | effectiveRangeKm: normalizedRange, |
| | | longitude, |
| | | latitude |
| | | latitude, |
| | | } |
| | | formData.value.effectiveRangeKm = normalizedRange |
| | | delete payload.deviceId |
| | |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '侦测范围管理'}-${actionText}`, |
| | | type: 1 |
| | | type: 1, |
| | | }) |
| | | |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | |
| | | current: 1, |
| | | size: 200, |
| | | effectiveRangeKmIsNotNull: 2, |
| | | isTrack: 1 |
| | | isTrack: 1, |
| | | }) |
| | | const records = res?.data?.data?.records ?? [] |
| | | deviceOptions.value = records.map(item => ({ |
| | |
| | | width="80%" |
| | | > |
| | | <div class="detail-container" style="display: flex"> |
| | | <div class="detail-left" v-if="dialogMode !== 'add' && processList.length"> |
| | | <el-timeline class="gd-timeline"> |
| | | <el-timeline-item |
| | | v-for="(activity, index) in processList" |
| | | :key="index" |
| | | :icon="Check" |
| | | :type="index === processList.length - 1 ? 'success' : 'info'" |
| | | :color="activity.color" |
| | | :hollow="activity.hollow" |
| | | :timestamp="activity.createTime" |
| | | > |
| | | <div class="item-content"> |
| | | <div>{{ activity.operator }}</div> |
| | | <div class="flowName">{{ activity.flowName }}</div> |
| | | </div> |
| | | </el-timeline-item> |
| | | </el-timeline> |
| | | <div class="processBox"> |
| | | <div class="detail-title">巡查需求记录</div> |
| | | <div class="detail-left" v-if="dialogMode !== 'add' && processList.length"> |
| | | <el-timeline class="gd-timeline"> |
| | | <el-timeline-item |
| | | v-for="(activity, index) in processList" |
| | | :key="index" |
| | | :icon="Check" |
| | | :type="index === processList.length - 1 ? 'success' : 'info'" |
| | | :color="activity.color" |
| | | :hollow="activity.hollow" |
| | | :timestamp="activity.createTime" |
| | | > |
| | | <div class="item-content"> |
| | | <div>{{ activity.operator }}</div> |
| | | <div class="flowName">{{ activity.flowName }}</div> |
| | | </div> |
| | | </el-timeline-item> |
| | | </el-timeline> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="detail-right"> |
| | |
| | | color: #999; |
| | | margin-top: 2px; |
| | | } |
| | | |
| | | .processBox{ |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .detail-left{ |
| | | height: 100%; |
| | | overflow: auto; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | > |
| | | <div class="content" style="display: flex"> |
| | | <div class="processBox" v-if="dialogMode !== 'add' && processList.length"> |
| | | <!-- <div class="detail-title">工单记录</div>--> |
| | | <OrderStepBar :processList="processList" /> |
| | | <div class="detail-title">工单记录</div> |
| | | <div class="process" > |
| | | <OrderStepBar :processList="processList"/> |
| | | </div> |
| | | </div> |
| | | <div class="leftBox"> |
| | | <div v-if="dialogReadonly"> |
| | |
| | | |
| | | .gd-cesium { |
| | | width: 100%; |
| | | min-height: 380px; |
| | | min-height: 360px; |
| | | flex: 1; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | .processBox { |
| | | padding: 12px 16px 24px 16px; |
| | | width: 312px; |
| | | border: 1px solid #e4e4e4; |
| | | border-radius: 8px; |
| | | overflow: auto; |
| | | background: #fff; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .process{ |
| | | height: 100%; |
| | | padding: 12px 16px 24px 16px; |
| | | width: 312px; |
| | | border: 1px solid #e4e4e4; |
| | | border-radius: 8px; |
| | | background: #fff; |
| | | overflow: auto; |
| | | } |
| | | } |
| | | } |
| | | |
| File was renamed from applications/drone-command/src/utils/cesium/shapeTools/Tooltip.js |
| | |
| | | export class MapTooltip { |
| | | export class MapTooltip { |
| | | constructor(viewer, options = {}) { |
| | | this.viewer = viewer |
| | | this.options = options |
| | |
| | | if (!this.tooltipEl || !position) return |
| | | const width = this.container?.clientWidth ?? 0 |
| | | const height = this.container?.clientHeight ?? 0 |
| | | if ( |
| | | !width || |
| | | !height || |
| | | position.x < 0 || |
| | | position.y < 0 || |
| | | position.x > width || |
| | | position.y > height |
| | | ) { |
| | | if (!width || !height || position.x < 0 || position.y < 0 || position.x > width || position.y > height) { |
| | | this.hide() |
| | | return |
| | | } |
| | |
| | | import * as Cesium from 'cesium' |
| | | |
| | | // 获取正射影像4至点 |
| | | export function getOrthoImageBoundaryPoints (data) { |
| | | const arr = JSON.parse(data) |
| | | |
| | | if (arr.length !== 4) return undefined |
| | | |
| | | const west = Math.min(arr[0], arr[2]) |
| | | const east = Math.max(arr[0], arr[2]) |
| | | const south = Math.min(arr[1], arr[3]) |
| | | const north = Math.max(arr[1], arr[3]) |
| | | |
| | | return Cesium.Rectangle.fromDegrees( |
| | | west, |
| | | south, |
| | | east, |
| | | north |
| | | ) |
| | | } |
| | | |
| | | import { MapTooltip } from './MapTooltip' |
| | | /** |
| | | * 飞到中心点并且所有点在可视范围 |
| | | * @param positionsData 二维数组,每项为 [lon, lat] 或 三维数组 [lon, lat, height] |
| | |
| | | * @param multiple 缩放倍数-默认为4 |
| | | * @param pitch 俯仰角-默认为-90 |
| | | */ |
| | | export function flyVisual({ positionsData, viewer, multiple = 4, pitch = -90 }) { |
| | | function flyVisual({ positionsData, viewer, multiple = 4, pitch = -90 }) { |
| | | if (!Array.isArray(positionsData) || positionsData.length === 0) return |
| | | |
| | | // 如果是一个点,加两个点方便后续生成外包围盒 |
| | |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | export { MapTooltip, flyVisual } |