Procházet zdrojové kódy

improve the overlay setStyle function #82

tags/2.9.0
Caven Chen před 3 roky
rodič
revize
5166423aea
45 změnil soubory, kde provedl 90 přidání a 84 odebrání
  1. 2
    2
      modules/overlay/custom/CustomBillboard.js
  2. 2
    2
      modules/overlay/custom/CustomLabel.js
  3. 2
    2
      modules/overlay/dynamic/DynamicBillboard.js
  4. 2
    2
      modules/overlay/dynamic/DynamicModel.js
  5. 1
    1
      modules/overlay/html/DivIcon.js
  6. 2
    2
      modules/overlay/model/Model.js
  7. 2
    2
      modules/overlay/plot/AttackArrow.js
  8. 2
    2
      modules/overlay/plot/DoubleArrow.js
  9. 2
    2
      modules/overlay/plot/FineArrow.js
  10. 2
    2
      modules/overlay/plot/GatheringPlace.js
  11. 2
    2
      modules/overlay/primitive/BillboardPrimitive.js
  12. 2
    2
      modules/overlay/primitive/CloudPrimitive.js
  13. 2
    1
      modules/overlay/primitive/ElecEllipsoidPrimitive.js
  14. 2
    1
      modules/overlay/primitive/FlowLinePrimitive.js
  15. 8
    0
      modules/overlay/primitive/GroundPolygonPrimitive.js
  16. 2
    2
      modules/overlay/primitive/LabelPrimitive.js
  17. 2
    1
      modules/overlay/primitive/ModelCollectionPrimitive.js
  18. 2
    2
      modules/overlay/primitive/ModelPrimitive.js
  19. 1
    1
      modules/overlay/primitive/PointPrimitive.js
  20. 2
    2
      modules/overlay/primitive/PolylinePrimitive.js
  21. 2
    1
      modules/overlay/primitive/ScanCirclePrimitive.js
  22. 2
    1
      modules/overlay/primitive/TrailLinePrimitive.js
  23. 2
    1
      modules/overlay/primitive/VideoPrimitive.js
  24. 2
    1
      modules/overlay/primitive/WaterPrimitive.js
  25. 2
    2
      modules/overlay/vector/Billboard.js
  26. 2
    2
      modules/overlay/vector/Box.js
  27. 2
    2
      modules/overlay/vector/Circle.js
  28. 2
    2
      modules/overlay/vector/Corridor.js
  29. 2
    2
      modules/overlay/vector/Cylinder.js
  30. 2
    2
      modules/overlay/vector/Ellipse.js
  31. 2
    2
      modules/overlay/vector/Ellipsoid.js
  32. 2
    2
      modules/overlay/vector/Label.js
  33. 2
    11
      modules/overlay/vector/Plane.js
  34. 1
    1
      modules/overlay/vector/Point.js
  35. 2
    2
      modules/overlay/vector/Polygon.js
  36. 2
    2
      modules/overlay/vector/Polyline.js
  37. 2
    2
      modules/overlay/vector/PolylineVolume.js
  38. 2
    2
      modules/overlay/vector/Rectangle.js
  39. 2
    2
      modules/overlay/vector/Wall.js
  40. 1
    1
      package.json
  41. 1
    1
      packages/base/package.json
  42. 2
    2
      packages/chart/package.json
  43. 2
    2
      packages/core/package.json
  44. 2
    2
      packages/mapv/package.json
  45. 1
    1
      packages/sdk/package.json

+ 2
- 2
modules/overlay/custom/CustomBillboard.js Zobrazit soubor

@@ -96,8 +96,8 @@ class CustomBillboard extends Overlay {
return this
}
delete style['image'] && delete style['width'] && delete style['height']
this._style = style
Util.merge(this._delegate.billboard, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.billboard, style)
return this
}


+ 2
- 2
modules/overlay/custom/CustomLabel.js Zobrazit soubor

@@ -65,8 +65,8 @@ class CustomLabel extends Overlay {
return this
}
delete style['text']
this._style = style
Util.merge(this._delegate.label, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.label, style)
return this
}


+ 2
- 2
modules/overlay/dynamic/DynamicBillboard.js Zobrazit soubor

@@ -78,8 +78,8 @@ class DynamicBillboard extends DynamicOverlay {
return this
}
delete style['image'] && delete style['width'] && delete style['height']
this._style = style
Util.merge(this._delegate.billboard, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.billboard, style)
return this
}
}

+ 2
- 2
modules/overlay/dynamic/DynamicModel.js Zobrazit soubor

@@ -66,8 +66,8 @@ class DynamicModel extends DynamicOverlay {
return this
}
delete style['uri']
this._style = style
Util.merge(this._delegate.model, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.model, style)
return this
}
}

+ 1
- 1
modules/overlay/html/DivIcon.js Zobrazit soubor

@@ -193,7 +193,7 @@ class DivIcon extends Overlay {
if (!style || Object.keys(style).length === 0) {
return this
}
this._style = style
Util.merge(this._style, style)
this._style.className &&
DomUtil.addClass(this._delegate, this._style.className)
return this

+ 2
- 2
modules/overlay/model/Model.js Zobrazit soubor

@@ -100,8 +100,8 @@ class Model extends Overlay {
return this
}
delete style['uri']
this._style = style
Util.merge(this._delegate.model, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.model, style)
return this
}


+ 2
- 2
modules/overlay/plot/AttackArrow.js Zobrazit soubor

@@ -200,8 +200,8 @@ class AttackArrow extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.polygon, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.polygon, style)
return this
}
}

+ 2
- 2
modules/overlay/plot/DoubleArrow.js Zobrazit soubor

@@ -271,8 +271,8 @@ class DoubleArrow extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.polygon, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.polygon, style)
return this
}
}

+ 2
- 2
modules/overlay/plot/FineArrow.js Zobrazit soubor

@@ -125,8 +125,8 @@ class FineArrow extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.polygon, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.polygon, style)
return this
}
}

+ 2
- 2
modules/overlay/plot/GatheringPlace.js Zobrazit soubor

@@ -106,8 +106,8 @@ class GatheringPlace extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.polygon, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.polygon, style)
return this
}
}

+ 2
- 2
modules/overlay/primitive/BillboardPrimitive.js Zobrazit soubor

@@ -89,8 +89,8 @@ class BillboardPrimitive extends Overlay {
delete style['image'] &&
delete style['width'] &&
delete style['height']
this._style = style
Util.merge(this._delegate, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate, style)
return this
}
}

+ 2
- 2
modules/overlay/primitive/CloudPrimitive.js Zobrazit soubor

@@ -53,8 +53,8 @@ class CloudPrimitive extends Overlay {
return this
}
delete style['position']
this._style = style
Util.merge(this._delegate, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate, style)
return this
}
}

+ 2
- 1
modules/overlay/primitive/ElecEllipsoidPrimitive.js Zobrazit soubor

@@ -6,6 +6,7 @@
import { Cesium } from '@dc-modules/namespace'
import State from '@dc-modules/state/State'
import Parse from '@dc-modules/parse/Parse'
import { Util } from '@dc-modules/utils'
import { Transform } from '@dc-modules/transform'
import Overlay from '../Overlay'

@@ -103,7 +104,7 @@ class ElecEllipsoidPrimitive extends Overlay {
if (Object.keys(style).length === 0) {
return this
}
this._style = style
Util.merge(this._style, style)
this._setAppearance()
return this
}

+ 2
- 1
modules/overlay/primitive/FlowLinePrimitive.js Zobrazit soubor

@@ -6,6 +6,7 @@
import { Cesium } from '@dc-modules/namespace'
import State from '@dc-modules/state/State'
import Parse from '@dc-modules/parse/Parse'
import { Util } from '@dc-modules/utils'
import { Transform } from '@dc-modules/transform'
import Overlay from '../Overlay'

@@ -84,7 +85,7 @@ class FlowLinePrimitive extends Overlay {
if (Object.keys(style).length === 0) {
return this
}
this._style = style
Util.merge(this._style, style)
style.classificationType &&
(this._delegate.classificationType = this._style.classificationType)
this._setAppearance()

+ 8
- 0
modules/overlay/primitive/GroundPolygonPrimitive.js Zobrazit soubor

@@ -0,0 +1,8 @@
/**
* @Author: Caven
* @Date: 2021-12-01 20:31:02
*/

class GroundPolygonPrimitive {}

export default GroundPolygonPrimitive

+ 2
- 2
modules/overlay/primitive/LabelPrimitive.js Zobrazit soubor

@@ -78,8 +78,8 @@ class LabelPrimitive extends Overlay {
return this
}
delete style['position'] && delete style['text']
this._style = style
Util.merge(this._delegate, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate, style)
return this
}
}

+ 2
- 1
modules/overlay/primitive/ModelCollectionPrimitive.js Zobrazit soubor

@@ -6,6 +6,7 @@
import { Cesium } from '@dc-modules/namespace'
import State from '@dc-modules/state/State'
import Parse from '@dc-modules/parse/Parse'
import { Util } from '@dc-modules/utils'
import { Transform } from '@dc-modules/transform'
import Overlay from '../Overlay'

@@ -119,7 +120,7 @@ class ModelCollectionPrimitive extends Overlay {
return this
}
delete style['instances'] && delete style['url']
this._style = style
Util.merge(this._style, style)
if (this._layer) {
this._resetDelegate()
this._layer.delegate.add(this._delegate)

+ 2
- 2
modules/overlay/primitive/ModelPrimitive.js Zobrazit soubor

@@ -109,8 +109,8 @@ class ModelPrimitive extends Overlay {
if (!style || Object.keys(style).length === 0) {
return this
}
this._style = style
Util.merge(this._delegate, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate, style)
return this
}
}

+ 1
- 1
modules/overlay/primitive/PointPrimitive.js Zobrazit soubor

@@ -65,7 +65,7 @@ class PointPrimitive extends Overlay {
return this
}
delete style['position']
this._style = style
Util.merge(this._style, style)
Util.merge(this._delegate, DEF_STYLE, this._style)
return this
}

+ 2
- 2
modules/overlay/primitive/PolylinePrimitive.js Zobrazit soubor

@@ -61,8 +61,8 @@ class PolylinePrimitive extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate, style)
return this
}
}

+ 2
- 1
modules/overlay/primitive/ScanCirclePrimitive.js Zobrazit soubor

@@ -6,6 +6,7 @@
import { Cesium } from '@dc-modules/namespace'
import State from '@dc-modules/state/State'
import Parse from '@dc-modules/parse/Parse'
import { Util } from '@dc-modules/utils'
import { Transform } from '@dc-modules/transform'
import Overlay from '../Overlay'

@@ -88,7 +89,7 @@ class ScanCirclePrimitive extends Overlay {
if (Object.keys(style).length === 0) {
return this
}
this._style = style
Util.merge(this._style, style)
style.classificationType &&
(this._delegate.classificationType = this._style.classificationType)
this._setAppearance()

+ 2
- 1
modules/overlay/primitive/TrailLinePrimitive.js Zobrazit soubor

@@ -6,6 +6,7 @@
import { Cesium } from '@dc-modules/namespace'
import State from '@dc-modules/state/State'
import Parse from '@dc-modules/parse/Parse'
import { Util } from '@dc-modules/utils'
import { Transform } from '@dc-modules/transform'
import Overlay from '../Overlay'

@@ -72,7 +73,7 @@ class TrailLinePrimitive extends Overlay {
if (Object.keys(style).length === 0) {
return this
}
this._style = style
Util.merge(this._style, style)
style.classificationType &&
(this._delegate.classificationType = this._style.classificationType)
this._setAppearance()

+ 2
- 1
modules/overlay/primitive/VideoPrimitive.js Zobrazit soubor

@@ -6,6 +6,7 @@
import { Cesium } from '@dc-modules/namespace'
import State from '@dc-modules/state/State'
import Parse from '@dc-modules/parse/Parse'
import { Util } from '@dc-modules/utils'
import { Transform } from '@dc-modules/transform'
import Overlay from '../Overlay'

@@ -90,7 +91,7 @@ class VideoPrimitive extends Overlay {
if (Object.keys(style).length === 0) {
return this
}
this._style = style
Util.merge(this._style, style)
if (this._style?.classificationType) {
this._delegate.classificationType = this._style.classificationType
}

+ 2
- 1
modules/overlay/primitive/WaterPrimitive.js Zobrazit soubor

@@ -6,6 +6,7 @@
import { Cesium } from '@dc-modules/namespace'
import State from '@dc-modules/state/State'
import Parse from '@dc-modules/parse/Parse'
import { Util } from '@dc-modules/utils'
import { Transform } from '@dc-modules/transform'
import Overlay from '../Overlay'

@@ -96,7 +97,7 @@ class WaterPrimitive extends Overlay {
if (Object.keys(style).length === 0) {
return this
}
this._style = style
Util.merge(this._style, style)
if (this._style?.classificationType) {
this._delegate.classificationType = this._style.classificationType
}

+ 2
- 2
modules/overlay/vector/Billboard.js Zobrazit soubor

@@ -82,8 +82,8 @@ class Billboard extends Overlay {
return this
}
delete style['image'] && delete style['width'] && delete style['height']
this._style = style
Util.merge(this._delegate.billboard, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.billboard, style)
return this
}


+ 2
- 2
modules/overlay/vector/Box.js Zobrazit soubor

@@ -105,8 +105,8 @@ class Box extends Overlay {
return this
}
delete style['length'] && delete style['width'] && delete style['height']
this._style = style
Util.merge(this._delegate.box, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.box, style)
return this
}
}

+ 2
- 2
modules/overlay/vector/Circle.js Zobrazit soubor

@@ -101,8 +101,8 @@ class Circle extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.polygon, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.polygon, style)
return this
}
}

+ 2
- 2
modules/overlay/vector/Corridor.js Zobrazit soubor

@@ -60,8 +60,8 @@ class Corridor extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.corridor, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.corridor, style)
return this
}


+ 2
- 2
modules/overlay/vector/Cylinder.js Zobrazit soubor

@@ -111,8 +111,8 @@ class Cylinder extends Overlay {
delete style['topRadius'] &&
delete style['bottomRadius']

this._style = style
Util.merge(this._delegate.cylinder, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.cylinder, style)
return this
}
}

+ 2
- 2
modules/overlay/vector/Ellipse.js Zobrazit soubor

@@ -86,8 +86,8 @@ class Ellipse extends Overlay {
return this
}
delete style['semiMajorAxis'] && delete style['semiMinorAxis']
this._style = style
Util.merge(this._delegate.ellipse, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.ellipse, style)
return this
}
}

+ 2
- 2
modules/overlay/vector/Ellipsoid.js Zobrazit soubor

@@ -75,8 +75,8 @@ class Ellipsoid extends Overlay {
return this
}
delete style['radius']
this._style = style
Util.merge(this._delegate.ellipsoid, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.ellipsoid, style)
return this
}
}

+ 2
- 2
modules/overlay/vector/Label.js Zobrazit soubor

@@ -76,8 +76,8 @@ class Label extends Overlay {
return this
}
delete style['text']
this._style = style
Util.merge(this._delegate.label, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.label, style)
return this
}


+ 2
- 11
modules/overlay/vector/Plane.js Zobrazit soubor

@@ -106,15 +106,6 @@ class Plane extends Overlay {
this.distance = this._distance
}

/**
*
* @param {*} text
* @param {*} textStyle
*/
setLabel(text, textStyle) {
return this
}

/**
* Sets Style
* @param style
@@ -125,8 +116,8 @@ class Plane extends Overlay {
return this
}
delete style['dimensions'] && delete ['plane']
this._style = style
Util.merge(this._delegate.plane, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.plane, style)
return this
}
}

+ 1
- 1
modules/overlay/vector/Point.js Zobrazit soubor

@@ -62,7 +62,7 @@ class Point extends Overlay {
return this
}
delete style['position']
this._style = style
Util.merge(this._style, style)
Util.merge(this._delegate.point, DEF_STYLE, this._style)
return this
}

+ 2
- 2
modules/overlay/vector/Polygon.js Zobrazit soubor

@@ -104,8 +104,8 @@ class Polygon extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.polygon, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.polygon, style)
return this
}


+ 2
- 2
modules/overlay/vector/Polyline.js Zobrazit soubor

@@ -75,8 +75,8 @@ class Polyline extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.polyline, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.polyline, style)
return this
}


+ 2
- 2
modules/overlay/vector/PolylineVolume.js Zobrazit soubor

@@ -76,8 +76,8 @@ class PolylineVolume extends Overlay {
return this
}
delete style['positions'] && delete style['shape']
this._style = style
Util.merge(this._delegate.polylineVolume, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.polylineVolume, style)
return this
}


+ 2
- 2
modules/overlay/vector/Rectangle.js Zobrazit soubor

@@ -60,8 +60,8 @@ class Rectangle extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.rectangle, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.rectangle, style)
return this
}
}

+ 2
- 2
modules/overlay/vector/Wall.js Zobrazit soubor

@@ -61,8 +61,8 @@ class Wall extends Overlay {
return this
}
delete style['positions']
this._style = style
Util.merge(this._delegate.wall, this._style)
Util.merge(this._style, style)
Util.merge(this._delegate.wall, style)
return this
}


+ 1
- 1
package.json Zobrazit soubor

@@ -1,6 +1,6 @@
{
"name": "dc-sdk",
"version": "2.8.0",
"version": "2.8.1",
"description": "The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.",
"repository": "https://github.com/dvgis/dc-sdk.git",
"homepage": "https://www.dvgis.cn",

+ 1
- 1
packages/base/package.json Zobrazit soubor

@@ -1,6 +1,6 @@
{
"name": "@dvgis/dc-base",
"version": "2.8.0",
"version": "2.8.1",
"description": "The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.",
"repository": "https://github.com/dvgis/dc-sdk.git",
"homepage": "https://www.dvgis.cn",

+ 2
- 2
packages/chart/package.json Zobrazit soubor

@@ -1,6 +1,6 @@
{
"name": "@dvgis/dc-chart",
"version": "2.8.0",
"version": "2.8.1",
"description": "The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.",
"repository": "https://github.com/dvgis/dc-sdk.git",
"homepage": "https://www.dvgis.cn",
@@ -18,7 +18,7 @@
"license": "Apache 2.0",
"main": "dist/dc.chart.min.js",
"peerDependencies": {
"@dvgis/dc-base": "^2.8.0"
"@dvgis/dc-base": "^2.8.1"
},
"files": [
"dist"

+ 2
- 2
packages/core/package.json Zobrazit soubor

@@ -1,6 +1,6 @@
{
"name": "@dvgis/dc-core",
"version": "2.8.0",
"version": "2.8.1",
"description": "The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.",
"repository": "https://github.com/dvgis/dc-sdk.git",
"homepage": "https://www.dvgis.cn",
@@ -18,7 +18,7 @@
"license": "Apache 2.0",
"main": "dist/dc.core.min.js",
"peerDependencies": {
"@dvgis/dc-base": "^2.8.0"
"@dvgis/dc-base": "^2.8.1"
},
"files": [
"dist"

+ 2
- 2
packages/mapv/package.json Zobrazit soubor

@@ -1,6 +1,6 @@
{
"name": "@dvgis/dc-mapv",
"version": "2.8.0",
"version": "2.8.1",
"description": "The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.",
"repository": "https://github.com/dvgis/dc-sdk.git",
"homepage": "https://www.dvgis.cn",
@@ -18,7 +18,7 @@
"license": "Apache 2.0",
"main": "dist/dc.mapv.js",
"peerDependencies": {
"@dvgis/dc-base": "^2.8.0"
"@dvgis/dc-base": "^2.8.1"
},
"files": [
"dist"

+ 1
- 1
packages/sdk/package.json Zobrazit soubor

@@ -1,6 +1,6 @@
{
"name": "@dvgis/dc-sdk",
"version": "2.8.0",
"version": "2.8.1",
"description": "The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.",
"repository": "https://github.com/dvgis/dc-sdk.git",
"homepage": "https://www.dvgis.cn",

Načítá se…
Zrušit
Uložit