| | |
| | | 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 } |