| @@ -3,9 +3,7 @@ | |||
| * @Date: 2021-02-21 17:50:31 | |||
| */ | |||
| import { Cesium } from '@dc-modules/namespace' | |||
| const { | |||
| import { | |||
| BoxGeometry, | |||
| Cartesian3, | |||
| defined, | |||
| @@ -23,8 +21,9 @@ const { | |||
| BlendingState, | |||
| SceneMode, | |||
| ShaderProgram, | |||
| ShaderSource | |||
| } = Cesium | |||
| ShaderSource, | |||
| SkyBox | |||
| } from '@cesium/engine' | |||
| const SkyBoxFS = ` | |||
| uniform samplerCube u_cubeMap; | |||
| @@ -48,7 +47,7 @@ const SkyBoxVS = ` | |||
| } | |||
| ` | |||
| class GroundSkyBox extends Cesium.SkyBox { | |||
| class GroundSkyBox extends SkyBox { | |||
| constructor(options = {}) { | |||
| super(options) | |||
| this.offsetAngle = options?.offsetAngle || 0 | |||
| @@ -266,6 +266,14 @@ class HeatLayer extends Layer { | |||
| } | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @return {HeatLayer} | |||
| */ | |||
| clear() { | |||
| return this | |||
| } | |||
| } | |||
| Layer.registerType('heat') | |||
| @@ -9,22 +9,8 @@ import { Util } from '@dc-modules/utils' | |||
| class ViewerOption { | |||
| constructor(viewer) { | |||
| this._viewer = viewer | |||
| this._options = {} | |||
| this._init() | |||
| } | |||
| /** | |||
| * Init viewer | |||
| * @private | |||
| */ | |||
| _init() { | |||
| this._viewer.delegate.cesiumWidget.creditContainer.style.display = 'none' | |||
| this._viewer.delegate.cesiumWidget.screenSpaceEventHandler.removeInputAction( | |||
| Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK | |||
| ) | |||
| this._viewer.scene.screenSpaceCameraController.maximumZoomDistance = 40489014.0 | |||
| this._viewer.scene.backgroundColor = Cesium.Color.TRANSPARENT | |||
| this._viewer.delegate.imageryLayers.removeAll() | |||
| this._options = {} | |||
| } | |||
| /** | |||
| @@ -34,10 +34,9 @@ class EditPolygon extends Edit { | |||
| * @private | |||
| */ | |||
| _mountAnchor() { | |||
| let positions = [].concat( | |||
| this._overlay.delegate.polygon.hierarchy.getValue(Cesium.JulianDate.now()) | |||
| this._positions = [] | |||
| let positions = this._overlay.delegate.polygon.hierarchy.getValue(Cesium.JulianDate.now()) | |||
| .positions | |||
| ) | |||
| positions.push(positions[0]) | |||
| for (let i = 0; i < positions.length - 1; i++) { | |||
| let mid = midCartesian(positions[i], positions[i + 1]) | |||
| @@ -33,11 +33,8 @@ class EditPolyline extends Edit { | |||
| * @private | |||
| */ | |||
| _mountAnchor() { | |||
| let positions = [].concat( | |||
| this._overlay.delegate.polyline.positions.getValue( | |||
| Cesium.JulianDate.now() | |||
| ) | |||
| ) | |||
| this._positions = [] | |||
| let positions = this._overlay.delegate.polyline.positions.getValue(Cesium.JulianDate.now()) | |||
| for (let i = 0; i < positions.length - 1; i++) { | |||
| let mid = midCartesian(positions[i], positions[i + 1]) | |||
| this._positions.push(positions[i]) | |||
| @@ -240,6 +240,8 @@ class EditTool { | |||
| * @returns {EditTool} | |||
| */ | |||
| activate(options = {}) { | |||
| this._anchorLayer.entities.removeAll() | |||
| this._anchors = [] | |||
| this._viewer.tooltip.enable = true | |||
| this._options = { ...DEF_OPTS, ...options } | |||
| this._unbindEvent() | |||
| @@ -2,7 +2,6 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-27 17:13:24 | |||
| */ | |||
| import { Cesium } from '@dc-modules/namespace' | |||
| import Parse from '@dc-modules/parse/Parse' | |||
| import { | |||
| @@ -19,18 +18,6 @@ import createWidgets from '@dc-modules/widget' | |||
| import createTools from '@dc-modules/tools' | |||
| const DEF_OPTS = { | |||
| animation: false, //Whether to create animated widgets, lower left corner of the meter | |||
| baseLayerPicker: false, //Whether to display the layer selector | |||
| imageryProvider: false, // Whether to display the default imagery | |||
| fullscreenButton: false, //Whether to display the full-screen button | |||
| geocoder: false, //To display the geocoder widget, query the button in the upper right corner | |||
| homeButton: false, //Whether to display the Home button | |||
| infoBox: false, //Whether to display the information box | |||
| sceneModePicker: false, //Whether to display 3D/2D selector | |||
| selectionIndicator: false, //Whether to display the selection indicator component | |||
| timeline: false, //Whether to display the timeline | |||
| navigationHelpButton: false, //Whether to display the help button in the upper right corner | |||
| navigationInstructionsInitiallyVisible: false, | |||
| creditContainer: undefined, | |||
| shouldAnimate: true | |||
| } | |||