| | |
| | | } = getBaseConfig() |
| | | |
| | | import { addBlueFilter } from '@/utils/cesium/common' |
| | | import { useBoundary } from '@/utils/cesium/useBoundary' |
| | | |
| | | let smallMpaCenterDistance = null |
| | | let curCameraHpr = null |
| | |
| | | this.terrainLoading = null |
| | | this.terrainEnabled = false |
| | | this.globalBaseMapLayers = [] |
| | | this.boundary = null |
| | | this.init(options) |
| | | } |
| | | |
| | |
| | | layerMode = 17, |
| | | contour = true, |
| | | flyToContour = false, |
| | | multiple = 1.4, |
| | | dockOptions = {}, |
| | | boundaryChange, |
| | | terrainLoadCallback, |
| | | boundaryColor = '#00F9EC', |
| | | dockRangeType = 1, |
| | | useDockHeight = false |
| | | } = options |
| | | Cesium.Camera.DEFAULT_VIEW_FACTOR = -0.45 |
| | | // 西南东北,默认显示中国 |
| | |
| | | |
| | | this.setFixedNoonLighting() |
| | | |
| | | // 边界,机巢 |
| | | this.boundary = useBoundary(this.viewer, { multiple, dockOptions, boundaryChange, boundaryColor, dockRangeType, useDockHeight }) |
| | | this.viewer?.imageryLayers.removeAll() |
| | | this.viewer._cesiumWidget._creditContainer.style.display = 'none' |
| | | handler = new Cesium.ScreenSpaceEventHandler(this.viewer?.scene.canvas) |
| | |
| | | this.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 4500000 |
| | | this.switchLayers(layerMode) |
| | | this.switchFlatMode(flatMode) |
| | | this.switchContour(contour) |
| | | flyToContour && this.flyToContour(contour) |
| | | |
| | | |
| | | if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) { |
| | | let dpr = window.devicePixelRatio |
| | | while (dpr >= 2.0) dpr /= 2.0 // 避免过高缩放导致模糊 |
| | |
| | | cesiumContainer.remove() // 移除与地图相关的DOM元素 |
| | | this.viewerDom = null |
| | | } |
| | | } |
| | | |
| | | setShowDock (sns) { |
| | | this.boundary?.setShowDock(sns) |
| | | } |
| | | setDockCoverColor (sns) { |
| | | this.boundary?.setDockCoverColor(sns) |
| | | } |
| | | // 切换轮廓显示 |
| | | async switchContour (open) { |
| | | if (open) { |
| | | await this.boundary?.openContour() |
| | | } else { |
| | | this.boundary?.closeContour() |
| | | } |
| | | } |
| | | // 飞向轮廓居中 |
| | | flyToContour () { |
| | | this.boundary?.flyToBoundary() |
| | | } |
| | | |
| | | // 飞行 flyto |