Переглянути джерело

1.修复Geojson图层不能转换为矢量图层的问题,2.修复DomUtil中部分函数无法使用的问题

tags/1.8.4
Caven Chen 5 роки тому
джерело
коміт
c1d5e58a06
67 змінених файлів з 143 додано та 229 видалено
  1. 2
    0
      .eslintrc
  2. 1
    1
      dist/dc.base.min.js
  3. 1
    1
      dist/dc.core.min.js
  4. 1
    0
      package.json
  5. 1
    3
      src/base/global-api/index.js
  6. 1
    3
      src/base/global-api/mixin.js
  7. 1
    3
      src/base/global-api/use.js
  8. 1
    3
      src/core/Loader.Base.js
  9. 1
    3
      src/core/Loader.js
  10. 1
    3
      src/core/event/Event.js
  11. 1
    3
      src/core/imagery/ImageryLayerFactory.js
  12. 1
    3
      src/core/imagery/ImageryType.js
  13. 2
    3
      src/core/index.js
  14. 1
    4
      src/core/layer/GeoJsonLayer.js
  15. 4
    5
      src/core/layer/HtmlLayer.js
  16. 2
    4
      src/core/layer/LabelLayer.js
  17. 3
    5
      src/core/layer/Layer.js
  18. 1
    3
      src/core/layer/LayerType.js
  19. 1
    3
      src/core/layer/TilesetLayer.js
  20. 1
    3
      src/core/layer/VectorLayer.js
  21. 1
    3
      src/core/math/area.js
  22. 1
    3
      src/core/math/bounds.js
  23. 1
    3
      src/core/math/center.js
  24. 1
    3
      src/core/math/distance.js
  25. 1
    3
      src/core/math/heading.js
  26. 1
    3
      src/core/math/index.js
  27. 1
    3
      src/core/math/isBetween.js
  28. 2
    3
      src/core/math/parabola.js
  29. 1
    3
      src/core/option/CameraOption.js
  30. 1
    3
      src/core/option/ViewerOption.js
  31. 1
    3
      src/core/option/index.js
  32. 1
    3
      src/core/overlay/base/Billboard.js
  33. 1
    3
      src/core/overlay/base/Circle.js
  34. 2
    3
      src/core/overlay/base/DivIcon.js
  35. 2
    4
      src/core/overlay/base/Label.js
  36. 1
    3
      src/core/overlay/base/Point.js
  37. 3
    5
      src/core/overlay/base/Polygon.js
  38. 1
    3
      src/core/overlay/base/Polyline.js
  39. 1
    3
      src/core/overlay/model/Model.js
  40. 1
    3
      src/core/overlay/model/Tileset.js
  41. 1
    3
      src/core/parse/Parse.js
  42. 8
    16
      src/core/position/Position.js
  43. 1
    3
      src/core/state/State.js
  44. 1
    3
      src/core/terrain/TerrainFactory.js
  45. 3
    6
      src/core/transform/Transform.js
  46. 8
    10
      src/core/utils/DomUtil.js
  47. 6
    11
      src/core/utils/Util.js
  48. 1
    3
      src/core/utils/index.js
  49. 2
    4
      src/core/widget/Attribution.js
  50. 1
    3
      src/core/widget/Compass.js
  51. 2
    4
      src/core/widget/ContextMenu.js
  52. 2
    4
      src/core/widget/HawkeyeMap.js
  53. 1
    3
      src/core/widget/LocationBar.js
  54. 1
    3
      src/core/widget/MapSplit.js
  55. 1
    3
      src/core/widget/MapSwitch.js
  56. 1
    3
      src/core/widget/Popup.js
  57. 1
    3
      src/core/widget/Tooltip.js
  58. 2
    4
      src/core/widget/Widget.js
  59. 1
    3
      src/core/widget/WidgetType.js
  60. 1
    3
      src/core/widget/ZoomController.js
  61. 1
    3
      src/core/widget/index.js
  62. 5
    3
      src/log.js
  63. 1
    1
      src/themes/contextmenu.scss
  64. 2
    3
      src/themes/index.js
  65. 1
    1
      src/themes/tooltip.scss
  66. 1
    3
      src/thirdpart/index.js
  67. 34
    1
      yarn.lock

+ 2
- 0
.eslintrc Переглянути файл

@@ -12,6 +12,8 @@
"plugins": ["html", "prettier"],
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"globals": {
"DC": false,
"build": false,
"Cesium": false,
"GSpace": false
},

+ 1
- 1
dist/dc.base.min.js
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 1
- 1
dist/dc.core.min.js
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 1
- 0
package.json Переглянути файл

@@ -33,6 +33,7 @@
"css-loader": "^2.1.1",
"eslint": "^5.15.3",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-html": "^6.0.2",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-prettier": "^3.0.1",

+ 1
- 3
src/base/global-api/index.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-09 23:09:42
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:34:52
*/

export * from './mixin'

+ 1
- 3
src/base/global-api/mixin.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-09 23:00:54
* @Last Modified by: Caven
* @Last Modified time: 2020-07-27 16:31:22
*/

const ignores = [

+ 1
- 3
src/base/global-api/use.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-09 23:01:21
* @Last Modified by: Caven
* @Last Modified time: 2020-06-17 17:41:24
*/

export function initUse(DC) {

+ 1
- 3
src/core/Loader.Base.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-09 13:19:53
* @Last Modified by: Caven
* @Last Modified time: 2020-05-15 09:00:29
*/

import { DomUtil, Util } from './utils'

+ 1
- 3
src/core/Loader.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2019-12-27 17:18:52
* @Last Modified by: Caven
* @Last Modified time: 2020-05-28 14:35:10
*/

import ImageryLayerFactory from './imagery/ImageryLayerFactory'

+ 1
- 3
src/core/event/Event.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-02 15:24:38
* @Last Modified by: Caven
* @Last Modified time: 2020-05-27 12:50:32
*/

class Event {

+ 1
- 3
src/core/imagery/ImageryLayerFactory.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-21 15:54:56
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:10:48
*/

import ImageryType from './ImageryType'

+ 1
- 3
src/core/imagery/ImageryType.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-10 08:15:36
* @Last Modified by: Caven
* @Last Modified time: 2020-05-10 08:17:04
*/

let ImageryType = {

+ 2
- 3
src/core/index.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2019-12-27 14:29:05
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 23:50:56
*/

const install = function(DC) {
@@ -27,6 +25,7 @@ const install = function(DC) {
callback && callback()
} catch (e) {
delete window.DC
// eslint-disable-next-line no-console
console.error(e)
}
}

+ 1
- 4
src/core/layer/GeoJsonLayer.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-13 10:13:53
* @Last Modified by: Caven
* @Last Modified time: 2020-06-05 13:19:15
*/

import { Layer, VectorLayer } from './index'
@@ -59,7 +57,6 @@ class GeoJsonLayer extends Layer {
}

/**
*
* @param {*} method
* @param {*} context
*/

+ 4
- 5
src/core/layer/HtmlLayer.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-02-12 21:43:33
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 10:44:26
*/

import { DomUtil } from '../utils'
@@ -15,7 +13,7 @@ const { Cesium } = DC.Namespace
class HtmlLayer extends Layer {
constructor(id) {
super(id)
this._delegate = DomUtil.create('div', 'html-layer')
this._delegate = DomUtil.create('div', 'html-layer', undefined)
this._delegate.setAttribute('id', this._id)
this._renderRemoveCallback = undefined
this.type = Layer.getLayerType('html')
@@ -30,9 +28,10 @@ class HtmlLayer extends Layer {
get show() {
return this._show
}

/**
*
* @param {*} veiwer
* @param {*} viewer
* the layer added handler function
* subclasses need to be overridden
*/

+ 2
- 4
src/core/layer/LabelLayer.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-30 17:14:00
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 10:42:03
*/

import { Label } from '../overlay'
@@ -25,7 +23,7 @@ class LabelLayer extends Layer {
}

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

+ 3
- 5
src/core/layer/Layer.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-03 09:38:21
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 21:53:16
*/

import { Util } from '../utils'
@@ -76,7 +74,7 @@ class Layer {
*
* The layer added callback function
* Subclasses need to be overridden
* @param {*} veiwer
* @param {*} viewer
*
*/
_addHandler(viewer) {
@@ -174,7 +172,7 @@ class Layer {
addOverlays(overlays) {
if (Array.isArray(overlays)) {
overlays.forEach(item => {
this._addOverlay(overlay)
this._addOverlay(item)
})
}
return this

+ 1
- 3
src/core/layer/LayerType.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-10 08:21:19
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 10:42:00
*/
let LayerType = {}


+ 1
- 3
src/core/layer/TilesetLayer.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-09 09:16:27
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 10:41:58
*/

import State from '../state/State'

+ 1
- 3
src/core/layer/VectorLayer.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-02 16:42:03
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 10:44:45
*/

import State from '../state/State'

+ 1
- 3
src/core/math/area.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-04-24 14:49:37
* @Last Modified by: Caven
* @Last Modified time: 2020-05-15 08:58:33
*/

import Transform from '../transform/Transform'

+ 1
- 3
src/core/math/bounds.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-04-23 09:29:56
* @Last Modified by: Caven
* @Last Modified time: 2020-05-15 08:58:37
*/

export default function bounds(positions = [], expand = 0) {

+ 1
- 3
src/core/math/center.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-04-24 14:43:39
* @Last Modified by: Caven
* @Last Modified time: 2020-05-15 08:58:38
*/

import Transform from '../transform/Transform'

+ 1
- 3
src/core/math/distance.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-31 20:58:06
* @Last Modified by: Caven
* @Last Modified time: 2020-05-27 12:54:49
*/

import Transform from '../transform/Transform'

+ 1
- 3
src/core/math/heading.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-04-11 00:41:47
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 00:39:20
*/

import Transform from '../transform/Transform'

+ 1
- 3
src/core/math/index.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-31 20:57:36
* @Last Modified by: Caven
* @Last Modified time: 2020-05-28 10:27:54
*/

export { default as area } from './area'

+ 1
- 3
src/core/math/isBetween.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-31 20:58:06
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 00:39:22
*/

export default function isBetween(value, min, max) {

+ 2
- 3
src/core/math/parabola.js Переглянути файл

@@ -1,9 +1,8 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-28 10:24:38
* @Last Modified by: Caven
* @Last Modified time: 2020-05-28 14:33:28
*/

import { Util } from '../utils'

export default function parabola(

+ 1
- 3
src/core/option/CameraOption.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-21 15:33:52
* @Last Modified by: Caven
* @Last Modified time: 2020-06-03 12:52:18
*/

const { Cesium } = DC.Namespace

+ 1
- 3
src/core/option/ViewerOption.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2019-12-30 09:24:37
* @Last Modified by: Caven
* @Last Modified time: 2020-07-20 10:15:24
*/

import { Util } from '../utils'

+ 1
- 3
src/core/option/index.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-05 22:00:17
* @Last Modified by: Caven
* @Last Modified time: 2020-05-09 21:21:38
*/

export { default as ViewerOption } from './ViewerOption'

+ 1
- 3
src/core/overlay/base/Billboard.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-19 10:18:23
* @Last Modified by: Caven
* @Last Modified time: 2020-06-25 08:54:07
*/

import { Util } from '../../utils'

+ 1
- 3
src/core/overlay/base/Circle.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-31 18:57:02
* @Last Modified by: Caven
* @Last Modified time: 2020-06-25 08:52:43
*/

import { Util } from '../../utils'

+ 2
- 3
src/core/overlay/base/DivIcon.js Переглянути файл

@@ -1,11 +1,10 @@
/*
/**
* @Author: Caven
* @Date: 2020-02-12 21:46:22
* @Last Modified by: Caven
* @Last Modified time: 2020-06-25 09:04:04
*/

import { DomUtil, Util } from '../../utils'
import { MouseEventType } from '../../event'
import { isBetween } from '../../math'
import Transform from '../../transform/Transform'
import Parse from '../../parse/Parse'

+ 2
- 4
src/core/overlay/base/Label.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-02-01 11:59:28
* @Last Modified by: Caven
* @Last Modified time: 2020-06-25 08:55:22
*/

import { Util } from '../../utils'
@@ -90,7 +88,7 @@ class Label extends Overlay {
)
let label = undefined
if (entity.billboard) {
label = new Label(position, item.name)
label = new Label(position, entity.name)
label.attr = {
...entity.properties.getValue(Cesium.JulianDate.now())
}

+ 1
- 3
src/core/overlay/base/Point.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-06 15:03:25
* @Last Modified by: Caven
* @Last Modified time: 2020-07-06 17:49:30
*/

import { Util } from '../../utils'

+ 3
- 5
src/core/overlay/base/Polygon.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-09 09:10:37
* @Last Modified by: Caven
* @Last Modified time: 2020-06-25 08:59:51
*/

import { Util } from '../../utils'
@@ -114,8 +112,8 @@ class Polygon extends Overlay {
let polygon = undefined
let now = Cesium.JulianDate.now()
if (entity.polygon) {
let positions = T.transformCartesianArrayToWGS84Array(
item.polygon.hierarchy.getValue(now).positions
let positions = Transform.transformCartesianArrayToWGS84Array(
entity.polygon.hierarchy.getValue(now).positions
)
polygon = new Polygon(positions)
polygon.attr = {

+ 1
- 3
src/core/overlay/base/Polyline.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-06 15:03:25
* @Last Modified by: Caven
* @Last Modified time: 2020-06-25 09:00:56
*/

import { Util } from '../../utils'

+ 1
- 3
src/core/overlay/model/Model.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-06 15:03:25
* @Last Modified by: Caven
* @Last Modified time: 2020-06-25 09:08:04
*/

import { Util } from '../../utils'

+ 1
- 3
src/core/overlay/model/Tileset.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-07 08:51:56
* @Last Modified by: Caven
* @Last Modified time: 2020-07-02 13:22:14
*/

import Parse from '../../parse/Parse'

+ 1
- 3
src/core/parse/Parse.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-22 00:10:25
* @Last Modified by: Caven
* @Last Modified time: 2020-05-28 15:33:20
*/

import Position from '../position/Position'

+ 8
- 16
src/core/position/Position.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2019-12-27 14:35:02
* @Last Modified by: Caven
* @Last Modified time: 2020-05-27 08:51:54
*/

import Transform from '../transform/Transform'
@@ -93,20 +91,14 @@ class Position {
)
}

/**
*
* @param {*} src
*/
static copy(src) {
copy() {
let position = new Position()
if (src) {
position.lng = src.lng || 0
position.lat = src.lat || 0
position.alt = src.alt || 0
position.heading = src.heading || 0
position.pitch = src.pitch || 0
position.roll = src.roll || 0
}
position.lng = this.lng || 0
position.lat = this.lat || 0
position.alt = this.alt || 0
position.heading = this.heading || 0
position.pitch = this.pitch || 0
position.roll = this.roll || 0
return position
}


+ 1
- 3
src/core/state/State.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-11 16:39:23
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:11:28
*/

const State = {

+ 1
- 3
src/core/terrain/TerrainFactory.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-21 15:54:56
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:07:56
*/

const { Cesium } = DC.Namespace

+ 3
- 6
src/core/transform/Transform.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-07 09:00:32
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:38:44
*/

import Position from '../position/Position'
@@ -123,7 +121,7 @@ class Transform {
*/
static transformWindowToWGS84(position, viewer) {
let scene = viewer.scene
let cartesian = undefined
let cartesian
if (scene.mode === Cesium.SceneMode.SCENE3D) {
let ray = scene.camera.getPickRay(position)
cartesian = scene.globe.pick(ray, scene)
@@ -140,11 +138,10 @@ class Transform {
*/
static transformWGS84ToWindow(position, viewer) {
let scene = viewer.scene
let cartesian = SceneTransforms.wgs84ToWindowCoordinates(
return Cesium.SceneTransforms.wgs84ToWindowCoordinates(
scene,
this.transformWGS84ToCartesian(position)
)
return cartesian
}
}


+ 8
- 10
src/core/utils/DomUtil.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2019-12-31 17:50:13
* @Last Modified by: Caven
* @Last Modified time: 2020-06-06 14:52:28
*/

import Util from './Util'
@@ -31,10 +29,10 @@ class DomUtil {
* @param {*} style
*/
static getStyle(el, style) {
var value = el.style[style] || (el.currentStyle && el.currentStyle[style])
let value = el.style[style] || (el.currentStyle && el.currentStyle[style])

if ((!value || value === 'auto') && document.defaultView) {
var css = document.defaultView.getComputedStyle(el, null)
let css = document.defaultView.getComputedStyle(el, null)
value = css ? css[style] : null
}
return value === 'auto' ? null : value
@@ -47,8 +45,8 @@ class DomUtil {
* @param {*} container
* Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.
*/
static create(tagName, className, container) {
var el = document.createElement(tagName)
static create(tagName, className, container = null) {
let el = document.createElement(tagName)
el.className = className || ''
if (container) {
container.appendChild(el)
@@ -62,7 +60,7 @@ class DomUtil {
* Removes `el` from its parent element
*/
static remove(el) {
var parent = el.parentNode
let parent = el.parentNode
if (parent) {
parent.removeChild(el)
}
@@ -85,11 +83,11 @@ class DomUtil {
* @param {*} el
* @param {*} name
*/
hasClass(el, name) {
static hasClass(el, name) {
if (el.classList !== undefined) {
return el.classList.contains(name)
}
var className = getClass(el)
let className = this.getClass(el)
return (
className.length > 0 &&
new RegExp('(^|\\s)' + name + '(\\s|$)').test(className)

+ 6
- 11
src/core/utils/Util.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2019-12-31 17:58:01
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 10:49:58
*/

const CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(
@@ -28,7 +26,7 @@ class Util {
for (let i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | (Math.random() * 16)
uuid[i] = CHARS[i == 19 ? (r & 0x3) | 0x8 : r]
uuid[i] = CHARS[i === 19 ? (r & 0x3) | 0x8 : r]
}
}
return prefix + '-' + uuid.join('')
@@ -67,25 +65,22 @@ class Util {
* @function splitWords(str: String): String[]
* Trims and splits the string on whitespace and returns the array of parts.
* @param {*} str
*
*/
static splitWords(str) {
return this.trim(str).split(/\s+/)
}

/**
*
* @function setOptions(obj: Object, options: Object): Object
* Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`.
* @param {*} obj
* @param {*} options
*
*/
static setOptions(obj, options) {
if (!obj.hasOwnProperty('options')) {
obj.options = obj.options ? create(obj.options) : {}
obj.options = obj.options ? Object.create(obj.options) : {}
}
for (var i in options) {
for (let i in options) {
obj.options[i] = options[i]
}
return obj.options
@@ -108,7 +103,7 @@ class Util {
/**
* @function checkPositions(positions: Object): Boolean
* Check positions for validity
* @param {*} position
* @param {*} positions
*/
static checkPositions(positions) {
return (
@@ -119,7 +114,7 @@ class Util {
/**
* @function checkViewer(viewer: Object): Boolean
* Check viewer for validity
* @param {*} position
* @param {*} viewer
*/
static checkViewer(viewer) {
return viewer && viewer.delegate && viewer.canvas

+ 1
- 3
src/core/utils/index.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-06 16:38:49
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:38:49
*/

export { default as DomUtil } from './DomUtil'

+ 2
- 4
src/core/widget/Attribution.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-02-11 21:08:01
* @Last Modified by: Caven
* @Last Modified time: 2020-07-27 16:32:23
*/

import { DomUtil } from '../utils'
@@ -35,7 +33,7 @@ class Attribution extends Widget {
span.style.cssText = `margin-right:5px;`
let a = DomUtil.create('a', '', this._wrapper)
a.innerHTML = 'Digital Visual'
a.href = 'javascirpt:void(0)'
a.href = 'javascript:void(0)'
a.onclick = () => {
window.open('https://www.dvgis.cn')
}

+ 1
- 3
src/core/widget/Compass.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-19 13:11:12
* @Last Modified by: Caven
* @Last Modified time: 2020-07-24 12:40:52
*/

import { DomUtil } from '../utils'

+ 2
- 4
src/core/widget/ContextMenu.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2019-12-31 17:32:01
* @Last Modified by: Caven
* @Last Modified time: 2020-07-24 12:40:29
*/

import { DomUtil } from '../utils'
@@ -88,7 +86,7 @@ class ContextMenu extends Widget {
if (!label || !method) {
return this
}
let menu = DomUtil.create('li', 'menu-item')
let menu = DomUtil.create('li', 'menu-item', null)
let lastNode = this._ulEl.lastChild
menu.innerHTML = label
let self = this

+ 2
- 4
src/core/widget/HawkeyeMap.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-15 17:47:42
* @Last Modified by: Caven
* @Last Modified time: 2020-07-24 12:42:20
*/

import { DomUtil, Util } from '../utils'
@@ -29,7 +27,7 @@ const DEF_OPTS = {
class HawkeyeMap extends Widget {
constructor() {
super()
this._wrapper = DomUtil.create('div', 'dc-hawkeye-map')
this._wrapper = DomUtil.create('div', 'dc-hawkeye-map', null)
this._wrapper.setAttribute('id', Util.uuid())
this._baseLayer = undefined
this._delegate = undefined

+ 1
- 3
src/core/widget/LocationBar.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-04 18:02:32
* @Last Modified by: Caven
* @Last Modified time: 2020-07-24 15:03:50
*/

import { MouseEventType, SceneEventType } from '../event'

+ 1
- 3
src/core/widget/MapSplit.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-04 15:38:40
* @Last Modified by: Caven
* @Last Modified time: 2020-07-30 14:08:07
*/

import { DomUtil } from '../utils'

+ 1
- 3
src/core/widget/MapSwitch.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-02-11 18:34:46
* @Last Modified by: Caven
* @Last Modified time: 2020-07-24 12:45:08
*/

import { DomUtil } from '../utils'

+ 1
- 3
src/core/widget/Popup.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-15 19:16:45
* @Last Modified by: Caven
* @Last Modified time: 2020-07-24 10:14:43
*/

import { DomUtil } from '../utils'

+ 1
- 3
src/core/widget/Tooltip.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-02-01 12:07:54
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 23:34:58
*/

import { DomUtil } from '../utils'

+ 2
- 4
src/core/widget/Widget.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-15 19:17:52
* @Last Modified by: Caven
* @Last Modified time: 2020-07-24 12:37:39
*/

import State from '../state/State'
@@ -57,7 +55,7 @@ class Widget {
}

/**
* updating the Widge location requires subclass overrides
* updating the Widget location requires subclass overrides
* @param {*} windowCoord
*/
_updateWindowCoord(windowCoord) {}

+ 1
- 3
src/core/widget/WidgetType.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-10 10:15:46
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:39:58
*/

let WidgetType = {}

+ 1
- 3
src/core/widget/ZoomController.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-05-06 13:25:36
* @Last Modified by: Caven
* @Last Modified time: 2020-06-05 15:26:16
*/

import Widget from './Widget'

+ 1
- 3
src/core/widget/index.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2020-03-05 21:53:35
* @Last Modified by: Caven
* @Last Modified time: 2020-05-09 22:34:56
*/

export { default as Attribution } from './Attribution'

+ 5
- 3
src/log.js Переглянути файл

@@ -1,10 +1,12 @@
/*
/**
* @Author: Caven
* @Date: 2020-02-12 18:53:12
* @Last Modified by: Caven
* @Last Modified time: 2020-07-30 13:30:42
*/

// eslint-disable-next-line no-console
console.clear()

// eslint-disable-next-line no-console
console.log(
`%c \n DC-SDK \n %c \n 用数字描绘世界之美 %c \n
版本:${DC.Version}

+ 1
- 1
src/themes/contextmenu.scss Переглянути файл

@@ -16,7 +16,7 @@
.menu-item {
font-size: 14px;
list-style: none;
padding: 5px 0px 5px 10px;
padding: 5px 0 5px 10px;
border-top: 1px dashed #cecece;
&:hover {
color: rgb(42, 78, 236);

+ 2
- 3
src/themes/index.js Переглянути файл

@@ -1,9 +1,8 @@
/*
/**
* @Author: Caven
* @Date: 2020-01-21 10:48:50
* @Last Modified by: Caven
* @Last Modified time: 2020-07-24 14:06:59
*/

import 'cesium/Widgets/widgets.css'
import './index.scss'
import './popup.scss'

+ 1
- 1
src/themes/tooltip.scss Переглянути файл

@@ -6,7 +6,7 @@
height: 30px;
line-height: 30px;
color: #fff;
padding: 0px 10px;
padding: 0 10px;
background: rgba(0, 0, 0, 0.6);
border-radius: 4px;
visibility: hidden;

+ 1
- 3
src/thirdpart/index.js Переглянути файл

@@ -1,8 +1,6 @@
/*
/**
* @Author: Caven
* @Date: 2019-12-30 09:35:51
* @Last Modified by: Caven
* @Last Modified time: 2020-06-06 14:36:11
*/

const { Cesium } = DC.Namespace

+ 34
- 1
yarn.lock Переглянути файл

@@ -2244,7 +2244,7 @@ doctrine@^3.0.0:
dependencies:
esutils "^2.0.2"

dom-serializer@0:
dom-serializer@0, dom-serializer@^0.2.1:
version "0.2.2"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51"
integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==
@@ -2267,6 +2267,13 @@ domelementtype@^2.0.1:
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.0.1.tgz#1f8bdfe91f5a78063274e803b4bdcedf6e94f94d"
integrity sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==

domhandler@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-3.0.0.tgz#51cd13efca31da95bbb0c5bee3a48300e333b3e9"
integrity sha512-eKLdI5v9m67kbXQbJSNn1zjh0SDzvzWVWtX+qEI3eMjZw8daH9k8rlj1FZY9memPwjiskQFbe7vHVVJIAqoEhw==
dependencies:
domelementtype "^2.0.1"

domutils@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
@@ -2275,6 +2282,15 @@ domutils@^1.7.0:
dom-serializer "0"
domelementtype "1"

domutils@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.1.0.tgz#7ade3201af43703fde154952e3a868eb4b635f16"
integrity sha512-CD9M0Dm1iaHfQ1R/TI+z3/JWp/pgub0j4jIQKH89ARR4ATAV2nbaOQS5XxU9maJP5jHaPdDDQSEHuE2UmpUTKg==
dependencies:
dom-serializer "^0.2.1"
domelementtype "^2.0.1"
domhandler "^3.0.0"

dot-prop@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.2.0.tgz#c34ecc29556dc45f1f4c22697b6f4904e0cc4fcb"
@@ -2451,6 +2467,13 @@ eslint-plugin-es@^1.3.1:
eslint-utils "^1.4.2"
regexpp "^2.0.1"

eslint-plugin-html@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-html/-/eslint-plugin-html-6.0.2.tgz#fcbd293e218d03dd72c147fc999d185c6f5989fe"
integrity sha512-Ik/z32UteKLo8GEfwNqVKcJ/WOz/be4h8N5mbMmxxnZ+9aL9XczOXQFz/bGu+nAGVoRg8CflldxJhONFpqlrxw==
dependencies:
htmlparser2 "^4.1.0"

eslint-plugin-import@^2.16.0:
version "2.20.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz#91fc3807ce08be4837141272c8b99073906e588d"
@@ -3214,6 +3237,16 @@ html-comment-regex@^1.1.0:
resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7"
integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==

htmlparser2@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-4.1.0.tgz#9a4ef161f2e4625ebf7dfbe6c0a2f52d18a59e78"
integrity sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==
dependencies:
domelementtype "^2.0.1"
domhandler "^3.0.0"
domutils "^2.0.0"
entities "^2.0.0"

http-signature@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"

Завантаження…
Відмінити
Зберегти