瀏覽代碼

change the type property

tags/2.4.0
Caven Chen 4 年之前
父節點
當前提交
b45903880c

+ 8
- 0
modules/animation/AnimationType.js 查看文件

@@ -0,0 +1,8 @@
/**
* @Author: Caven
* @Date: 2021-08-01 00:12:06
*/

let AnimationType = {}

export default AnimationType

+ 1
- 0
modules/animation/index.js 查看文件

@@ -4,6 +4,7 @@
*/

export { default as Animation } from './Animation'
export { default as AnimationType } from './AnimationType'

/**
* types

+ 7
- 1
modules/animation/type/AroundPoint.js 查看文件

@@ -6,6 +6,7 @@
import { Cesium } from '@dc-modules/namespace'
import { Transform } from '@dc-modules/transform'
import Parse from '@dc-modules/parse/Parse'
import AnimationType from '../AnimationType'

import Animation from '../Animation'

@@ -16,7 +17,10 @@ class AroundPoint extends Animation {
this._options = options
this._heading = viewer.camera.heading
this._aroundAmount = 0.2
this.type = 'around_point'
}

get type() {
return AnimationType.AROUND_POINT
}

set position(position) {
@@ -68,4 +72,6 @@ class AroundPoint extends Animation {
}
}

AnimationType.AROUND_POINT = 'around_point'

export default AroundPoint

+ 7
- 1
modules/animation/type/AroundView.js 查看文件

@@ -5,6 +5,7 @@

import { Cesium } from '@dc-modules/namespace'
import Animation from '../Animation'
import AnimationType from '../AnimationType'

class AroundView extends Animation {
constructor(viewer, options = {}) {
@@ -12,7 +13,10 @@ class AroundView extends Animation {
this._options = options
this._heading = viewer.camera.heading
this._aroundAmount = 0.2
this.type = 'around_view'
}

get type() {
return AnimationType.AROUND_VIEW
}

set aroundAmount(aroundAmount) {
@@ -56,4 +60,6 @@ class AroundView extends Animation {
}
}

AnimationType.AROUND_VIEW = 'around_view'

export default AroundView

+ 7
- 1
modules/animation/type/CircleScan.js 查看文件

@@ -8,6 +8,7 @@ import Parse from '@dc-modules/parse/Parse'
import { Util } from '@dc-modules/utils'
import { Transform } from '@dc-modules/transform'
import Animation from '../Animation'
import AnimationType from '../AnimationType'

const CircleScanShader = require('@dc-modules/material/shader/circle/CircleScanShader.glsl')

@@ -19,7 +20,10 @@ class CircleScan extends Animation {
this._radius = radius || 100
this._color = options.color || Cesium.Color.RED
this._speed = options.speed || 2
this.type = 'circle_scan'
}

get type() {
return AnimationType.CIRCLE_SCAN
}

/**
@@ -78,4 +82,6 @@ class CircleScan extends Animation {
}
}

AnimationType.CIRCLE_SCAN = 'circle_scan'

export default CircleScan

+ 7
- 0
modules/animation/type/Flying.js 查看文件

@@ -7,6 +7,7 @@ import { Cesium } from '@dc-modules/namespace'
import Parse from '@dc-modules/parse/Parse'
import { Transform } from '@dc-modules/transform'
import Animation from '../Animation'
import AnimationType from '../AnimationType'

class Flying extends Animation {
constructor(viewer, options = {}) {
@@ -18,6 +19,10 @@ class Flying extends Animation {
this._timer = undefined
}

get type() {
return AnimationType.FLYING
}

set positions(positions) {
this._positions = Parse.parsePositions(positions)
return this
@@ -112,4 +117,6 @@ class Flying extends Animation {
}
}

AnimationType.FLYING = 'flying'

export default Flying

+ 7
- 1
modules/animation/type/GlobeRotate.js 查看文件

@@ -5,12 +5,16 @@

import { Cesium } from '@dc-modules/namespace'
import Animation from '../Animation'
import AnimationType from '../AnimationType'

class GlobeRotate extends Animation {
constructor(viewer, options = {}) {
super(viewer)
this._options = options
this.type = 'globe_rotate'
}

get type() {
return AnimationType.GLOBE_ROTATE
}

/**
@@ -53,4 +57,6 @@ class GlobeRotate extends Animation {
}
}

AnimationType.GLOBE_ROTATE = 'globe_rotate'

export default GlobeRotate

+ 7
- 1
modules/animation/type/RadarScan.js 查看文件

@@ -8,6 +8,7 @@ import Parse from '@dc-modules/parse/Parse'
import { Util } from '@dc-modules/utils'
import { Transform } from '@dc-modules/transform'
import Animation from '../Animation'
import AnimationType from '../AnimationType'

const RadarScanShader = require('@dc-modules/material/shader/radar/RadarScanShader.glsl')

@@ -19,7 +20,10 @@ class RadarScan extends Animation {
this._color = options.color || Cesium.Color.BLUE
this._speed = options.speed || 3
this._delegate = undefined
this.type = 'radar_scan'
}

get type() {
return AnimationType.RADAR_SCAN
}

/**
@@ -92,4 +96,6 @@ class RadarScan extends Animation {
}
}

AnimationType.RADAR_SCAN = 'radar_scan'

export default RadarScan

+ 2
- 0
packages/core/src/components.js 查看文件

@@ -147,6 +147,7 @@ import Effect from '@dc-modules/effect/Effect'
* animation
*/
import {
AnimationType,
AroundView,
AroundPoint,
CircleScan,
@@ -346,6 +347,7 @@ const components = {
/**
* animation
*/
AnimationType,
AroundView,
AroundPoint,
CircleScan,

Loading…
取消
儲存