Browse Source

change the type property

tags/2.4.0
Caven Chen 4 years ago
parent
commit
c530793913
75 changed files with 343 additions and 130 deletions
  1. 4
    0
      modules/heat/HeatLayer.js
  2. 0
    1
      modules/layer/Layer.js
  3. 4
    1
      modules/layer/LayerGroup.js
  4. 5
    1
      modules/layer/type/ClusterLayer.js
  5. 4
    1
      modules/layer/type/CzmlLayer.js
  6. 4
    1
      modules/layer/type/DynamicLayer.js
  7. 5
    2
      modules/layer/type/FeatureGridLayer.js
  8. 4
    1
      modules/layer/type/GeoJsonLayer.js
  9. 4
    1
      modules/layer/type/HtmlLayer.js
  10. 4
    1
      modules/layer/type/KmlLayer.js
  11. 4
    1
      modules/layer/type/LabelLayer.js
  12. 7
    1
      modules/layer/type/PrimitiveLayer.js
  13. 4
    1
      modules/layer/type/TilesetLayer.js
  14. 5
    1
      modules/layer/type/TopoJsonLayer.js
  15. 4
    1
      modules/layer/type/VectorLayer.js
  16. 6
    1
      modules/mapv/MapvLayer.js
  17. 11
    6
      modules/overlay/Overlay.js
  18. 5
    1
      modules/overlay/custom/CustomBillboard.js
  19. 5
    2
      modules/overlay/custom/CustomLabel.js
  20. 4
    1
      modules/overlay/dynamic/DynamicBillboard.js
  21. 4
    1
      modules/overlay/dynamic/DynamicModel.js
  22. 4
    1
      modules/overlay/html/DivIcon.js
  23. 5
    2
      modules/overlay/model/Model.js
  24. 4
    1
      modules/overlay/model/Tileset.js
  25. 4
    1
      modules/overlay/plot/AttackArrow.js
  26. 4
    1
      modules/overlay/plot/DoubleArrow.js
  27. 4
    1
      modules/overlay/plot/FineArrow.js
  28. 4
    1
      modules/overlay/plot/GatheringPlace.js
  29. 4
    1
      modules/overlay/plot/TailedAttackArrow.js
  30. 4
    1
      modules/overlay/primitive/BillboardPrimitive.js
  31. 16
    21
      modules/overlay/primitive/BounceBillboardPrimitive.js
  32. 16
    21
      modules/overlay/primitive/BounceLabelPrimitive.js
  33. 4
    1
      modules/overlay/primitive/DiffuseWallPrimitive.js
  34. 4
    1
      modules/overlay/primitive/ElecEllipsoidPrimitive.js
  35. 4
    1
      modules/overlay/primitive/FlowLinePrimitive.js
  36. 4
    1
      modules/overlay/primitive/LabelPrimitive.js
  37. 4
    1
      modules/overlay/primitive/ModelPrimitive.js
  38. 5
    1
      modules/overlay/primitive/PointPrimitive.js
  39. 4
    1
      modules/overlay/primitive/PolylinePrimitive.js
  40. 4
    1
      modules/overlay/primitive/ScanCirclePrimitive.js
  41. 4
    1
      modules/overlay/primitive/TrailLinePrimitive.js
  42. 4
    1
      modules/overlay/primitive/VideoPrimitive.js
  43. 4
    1
      modules/overlay/primitive/WaterPrimitive.js
  44. 4
    1
      modules/overlay/vector/Billboard.js
  45. 4
    1
      modules/overlay/vector/Box.js
  46. 5
    2
      modules/overlay/vector/Circle.js
  47. 4
    1
      modules/overlay/vector/Corridor.js
  48. 4
    1
      modules/overlay/vector/Cylinder.js
  49. 4
    1
      modules/overlay/vector/Ellipse.js
  50. 4
    1
      modules/overlay/vector/Ellipsoid.js
  51. 4
    1
      modules/overlay/vector/Label.js
  52. 4
    1
      modules/overlay/vector/Plane.js
  53. 4
    1
      modules/overlay/vector/Point.js
  54. 4
    1
      modules/overlay/vector/Polygon.js
  55. 4
    1
      modules/overlay/vector/Polyline.js
  56. 4
    1
      modules/overlay/vector/PolylineVolume.js
  57. 4
    1
      modules/overlay/vector/Rectangle.js
  58. 4
    1
      modules/overlay/vector/Wall.js
  59. 4
    1
      modules/weather/type/Cloud.js
  60. 4
    1
      modules/weather/type/Fog.js
  61. 4
    1
      modules/weather/type/Rain.js
  62. 4
    1
      modules/weather/type/Snow.js
  63. 0
    1
      modules/widget/Widget.js
  64. 6
    3
      modules/widget/type/Compass.js
  65. 6
    3
      modules/widget/type/ContextMenu.js
  66. 4
    1
      modules/widget/type/DistanceLegend.js
  67. 4
    1
      modules/widget/type/HawkeyeMap.js
  68. 4
    1
      modules/widget/type/LoadingMask.js
  69. 4
    1
      modules/widget/type/LocationBar.js
  70. 4
    1
      modules/widget/type/MapSplit.js
  71. 4
    1
      modules/widget/type/MapSwitch.js
  72. 4
    1
      modules/widget/type/Popup.js
  73. 4
    1
      modules/widget/type/Tooltip.js
  74. 7
    4
      modules/widget/type/ZoomController.js
  75. 4
    1
      modules/wind/WindLayer.js

+ 4
- 0
modules/heat/HeatLayer.js View File

this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('heat')
}

/** /**
* *
* @private * @private

+ 0
- 1
modules/layer/Layer.js View File

this._layerEvent.on(LayerEventType.ADD, this._onAdd, this) this._layerEvent.on(LayerEventType.ADD, this._onAdd, this)
this._layerEvent.on(LayerEventType.REMOVE, this._onRemove, this) this._layerEvent.on(LayerEventType.REMOVE, this._onRemove, this)
this._state = undefined this._state = undefined
this.type = undefined
} }


get layerId() { get layerId() {

+ 4
- 1
modules/layer/LayerGroup.js View File

this._layerGroupEvent = new LayerGroupEvent() this._layerGroupEvent = new LayerGroupEvent()
this._layerGroupEvent.on(LayerGroupEventType.ADD, this._onAdd, this) this._layerGroupEvent.on(LayerGroupEventType.ADD, this._onAdd, this)
this._layerGroupEvent.on(LayerGroupEventType.REMOVE, this._onRemove, this) this._layerGroupEvent.on(LayerGroupEventType.REMOVE, this._onRemove, this)
this.type = Layer.getLayerType('layer_group')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


return this._id return this._id
} }


get type() {
return Layer.getLayerType('layer_group')
}

set show(show) { set show(show) {
this._show = show this._show = show
Object.keys(this._cache).forEach(key => { Object.keys(this._cache).forEach(key => {

+ 5
- 1
modules/layer/type/ClusterLayer.js View File

this this
) )
this._delegate.clustering.pixelRange = this._options.pixelRange this._delegate.clustering.pixelRange = this._options.pixelRange
this.type = Layer.getLayerType('cluster')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('cluster')
}

set enableCluster(enableCluster) { set enableCluster(enableCluster) {
this._delegate.clustering.enabled = enableCluster this._delegate.clustering.enabled = enableCluster
return this return this

+ 4
- 1
modules/layer/type/CzmlLayer.js View File

constructor(id, url = '', options = {}) { constructor(id, url = '', options = {}) {
super(id) super(id)
this._delegate = Cesium.CzmlDataSource.load(url, options) this._delegate = Cesium.CzmlDataSource.load(url, options)
this.type = Layer.getLayerType('czml')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('czml')
}

set show(show) { set show(show) {
this._show = show this._show = show
this._delegate && this._delegate &&

+ 4
- 1
modules/layer/type/DynamicLayer.js View File

constructor(id) { constructor(id) {
super(id) super(id)
this._delegate = new Cesium.CustomDataSource(id) this._delegate = new Cesium.CustomDataSource(id)
this.type = Layer.getLayerType('dynamic')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('dynamic')
}

/** /**
* Clears all entities * Clears all entities
* @returns {DynamicLayer} * @returns {DynamicLayer}

+ 5
- 2
modules/layer/type/FeatureGridLayer.js View File

count: 10, count: 10,
maximumLevel: 21, maximumLevel: 21,
dataProperty: '', dataProperty: '',
callback: record => {
callback: () => {
return null return null
} }
} }
this._rectangle = this._tilingScheme.rectangle this._rectangle = this._tilingScheme.rectangle
this._credit = undefined this._credit = undefined
this._token = undefined this._token = undefined
this.type = Layer.getLayerType('feature_grid')
for (let i = 0; i < this.maximumLevel; i++) { for (let i = 0; i < this.maximumLevel; i++) {
this._levelLayers[String(i)] = new VectorLayer(id + '-grid-' + i) this._levelLayers[String(i)] = new VectorLayer(id + '-grid-' + i)
} }
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('feature_grid')
}

get url() { get url() {
return this._url return this._url
} }

+ 4
- 1
modules/layer/type/GeoJsonLayer.js View File

} }
super(id) super(id)
this._delegate = Cesium.GeoJsonDataSource.load(url, options) this._delegate = Cesium.GeoJsonDataSource.load(url, options)
this.type = Layer.getLayerType('geojson')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('geojson')
}

set show(show) { set show(show) {
this._show = show this._show = show
this._delegate && this._delegate &&

+ 4
- 1
modules/layer/type/HtmlLayer.js View File

this._delegate = DomUtil.create('div', 'html-layer', undefined) this._delegate = DomUtil.create('div', 'html-layer', undefined)
this._delegate.setAttribute('id', this._id) this._delegate.setAttribute('id', this._id)
this._renderRemoveCallback = undefined this._renderRemoveCallback = undefined
this.type = Layer.getLayerType('html')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('html')
}

set show(show) { set show(show) {
this._show = show this._show = show
this._delegate.style.visibility = this._show ? 'visible' : 'hidden' this._delegate.style.visibility = this._show ? 'visible' : 'hidden'

+ 4
- 1
modules/layer/type/KmlLayer.js View File

} }
super(id) super(id)
this._delegate = Cesium.KmlDataSource.load(url, options) this._delegate = Cesium.KmlDataSource.load(url, options)
this.type = Layer.getLayerType('kml')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('kml')
}

set show(show) { set show(show) {
this._show = show this._show = show
this._delegate && this._delegate &&

+ 4
- 1
modules/layer/type/LabelLayer.js View File

this._dataSource = Cesium.GeoJsonDataSource.load(url) this._dataSource = Cesium.GeoJsonDataSource.load(url)
this._delegate = new Cesium.CustomDataSource(id) this._delegate = new Cesium.CustomDataSource(id)
this._initLabel() this._initLabel()
this.type = Layer.registerType('label')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('label')
}

_createLabel(entity) { _createLabel(entity) {
if (entity.position && entity.name) { if (entity.position && entity.name) {
return Label.fromEntity(entity) return Label.fromEntity(entity)

+ 7
- 1
modules/layer/type/PrimitiveLayer.js View File

import State from '@dc-modules/state/State' import State from '@dc-modules/state/State'
import Layer from '../Layer' import Layer from '../Layer'


/**
* PrimitiveLayer is used to add primitve
*/
class PrimitiveLayer extends Layer { class PrimitiveLayer extends Layer {
constructor(id) { constructor(id) {
super(id) super(id)
this._labels = this._delegate.add(new Cesium.LabelCollection()) this._labels = this._delegate.add(new Cesium.LabelCollection())
this._billboards = this._delegate.add(new Cesium.BillboardCollection()) this._billboards = this._delegate.add(new Cesium.BillboardCollection())
this._polylines = this._delegate.add(new Cesium.PolylineCollection()) this._polylines = this._delegate.add(new Cesium.PolylineCollection())
this.type = Layer.getLayerType('primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('primitive')
}

get points() { get points() {
return this._points return this._points
} }

+ 4
- 1
modules/layer/type/TilesetLayer.js View File

constructor(id) { constructor(id) {
super(id) super(id)
this._delegate = new Cesium.PrimitiveCollection() this._delegate = new Cesium.PrimitiveCollection()
this.type = Layer.getLayerType('tileset')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('tileset')
}

/** /**
* Clear all tileset * Clear all tileset
* @returns {TilesetLayer} * @returns {TilesetLayer}

+ 5
- 1
modules/layer/type/TopoJsonLayer.js View File



import State from '@dc-modules/state/State' import State from '@dc-modules/state/State'
import GeoJsonLayer from './GeoJsonLayer' import GeoJsonLayer from './GeoJsonLayer'
import Layer from '../Layer'


class TopoJsonLayer extends GeoJsonLayer { class TopoJsonLayer extends GeoJsonLayer {
constructor(id, url, options = {}) { constructor(id, url, options = {}) {
throw new Error('TopoJsonLayer:the url invalid') throw new Error('TopoJsonLayer:the url invalid')
} }
super(id, url, options) super(id, url, options)
this.type = GeoJsonLayer.getLayerType('topojson')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }

get type() {
return Layer.getLayerType('topojson')
}
} }


GeoJsonLayer.registerType('topojson') GeoJsonLayer.registerType('topojson')

+ 4
- 1
modules/layer/type/VectorLayer.js View File

constructor(id) { constructor(id) {
super(id) super(id)
this._delegate = new Cesium.CustomDataSource(id) this._delegate = new Cesium.CustomDataSource(id)
this.type = Layer.getLayerType('vector')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('vector')
}

/** /**
* Clears all entities * Clears all entities
* @returns {VectorLayer} * @returns {VectorLayer}

+ 6
- 1
modules/mapv/MapvLayer.js View File

import { mapv } from '@dc-modules/namespace' import { mapv } from '@dc-modules/namespace'
import State from '@dc-modules/state/State' import State from '@dc-modules/state/State'
import { Layer } from '@dc-modules/layer' import { Layer } from '@dc-modules/layer'
import Overlay from '../overlay/Overlay'


class MapvLayer extends Layer { class MapvLayer extends Layer {
constructor(id, option = {}) { constructor(id, option = {}) {
this._option = option this._option = option
this._dataSet = undefined this._dataSet = undefined
this._delegate = undefined this._delegate = undefined
this.type = Layer.getLayerType('mapv')
this._state = State.INITIALIZED
}

get type() {
return Overlay.getOverlayType('mapv')
} }


set show(show) { set show(show) {

+ 11
- 6
modules/overlay/Overlay.js View File

this._allowDrillPicking = false this._allowDrillPicking = false
this._contextMenu = [] this._contextMenu = []
this._overlayEvent = new OverlayEvent() this._overlayEvent = new OverlayEvent()
this.type = undefined
this.on(OverlayEventType.ADD, this._onAdd, this) this.on(OverlayEventType.ADD, this._onAdd, this)
this.on(OverlayEventType.REMOVE, this._onRemove, this) this.on(OverlayEventType.REMOVE, this._onRemove, this)
} }
this._layer.delegate.entities.add(this._delegate) this._layer.delegate.entities.add(this._delegate)
} else if (this._layer?.delegate?.add && this._delegate) { } else if (this._layer?.delegate?.add && this._delegate) {
// for Primitive // for Primitive
if (this.type === 'point_primitive' && this._layer.points) {
if (this.type && this.type === 'point_primitive' && this._layer.points) {
this._delegate = this._layer.points.add(this._delegate) this._delegate = this._layer.points.add(this._delegate)
} else if ( } else if (
this.type === 'billboard_primitive' &&
this.type.indexOf('billboard_primitive') >= 0 &&
this._layer.billboards this._layer.billboards
) { ) {
this._delegate = this._layer.billboards.add(this._delegate) this._delegate = this._layer.billboards.add(this._delegate)
} else if (this.type === 'polyline_primitive' && this._layer.polylines) { } else if (this.type === 'polyline_primitive' && this._layer.polylines) {
this._delegate = this._layer.polylines.add(this._delegate) this._delegate = this._layer.polylines.add(this._delegate)
} else if (this.type === 'label_primitive' && this._layer.labels) {
} else if (
this.type.indexOf('label_primitive') >= 0 &&
this._layer.labels
) {
this._delegate = this._layer.labels.add(this._delegate) this._delegate = this._layer.labels.add(this._delegate)
} else { } else {
this._layer.delegate.add(this._delegate) this._layer.delegate.add(this._delegate)
if (this.type === 'point_primitive' && this._layer.points) { if (this.type === 'point_primitive' && this._layer.points) {
this._layer.points.remove(this._delegate) this._layer.points.remove(this._delegate)
} else if ( } else if (
this.type === 'billboard_primitive' &&
this.type.indexOf('billboard_primitive') >= 0 &&
this._layer.billboards this._layer.billboards
) { ) {
this._layer.billboards.remove(this._delegate) this._layer.billboards.remove(this._delegate)
} else if (this.type === 'polyline_primitive' && this._layer.polylines) { } else if (this.type === 'polyline_primitive' && this._layer.polylines) {
this._layer.polylines.remove(this._delegate) this._layer.polylines.remove(this._delegate)
} else if (this.type === 'label_primitive' && this._layer.labels) {
} else if (
this.type.indexOf('label_primitive') >= 0 &&
this._layer.labels
) {
this._layer.labels.remove(this._delegate) this._layer.labels.remove(this._delegate)
} else { } else {
this._layer.delegate.remove(this._delegate) this._layer.delegate.remove(this._delegate)

+ 5
- 1
modules/overlay/custom/CustomBillboard.js View File

this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('custom_billboard')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(
...style, ...style,
semiMajorAxis: radius, semiMajorAxis: radius,
semiMinorAxis: radius, semiMinorAxis: radius,
stRotation: new Cesium.CallbackProperty(time => {
stRotation: new Cesium.CallbackProperty(() => {
stRotation += amount stRotation += amount
if (stRotation >= 360 || stRotation <= -360) { if (stRotation >= 360 || stRotation <= -360) {
stRotation = 0 stRotation = 0

+ 5
- 2
modules/overlay/custom/CustomLabel.js View File

this._delegate = new Cesium.Entity({ label: {} }) this._delegate = new Cesium.Entity({ label: {} })
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._text = text this._text = text
this.type = Overlay.getOverlayType('custom_label')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('custom_label')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(
...style, ...style,
semiMajorAxis: radius, semiMajorAxis: radius,
semiMinorAxis: radius, semiMinorAxis: radius,
stRotation: new Cesium.CallbackProperty(time => {
stRotation: new Cesium.CallbackProperty(() => {
stRotation += amount stRotation += amount
if (stRotation >= 360 || stRotation <= -360) { if (stRotation >= 360 || stRotation <= -360) {
stRotation = 0 stRotation = 0

+ 4
- 1
modules/overlay/dynamic/DynamicBillboard.js View File

this._posistion = Parse.parsePosition(position) this._posistion = Parse.parsePosition(position)
this._icon = icon this._icon = icon
this._delegate = new Cesium.Entity({ billboard: {} }) this._delegate = new Cesium.Entity({ billboard: {} })
this.type = Overlay.getOverlayType('dynamic_billboard')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('dynamic_billboard')
}

set icon(icon) { set icon(icon) {
this._icon = icon this._icon = icon
this._delegate.billboard.image = this._icon this._delegate.billboard.image = this._icon

+ 4
- 1
modules/overlay/dynamic/DynamicModel.js View File

this._posistion = Parse.parsePosition(position) this._posistion = Parse.parsePosition(position)
this._modelUrl = modelUrl this._modelUrl = modelUrl
this._delegate = new Cesium.Entity({ model: {} }) this._delegate = new Cesium.Entity({ model: {} })
this.type = Overlay.getOverlayType('dynamic_model')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('dynamic_model')
}

set modelUrl(modelUrl) { set modelUrl(modelUrl) {
this._modelUrl = modelUrl this._modelUrl = modelUrl
this._delegate.model.uri = this._modelUrl this._delegate.model.uri = this._modelUrl

+ 4
- 1
modules/overlay/html/DivIcon.js View File

left: '0' left: '0'
}) })
this.content = content this.content = content
this.type = Overlay.getOverlayType('div_icon')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('div_icon')
}

set show(show) { set show(show) {
this._show = show this._show = show
this._delegate.style.visibility = this._show ? 'visible' : 'hidden' this._delegate.style.visibility = this._show ? 'visible' : 'hidden'

+ 5
- 2
modules/overlay/model/Model.js View File

this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._modelUrl = modelUrl this._modelUrl = modelUrl
this._rotateAmount = 0 this._rotateAmount = 0
this.type = Overlay.getOverlayType('model')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('model')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(


set rotateAmount(amount) { set rotateAmount(amount) {
this._rotateAmount = +amount this._rotateAmount = +amount
this._delegate.orientation = new Cesium.CallbackProperty(time => {
this._delegate.orientation = new Cesium.CallbackProperty(() => {
this._position.heading += this._rotateAmount this._position.heading += this._rotateAmount
if (this._position.heading >= 360 || this._position.heading <= -360) { if (this._position.heading >= 360 || this._position.heading <= -360) {
this._position.heading = 0 this._position.heading = 0

+ 4
- 1
modules/overlay/model/Tileset.js View File

this._tileVisibleCallback = undefined this._tileVisibleCallback = undefined
this._properties = undefined this._properties = undefined
this._customShader = undefined this._customShader = undefined
this.type = Overlay.getOverlayType('tileset')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('tileset')
}

get readyPromise() { get readyPromise() {
return this._delegate.readyPromise return this._delegate.readyPromise
} }

+ 4
- 1
modules/overlay/plot/AttackArrow.js View File

this.neckHeightFactor = 0.85 this.neckHeightFactor = 0.85
this.neckWidthFactor = 0.15 this.neckWidthFactor = 0.15
this.headTailFactor = 0.8 this.headTailFactor = 0.8
this.type = Overlay.getOverlayType('attack_arrow')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('attack_arrow')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.polygon.hierarchy = this._getHierarchy() this._delegate.polygon.hierarchy = this._getHierarchy()

+ 4
- 1
modules/overlay/plot/DoubleArrow.js View File

this.headWidthFactor = 0.3 this.headWidthFactor = 0.3
this.neckHeightFactor = 0.85 this.neckHeightFactor = 0.85
this.neckWidthFactor = 0.15 this.neckWidthFactor = 0.15
this.type = Overlay.getOverlayType('double_arrow')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('double_arrow')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.polygon.hierarchy = this._getHierarchy() this._delegate.polygon.hierarchy = this._getHierarchy()

+ 4
- 1
modules/overlay/plot/FineArrow.js View File

this.headWidthFactor = 0.25 this.headWidthFactor = 0.25
this.headAngle = Math.PI / 8.5 this.headAngle = Math.PI / 8.5
this.neckAngle = Math.PI / 13 this.neckAngle = Math.PI / 13
this.type = Overlay.getOverlayType('fine_arrow')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('fine_arrow')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.polygon.hierarchy = this._getHierarchy() this._delegate.polygon.hierarchy = this._getHierarchy()

+ 4
- 1
modules/overlay/plot/GatheringPlace.js View File

this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate = new Cesium.Entity({ polygon: {} }) this._delegate = new Cesium.Entity({ polygon: {} })
this.t = 0.4 this.t = 0.4
this.type = Overlay.getOverlayType('gathering_place')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('gathering_place')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.polygon.hierarchy = this._getHierarchy() this._delegate.polygon.hierarchy = this._getHierarchy()

+ 4
- 1
modules/overlay/plot/TailedAttackArrow.js View File

this.tailWidthFactor = 0.1 this.tailWidthFactor = 0.1
this.headTailFactor = 0.8 this.headTailFactor = 0.8
this.swallowTailFactor = 1 this.swallowTailFactor = 1
this.type = Overlay.getOverlayType('tailed_attack_arrow')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('tailed_attack_arrow')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.polygon.hierarchy = this._getHierarchy() this._delegate.polygon.hierarchy = this._getHierarchy()

+ 4
- 1
modules/overlay/primitive/BillboardPrimitive.js View File

width: 0, width: 0,
height: 0 height: 0
} }
this.type = Overlay.getOverlayType('billboard_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('billboard_primitive')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 16
- 21
modules/overlay/primitive/BounceBillboardPrimitive.js View File



import { Cesium } from '@dc-modules/namespace' import { Cesium } from '@dc-modules/namespace'
import State from '@dc-modules/state/State' import State from '@dc-modules/state/State'
import { Util } from '@dc-modules/utils'
import Overlay from '../Overlay' import Overlay from '../Overlay'
import BillboardPrimitive from './BillboardPrimitive' import BillboardPrimitive from './BillboardPrimitive'


super(position, icon) super(position, icon)
this._currentOffset = new Cesium.Cartesian2(0, 0) this._currentOffset = new Cesium.Cartesian2(0, 0)
this._isUp = true this._isUp = true
this.type = Overlay.getOverlayType('bounce_billboard_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('bounce_billboard_primitive')
}

/** /**
* *
* @param layer
* @private * @private
*/ */
_onAdd(layer) {
if (!layer) {
_addedHook() {
if (!this._delegate || !this._layer) {
return return
} }
this._layer = layer
this._mountedHook && this._mountedHook()
if (this._layer?.delegate?.add && this._delegate) {
this._delegate = this._layer.billboards.add(this._delegate)
this._layer.delegate.add(this)
}
this._addedHook && this._addedHook()
this._state = State.ADDED
this._delegate.layerId = this._layer?.layerId
this._delegate.overlayId = this._id
this._layer.delegate.add(this)
} }


_onRemove() {
if (!this._layer || !this._delegate) {
/**
*
* @private
*/
_removedHook() {
if (!this._layer) {
return return
} }
if (this._layer?.delegate?.remove) {
this._layer.billboards.remove(this._delegate)
this._layer.delegate.remove(this)
}
this._removedHook && this._removedHook()
this._state = State.REMOVED
this._layer.delegate.remove(this)
} }


/** /**

+ 16
- 21
modules/overlay/primitive/BounceLabelPrimitive.js View File



import { Cesium } from '@dc-modules/namespace' import { Cesium } from '@dc-modules/namespace'
import State from '@dc-modules/state/State' import State from '@dc-modules/state/State'
import { Util } from '@dc-modules/utils'
import Overlay from '../Overlay' import Overlay from '../Overlay'
import LabelPrimitive from './LabelPrimitive' import LabelPrimitive from './LabelPrimitive'


super(position, text) super(position, text)
this._currentOffset = new Cesium.Cartesian2(0, 0) this._currentOffset = new Cesium.Cartesian2(0, 0)
this._isUp = true this._isUp = true
this.type = Overlay.getOverlayType('bounce_label_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('bounce_label_primitive')
}

/** /**
* *
* @param layer
* @private * @private
*/ */
_onAdd(layer) {
if (!layer) {
_addedHook() {
if (!this._delegate || !this._layer) {
return return
} }
this._layer = layer
this._mountedHook && this._mountedHook()
if (this._layer?.delegate?.add && this._delegate) {
this._delegate = this._layer.labels.add(this._delegate)
this._layer.delegate.add(this)
}
this._addedHook && this._addedHook()
this._state = State.ADDED
this._delegate.layerId = this._layer?.layerId
this._delegate.overlayId = this._id
this._layer.delegate.add(this)
} }


_onRemove() {
if (!this._layer || !this._delegate) {
/**
*
* @private
*/
_removedHook() {
if (!this._layer) {
return return
} }
if (this._layer?.delegate?.remove) {
this._layer.labels.remove(this._delegate)
this._layer.delegate.remove(this)
}
this._removedHook && this._removedHook()
this._state = State.REMOVED
this._layer.delegate.remove(this)
} }


/** /**

+ 4
- 1
modules/overlay/primitive/DiffuseWallPrimitive.js View File

this._currentHeight = height || 0 this._currentHeight = height || 0
this._currentRadius = 10 this._currentRadius = 10
this._style = { ...DEF_STYLE } this._style = { ...DEF_STYLE }
this.type = Overlay.getOverlayType('diffuse_wall_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('diffuse_wall_primitive')
}

set center(position) { set center(position) {
this._center = Parse.parsePosition(position) this._center = Parse.parsePosition(position)
return this return this

+ 4
- 1
modules/overlay/primitive/ElecEllipsoidPrimitive.js View File

geometry: {} geometry: {}
}) })
}) })
this.type = Overlay.getOverlayType('elec_ellipsoid_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('elec_ellipsoid_primitive')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.geometryInstances.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( this._delegate.geometryInstances.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(

+ 4
- 1
modules/overlay/primitive/FlowLinePrimitive.js View File

geometry: {} geometry: {}
}) })
}) })
this.type = Overlay.getOverlayType('flow_line_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('flow_line_primitive')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.geometryInstances.geometry = new Cesium.PolylineGeometry({ this._delegate.geometryInstances.geometry = new Cesium.PolylineGeometry({

+ 4
- 1
modules/overlay/primitive/LabelPrimitive.js View File

position: undefined, position: undefined,
text: undefined text: undefined
} }
this.type = Overlay.getOverlayType('label_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('label_primitive')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 4
- 1
modules/overlay/primitive/ModelPrimitive.js View File

this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._modelUrl = modelUrl this._modelUrl = modelUrl
this._delegate = Cesium.Model.fromGltf({ url: modelUrl }) this._delegate = Cesium.Model.fromGltf({ url: modelUrl })
this.type = Overlay.getOverlayType('model_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('model_primitive')
}

get readyPromise() { get readyPromise() {
return this._delegate.readyPromise return this._delegate.readyPromise
} }

+ 5
- 1
modules/overlay/primitive/PointPrimitive.js View File

constructor(position) { constructor(position) {
super() super()
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this.type = Overlay.getOverlayType('point_primitive')
this._delegate = { this._delegate = {
position: undefined position: undefined
} }
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('point_primitive')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 4
- 1
modules/overlay/primitive/PolylinePrimitive.js View File

this._delegate = { this._delegate = {
positions: [] positions: []
} }
this.type = Overlay.getOverlayType('polyline_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('polyline_primitive')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.positions = Transform.transformWGS84ArrayToCartesianArray( this._delegate.positions = Transform.transformWGS84ArrayToCartesianArray(

+ 4
- 1
modules/overlay/primitive/ScanCirclePrimitive.js View File

geometry: {} geometry: {}
}) })
}) })
this.type = Overlay.getOverlayType('scan_circle_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('scan_circle_primitive')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.geometryInstances.geometry = new Cesium.EllipseGeometry({ this._delegate.geometryInstances.geometry = new Cesium.EllipseGeometry({

+ 4
- 1
modules/overlay/primitive/TrailLinePrimitive.js View File

geometry: {} geometry: {}
}) })
}) })
this.type = Overlay.getOverlayType('trail_line_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('trail_line_primitive')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.geometryInstances.geometry = new Cesium.PolylineGeometry({ this._delegate.geometryInstances.geometry = new Cesium.PolylineGeometry({

+ 4
- 1
modules/overlay/primitive/VideoPrimitive.js View File

}) })
}) })
this._video = video this._video = video
this.type = Overlay.getOverlayType('video_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('video_primitive')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.geometryInstances.geometry = Cesium.PolygonGeometry.fromPositions( this._delegate.geometryInstances.geometry = Cesium.PolygonGeometry.fromPositions(

+ 4
- 1
modules/overlay/primitive/WaterPrimitive.js View File

}), }),
asynchronous: true asynchronous: true
}) })
this.type = Overlay.getOverlayType('water_primitive')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('water_primitive')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.geometryInstances.geometry = Cesium.PolygonGeometry.fromPositions( this._delegate.geometryInstances.geometry = Cesium.PolygonGeometry.fromPositions(

+ 4
- 1
modules/overlay/vector/Billboard.js View File

this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._icon = icon this._icon = icon
this._size = [32, 32] this._size = [32, 32]
this.type = Overlay.getOverlayType('billboard')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('billboard')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 4
- 1
modules/overlay/vector/Box.js View File

} }
} }
}) })
this.type = Overlay.getOverlayType('box')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('box')
}

/** /**
* *
* @param position * @param position

+ 5
- 2
modules/overlay/vector/Circle.js View File

this._radius = +radius || 0 this._radius = +radius || 0
this._rotateAmount = 0 this._rotateAmount = 0
this._stRotation = 0 this._stRotation = 0
this.type = Overlay.getOverlayType('circle')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('circle')
}

set center(center) { set center(center) {
this._center = Parse.parsePosition(center) this._center = Parse.parsePosition(center)
this._delegate.polygon.hierarchy = this._computeHierarchy() this._delegate.polygon.hierarchy = this._computeHierarchy()


set rotateAmount(amount) { set rotateAmount(amount) {
this._rotateAmount = +amount this._rotateAmount = +amount
this._delegate.polygon.stRotation = new Cesium.CallbackProperty(time => {
this._delegate.polygon.stRotation = new Cesium.CallbackProperty(() => {
this._stRotation += this._rotateAmount this._stRotation += this._rotateAmount
if (this._stRotation >= 360 || this._stRotation <= -360) { if (this._stRotation >= 360 || this._stRotation <= -360) {
this._stRotation = 0 this._stRotation = 0

+ 4
- 1
modules/overlay/vector/Corridor.js View File

super() super()
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate = new Cesium.Entity({ corridor: {} }) this._delegate = new Cesium.Entity({ corridor: {} })
this.type = Overlay.getOverlayType('corridor')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('corridor')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.corridor.positions = Transform.transformWGS84ArrayToCartesianArray( this._delegate.corridor.positions = Transform.transformWGS84ArrayToCartesianArray(

+ 4
- 1
modules/overlay/vector/Cylinder.js View File

this._topRadius = +topRadius || 0 this._topRadius = +topRadius || 0
this._bottomRadius = +bottomRadius || 0 this._bottomRadius = +bottomRadius || 0
this._delegate = new Cesium.Entity({ cylinder: {} }) this._delegate = new Cesium.Entity({ cylinder: {} })
this.type = Overlay.getOverlayType('cylinder')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('cylinder')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 4
- 1
modules/overlay/vector/Ellipse.js View File

this._semiMajorAxis = +semiMajorAxis || 0 this._semiMajorAxis = +semiMajorAxis || 0
this._semiMinorAxis = +semiMinorAxis || 0 this._semiMinorAxis = +semiMinorAxis || 0
this._delegate = new Cesium.Entity({ ellipse: {} }) this._delegate = new Cesium.Entity({ ellipse: {} })
this.type = Overlay.getOverlayType('ellipse')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('ellipse')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 4
- 1
modules/overlay/vector/Ellipsoid.js View File

this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._radius = radius || { x: 10, y: 10, z: 10 } this._radius = radius || { x: 10, y: 10, z: 10 }
this._delegate = new Cesium.Entity({ ellipsoid: {} }) this._delegate = new Cesium.Entity({ ellipsoid: {} })
this.type = Overlay.getOverlayType('ellipsoid')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('ellipsoid')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 4
- 1
modules/overlay/vector/Label.js View File

this._delegate = new Cesium.Entity({ label: {} }) this._delegate = new Cesium.Entity({ label: {} })
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._text = text this._text = text
this.type = Overlay.getOverlayType('label')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('label')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 4
- 1
modules/overlay/vector/Plane.js View File

plane: new Cesium.Plane(this._normal, this._distance) plane: new Cesium.Plane(this._normal, this._distance)
} }
}) })
this.type = Overlay.getOverlayType('plane')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('plane')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 4
- 1
modules/overlay/vector/Point.js View File

super() super()
this._delegate = new Cesium.Entity({ point: {} }) this._delegate = new Cesium.Entity({ point: {} })
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this.type = Overlay.getOverlayType('point')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('point')
}

set position(position) { set position(position) {
this._position = Parse.parsePosition(position) this._position = Parse.parsePosition(position)
this._delegate.position = Transform.transformWGS84ToCartesian( this._delegate.position = Transform.transformWGS84ToCartesian(

+ 4
- 1
modules/overlay/vector/Polygon.js View File

this._delegate = new Cesium.Entity({ polygon: {} }) this._delegate = new Cesium.Entity({ polygon: {} })
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._holes = [] this._holes = []
this.type = Overlay.getOverlayType('polygon')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('polygon')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.polygon.hierarchy = this._computeHierarchy() this._delegate.polygon.hierarchy = this._computeHierarchy()

+ 4
- 1
modules/overlay/vector/Polyline.js View File

super() super()
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate = new Cesium.Entity({ polyline: {} }) this._delegate = new Cesium.Entity({ polyline: {} })
this.type = Overlay.getOverlayType('polyline')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('polyline')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.polyline.positions = Transform.transformWGS84ArrayToCartesianArray( this._delegate.polyline.positions = Transform.transformWGS84ArrayToCartesianArray(

+ 4
- 1
modules/overlay/vector/PolylineVolume.js View File

this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._shape = shape || [] this._shape = shape || []
this._delegate = new Cesium.Entity({ polylineVolume: {} }) this._delegate = new Cesium.Entity({ polylineVolume: {} })
this.type = Overlay.getOverlayType('polyline_volume')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('polyline_volume')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.polylineVolume.positions = Transform.transformWGS84ArrayToCartesianArray( this._delegate.polylineVolume.positions = Transform.transformWGS84ArrayToCartesianArray(

+ 4
- 1
modules/overlay/vector/Rectangle.js View File

super() super()
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate = new Cesium.Entity({ rectangle: {} }) this._delegate = new Cesium.Entity({ rectangle: {} })
this.type = Overlay.getOverlayType('rectangle')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('rectangle')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.rectangle.coordinates = Cesium.Rectangle.fromCartesianArray( this._delegate.rectangle.coordinates = Cesium.Rectangle.fromCartesianArray(

+ 4
- 1
modules/overlay/vector/Wall.js View File

super() super()
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate = new Cesium.Entity({ wall: {} }) this._delegate = new Cesium.Entity({ wall: {} })
this.type = Overlay.getOverlayType('wall')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Overlay.getOverlayType('wall')
}

set positions(positions) { set positions(positions) {
this._positions = Parse.parsePositions(positions) this._positions = Parse.parsePositions(positions)
this._delegate.wall.positions = Transform.transformWGS84ArrayToCartesianArray( this._delegate.wall.positions = Transform.transformWGS84ArrayToCartesianArray(

+ 4
- 1
modules/weather/type/Cloud.js View File

this._delegate = undefined this._delegate = undefined
this._rotateAmount = 0 this._rotateAmount = 0
this._enable = false this._enable = false
this.type = 'cloud'
this._heading = 0 this._heading = 0
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return 'cloud'
}

set enable(enable) { set enable(enable) {
if (!this._viewer.scene.mode === Cesium.SceneMode.SCENE3D) { if (!this._viewer.scene.mode === Cesium.SceneMode.SCENE3D) {
return this return this

+ 4
- 1
modules/weather/type/Fog.js View File

this._enable = false this._enable = false
this._fogByDistance = { near: 10, nearValue: 0, far: 2000, farValue: 1.0 } this._fogByDistance = { near: 10, nearValue: 0, far: 2000, farValue: 1.0 }
this._color = new Cesium.Color(0, 0, 0, 1) this._color = new Cesium.Color(0, 0, 0, 1)
this.type = 'fog'
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return 'fog'
}

set enable(enable) { set enable(enable) {
this._enable = enable this._enable = enable
if (enable && this._viewer && !this._delegate) { if (enable && this._viewer && !this._delegate) {

+ 4
- 1
modules/weather/type/Rain.js View File

this._delegate = undefined this._delegate = undefined
this._enable = false this._enable = false
this._speed = 10.0 this._speed = 10.0
this.type = 'rain'
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return 'rain'
}

set enable(enable) { set enable(enable) {
this._enable = enable this._enable = enable
if (enable && this._viewer && !this._delegate) { if (enable && this._viewer && !this._delegate) {

+ 4
- 1
modules/weather/type/Snow.js View File

this._delegate = undefined this._delegate = undefined
this._enable = false this._enable = false
this._speed = 10.0 this._speed = 10.0
this.type = 'snow'
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return 'snow'
}

set enable(enable) { set enable(enable) {
this._enable = enable this._enable = enable
if (enable && this._viewer && !this._delegate) { if (enable && this._viewer && !this._delegate) {

+ 0
- 1
modules/widget/Widget.js View File

this._enable = false this._enable = false
this._wrapper = undefined this._wrapper = undefined
this._ready = false this._ready = false
this.type = undefined
} }


set enable(enable) { set enable(enable) {

+ 6
- 3
modules/widget/type/Compass.js View File

this._rotateFrame = undefined this._rotateFrame = undefined
this._mouseMoveHandle = undefined this._mouseMoveHandle = undefined
this._mouseUpHandle = undefined this._mouseUpHandle = undefined
this.type = Widget.getWidgetType('compass')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('compass')
}

/** /**
* *
* @private * @private
} }
} }


_handleDoubleClick(event) {
_handleDoubleClick() {
let scene = this._viewer.scene let scene = this._viewer.scene
let camera = scene.camera let camera = scene.camera
let sscc = scene.screenSpaceCameraController let sscc = scene.screenSpaceCameraController
this._updateAngleAndOpacity(vector, this._compassRectangle.width) this._updateAngleAndOpacity(vector, this._compassRectangle.width)
} }


_orbitTickFunction(e) {
_orbitTickFunction() {
let scene = this._viewer.scene let scene = this._viewer.scene
let camera = this._viewer.camera let camera = this._viewer.camera
let timestamp = Cesium.getTimestamp() let timestamp = Cesium.getTimestamp()

+ 6
- 3
modules/widget/type/ContextMenu.js View File

this._defaultMenu = [ this._defaultMenu = [
{ {
label: '飞到默认位置', label: '飞到默认位置',
callback: e => {
callback: () => {
this._viewer.camera.flyHome(1.5) this._viewer.camera.flyHome(1.5)
}, },
context: this context: this
}, },
{ {
label: '取消飞行', label: '取消飞行',
callback: e => {
callback: () => {
this._viewer.camera.cancelFlight() this._viewer.camera.cancelFlight()
}, },
context: this context: this
} }
] ]
this._overlayMenu = [] this._overlayMenu = []
this.type = Widget.getWidgetType('contextmenu')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('contextmenu')
}

set DEFAULT_MENU(menus) { set DEFAULT_MENU(menus) {
this._defaultMenu = menus this._defaultMenu = menus
return this return this

+ 4
- 1
modules/widget/type/DistanceLegend.js View File

this._labelEl = undefined this._labelEl = undefined
this._scaleBarEl = undefined this._scaleBarEl = undefined
this._lastUpdate = Cesium.getTimestamp() this._lastUpdate = Cesium.getTimestamp()
this.type = Widget.getWidgetType('distance_legend')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('distance_legend')
}

/** /**
* *
* @private * @private

+ 4
- 1
modules/widget/type/HawkeyeMap.js View File

this._wrapper.setAttribute('id', Util.uuid()) this._wrapper.setAttribute('id', Util.uuid())
this._baseLayers = [] this._baseLayers = []
this._map = undefined this._map = undefined
this.type = Widget.getWidgetType('hawkeye_map')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('hawkeye_map')
}

get baseLayers() { get baseLayers() {
return this._baseLayers return this._baseLayers
} }

+ 4
- 1
modules/widget/type/LoadingMask.js View File

constructor() { constructor() {
super() super()
this._wrapper = DomUtil.create('div', 'dc-loading-mask') this._wrapper = DomUtil.create('div', 'dc-loading-mask')
this.type = Widget.getWidgetType('loading_mask')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('loading_mask')
}

/** /**
* *
* @private * @private

+ 4
- 1
modules/widget/type/LocationBar.js View File

this._wrapper = DomUtil.create('div', 'dc-location-bar') this._wrapper = DomUtil.create('div', 'dc-location-bar')
this._mouseEl = undefined this._mouseEl = undefined
this._cameraEl = undefined this._cameraEl = undefined
this.type = Widget.getWidgetType('location_bar')
this._state = State.INITIALIZED this._state = State.INITIALIZED
this._lastMouseUpdate = Cesium.getTimestamp() this._lastMouseUpdate = Cesium.getTimestamp()
this._lastCameraUpdate = Cesium.getTimestamp() this._lastCameraUpdate = Cesium.getTimestamp()
} }


get type() {
return Widget.getWidgetType('location_bar')
}

/** /**
* *
* @private * @private

+ 4
- 1
modules/widget/type/MapSplit.js View File

this._wrapper = DomUtil.create('div', 'dc-slider') this._wrapper = DomUtil.create('div', 'dc-slider')
this._baseLayer = undefined this._baseLayer = undefined
this._moveActive = false this._moveActive = false
this.type = Widget.getWidgetType('map_split')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('map_split')
}

/** /**
* *
* @private * @private

+ 4
- 1
modules/widget/type/MapSwitch.js View File

this._wrapper = DomUtil.create('div', 'dc-map-switch') this._wrapper = DomUtil.create('div', 'dc-map-switch')
this._config = undefined this._config = undefined
this._cache = [] this._cache = []
this.type = Widget.getWidgetType('map_switch')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('map_switch')
}

/** /**
* Override the superclass function * Override the superclass function
* @private * @private

+ 4
- 1
modules/widget/type/Popup.js View File

this._wrapper = DomUtil.create('div', 'dc-popup') this._wrapper = DomUtil.create('div', 'dc-popup')
this._config = { customClass: '' } this._config = { customClass: '' }
this._position = undefined this._position = undefined
this.type = Widget.getWidgetType('popup')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('popup')
}

set config(config) { set config(config) {
this._config = config this._config = config
config.customClass && this._setCustomClass() config.customClass && this._setCustomClass()

+ 4
- 1
modules/widget/type/Tooltip.js View File

super() super()
this._wrapper = DomUtil.create('div', 'dc-tool-tip') this._wrapper = DomUtil.create('div', 'dc-tool-tip')
this._ready = true this._ready = true
this.type = Widget.getWidgetType('tooltip')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('tooltip')
}

/** /**
* *
* @private * @private

+ 7
- 4
modules/widget/type/ZoomController.js View File

this._zoomInEl = undefined this._zoomInEl = undefined
this._zoomOutEl = undefined this._zoomOutEl = undefined
this._refreshEl = undefined this._refreshEl = undefined
this.type = Widget.getWidgetType('zoom_controller')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Widget.getWidgetType('zoom_controller')
}

/** /**
* *
* @param scene * @param scene
this._wrapper.appendChild(this._refreshEl) this._wrapper.appendChild(this._refreshEl)
this._wrapper.appendChild(this._zoomOutEl) this._wrapper.appendChild(this._zoomOutEl)
let self = this let self = this
this._zoomInEl.onclick = e => {
this._zoomInEl.onclick = () => {
self._zoomIn() self._zoomIn()
} }
this._refreshEl.onclick = e => {
this._refreshEl.onclick = () => {
self._refresh() self._refresh()
} }
this._zoomOutEl.onclick = e => {
this._zoomOutEl.onclick = () => {
self._zoomOut() self._zoomOut()
} }
this._ready = true this._ready = true

+ 4
- 1
modules/wind/WindLayer.js View File

} }
this._data = undefined this._data = undefined
this._canvas = document.createElement('canvas') this._canvas = document.createElement('canvas')
this.type = Layer.getLayerType('wind')
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }


get type() {
return Layer.getLayerType('wind')
}

set show(show) { set show(show) {
this._show = show this._show = show
this._canvas.style.visibility = show ? 'visible' : 'hidden' this._canvas.style.visibility = show ? 'visible' : 'hidden'

Loading…
Cancel
Save