Procházet zdrojové kódy

1.修改Cesium获取不到的Bug 2. 添加viewer 验证

tags/1.5.1
Caven Chen před 5 roky
rodič
revize
ce9b190d1c

+ 0
- 12173
dist/dc.base.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 353
- 0
dist/dc.base.min.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 0
- 1640
dist/dc.core.css
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 0
- 1064
dist/dc.core.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 0
dist/dc.core.min.css
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 0
dist/dc.core.min.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 0
- 220
dist/overlay/dc.overlay.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 0
dist/overlay/dc.overlay.min.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 0
- 232
dist/plot/dc.plot.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 0
dist/plot/dc.plot.min.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 0
- 664
dist/plugins/dc.plugins.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 0
dist/plugins/dc.plugins.min.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 1
src/core/Loader.Base.js Zobrazit soubor

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-05-09 13:19:53
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 00:21:25
* @Last Modified time: 2020-05-12 09:27:35
*/

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

+ 0
- 26
src/core/event/RoamingEvent.js Zobrazit soubor

@@ -1,26 +0,0 @@
/*
* @Author: Caven
* @Date: 2020-04-10 16:58:31
* @Last Modified by: Caven
* @Last Modified time: 2020-05-12 00:00:07
*/

import { RoamingEventType } from './EventType'
import Event from './Event'

const { Cesium } = DC.Namespace

class RoamingEvent extends Event {
constructor() {
super()
}

_registerEvent() {
Object.keys(RoamingEventType).forEach(key => {
let type = RoamingEventType[key]
this._cache[type] = new Cesium.Event()
})
}
}

export default RoamingEvent

+ 1
- 1
src/core/layer/GeoJsonLayer.js Zobrazit soubor

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-13 10:13:53
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:37:07
* @Last Modified time: 2020-05-12 09:27:31
*/

import { Layer, VectorLayer } from './index'

+ 16
- 4
src/core/utils/Util.js Zobrazit soubor

@@ -2,11 +2,9 @@
* @Author: Caven
* @Date: 2019-12-31 17:58:01
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:38:51
* @Last Modified time: 2020-05-12 09:53:43
*/

import Position from '../position/Position'

const CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(
''
)
@@ -99,7 +97,12 @@ class Util {
* @param {*} position
*/
static checkPosition(position) {
return position && position instanceof Position
return (
position &&
position.hasOwnProperty('lng') &&
position.hasOwnProperty('lat') &&
position.hasOwnProperty('alt')
)
}

/**
@@ -112,6 +115,15 @@ class Util {
positions && (typeof positions === 'string' || Array.isArray(positions))
)
}

/**
* @function checkViewer(viewer: Object): Boolean
* Check viewer for validity
* @param {*} position
*/
static checkViewer(viewer) {
return viewer && viewer.delegate && viewer.canvas
}
}

export default Util

+ 6
- 3
src/plot/Plot.js Zobrazit soubor

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-01-31 15:51:32
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 23:08:29
* @Last Modified time: 2020-05-12 10:00:09
*/

import DrawPoint from './draw/DrawPoint'
@@ -13,12 +13,15 @@ import DrawRect from './draw/DrawRect'
import EditPoint from './edit/EditPoint'
import EditPolyline from './edit/EditPolyline'

const { VectorLayer, OverlayType } = DC
const { OverlayType, Util } = DC

const { Cesium } = DC.Namespace

class Plot {
constructor(viewer) {
if (!Util.checkViewer(viewer)) {
throw new Error('Plot: the viewer invalid')
}
this._viewer = viewer
this._plotEvent = new Cesium.Event()
this._callback = undefined
@@ -26,7 +29,7 @@ class Plot {
this._editWorker = undefined
this._drawLayer = new Cesium.CustomDataSource('plot-draw-layer')
this._viewer.delegate.dataSources.add(this._drawLayer)
this._markerLayer = new VectorLayer('plot-marker-layer')
this._markerLayer = new DC.VectorLayer('plot-marker-layer')
this._viewer.addLayer(this._markerLayer)
this._state = undefined
}

+ 2
- 2
src/plot/draw/Draw.js Zobrazit soubor

@@ -2,10 +2,10 @@
* @Author: Caven
* @Date: 2020-01-31 19:45:32
* @Last Modified by: Caven
* @Last Modified time: 2020-05-10 10:57:23
* @Last Modified time: 2020-05-12 09:39:12
*/

const { Cesium } = DC.NameSpace
const { Cesium } = DC.Namespace

class Draw {
constructor(plotInfo) {

+ 2
- 2
src/plot/draw/DrawCircle.js Zobrazit soubor

@@ -2,14 +2,14 @@
* @Author: Caven
* @Date: 2020-01-31 19:44:41
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:31:32
* @Last Modified time: 2020-05-12 09:34:37
*/

import Draw from './Draw'

const { OverlayType, Transform } = DC

const { Cesium } = DC.NameSpace
const { Cesium } = DC.Namespace

const DEF_STYLE = {
width: 3,

+ 1
- 1
src/plot/draw/DrawPoint.js Zobrazit soubor

@@ -9,7 +9,7 @@ import Draw from './Draw'

const { OverlayType, Transform } = DC

const { Cesium } = DC.NameSpace
const { Cesium } = DC.Namespace

const DEF_STYLE = {
pixelSize: 10,

+ 1
- 1
src/plot/draw/DrawPolygon.js Zobrazit soubor

@@ -9,7 +9,7 @@ import Draw from './Draw'

const { OverlayType, Transform } = DC

const { Cesium } = DC.NameSpace
const { Cesium } = DC.Namespace

const DEF_STYLE = {
material: Cesium.Color.BLUE.withAlpha(0.6)

+ 1
- 1
src/plot/draw/DrawPolyline.js Zobrazit soubor

@@ -9,7 +9,7 @@ import Draw from './Draw'

const { OverlayType, Transform } = DC

const { Cesium } = DC.NameSpace
const { Cesium } = DC.Namespace

const DEF_STYLE = {
width: 3,

+ 1
- 1
src/plot/draw/DrawRect.js Zobrazit soubor

@@ -9,7 +9,7 @@ import Draw from './Draw'

const { OverlayType, Transform } = DC

const { Cesium } = DC.NameSpace
const { Cesium } = DC.Namespace

const DEF_STYLE = {
material: Cesium.Color.BLUE.withAlpha(0.6)

+ 1
- 1
src/plot/edit/Edit.js Zobrazit soubor

@@ -7,7 +7,7 @@

const { OverlayType, Transform } = DC

const { Cesium } = DC.NameSpace
const { Cesium } = DC.Namespace

class Edit {
constructor(plotInfo) {

+ 1
- 1
src/plot/index.js Zobrazit soubor

@@ -2,7 +2,7 @@
* @Author: Caven
* @Date: 2020-04-03 10:13:42
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 23:52:18
* @Last Modified time: 2020-05-12 09:31:46
*/

const install = function(DC) {

+ 4
- 4
src/plugins/animation/AroudView.js Zobrazit soubor

@@ -2,17 +2,17 @@
* @Author: Caven
* @Date: 2020-03-02 23:14:20
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 22:17:25
* @Last Modified time: 2020-05-12 09:56:16
*/

const { Viewer, SceneEventType } = DC
const { SceneEventType, Util } = DC

const { Cesium } = DC.Namespace

class AroundView {
constructor(viewer, options = {}) {
if (!viewer || !(viewer instanceof Viewer)) {
throw new Error('the viewer invalid')
if (!Util.checkViewer(viewer)) {
throw new Error('AroundView: the viewer invalid')
}
this._viewer = viewer
this._options = options

+ 7
- 8
src/plugins/animation/AroundPoint.js Zobrazit soubor

@@ -2,21 +2,20 @@
* @Author: Caven
* @Date: 2020-03-02 22:38:10
* @Last Modified by: Caven
* @Last Modified time: 2020-05-11 21:39:33
* @Last Modified time: 2020-05-12 09:57:49
*/

const { Viewer, SceneEventType, Position, Transfrom } = DC
const { Util, SceneEventType, Transfrom } = DC

const { Cesium } = DC.Namespace

class AroundPoint {
constructor(viewer, position, options = {}) {
if (
!position ||
!(viewer instanceof Viewer) ||
!(position instanceof Position)
) {
throw new Error('the position invalid')
if (!Util.checkViewer(viewer)) {
throw new Error('AroundPoint:the viewer invalid')
}
if (!Util.checkPosition(position)) {
throw new Error('AroundPoint:the position invalid')
}
this._viewer = viewer
this._position = position

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