ソースを参照

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

tags/1.5.1
Caven Chen 5年前
コミット
ce9b190d1c

+ 0
- 12173
dist/dc.base.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 353
- 0
dist/dc.base.min.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 0
- 1640
dist/dc.core.css
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 0
- 1064
dist/dc.core.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
dist/dc.core.min.css
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
dist/dc.core.min.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 0
- 220
dist/overlay/dc.overlay.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
dist/overlay/dc.overlay.min.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 0
- 232
dist/plot/dc.plot.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
dist/plot/dc.plot.min.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 0
- 664
dist/plugins/dc.plugins.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
dist/plugins/dc.plugins.min.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 1
src/core/Loader.Base.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2020-05-09 13:19:53 * @Date: 2020-05-09 13:19:53
* @Last Modified by: Caven * @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' import { DomUtil, Util } from './utils'

+ 0
- 26
src/core/event/RoamingEvent.js ファイルの表示

/*
* @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 ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2020-01-13 10:13:53 * @Date: 2020-01-13 10:13:53
* @Last Modified by: Caven * @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' import { Layer, VectorLayer } from './index'

+ 16
- 4
src/core/utils/Util.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2019-12-31 17:58:01 * @Date: 2019-12-31 17:58:01
* @Last Modified by: Caven * @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( const CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(
'' ''
) )
* @param {*} position * @param {*} position
*/ */
static checkPosition(position) { static checkPosition(position) {
return position && position instanceof Position
return (
position &&
position.hasOwnProperty('lng') &&
position.hasOwnProperty('lat') &&
position.hasOwnProperty('alt')
)
} }


/** /**
positions && (typeof positions === 'string' || Array.isArray(positions)) 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 export default Util

+ 6
- 3
src/plot/Plot.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2020-01-31 15:51:32 * @Date: 2020-01-31 15:51:32
* @Last Modified by: Caven * @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' import DrawPoint from './draw/DrawPoint'
import EditPoint from './edit/EditPoint' import EditPoint from './edit/EditPoint'
import EditPolyline from './edit/EditPolyline' import EditPolyline from './edit/EditPolyline'


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


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


class Plot { class Plot {
constructor(viewer) { constructor(viewer) {
if (!Util.checkViewer(viewer)) {
throw new Error('Plot: the viewer invalid')
}
this._viewer = viewer this._viewer = viewer
this._plotEvent = new Cesium.Event() this._plotEvent = new Cesium.Event()
this._callback = undefined this._callback = undefined
this._editWorker = undefined this._editWorker = undefined
this._drawLayer = new Cesium.CustomDataSource('plot-draw-layer') this._drawLayer = new Cesium.CustomDataSource('plot-draw-layer')
this._viewer.delegate.dataSources.add(this._drawLayer) 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._viewer.addLayer(this._markerLayer)
this._state = undefined this._state = undefined
} }

+ 2
- 2
src/plot/draw/Draw.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2020-01-31 19:45:32 * @Date: 2020-01-31 19:45:32
* @Last Modified by: Caven * @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 { class Draw {
constructor(plotInfo) { constructor(plotInfo) {

+ 2
- 2
src/plot/draw/DrawCircle.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2020-01-31 19:44:41 * @Date: 2020-01-31 19:44:41
* @Last Modified by: Caven * @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' import Draw from './Draw'


const { OverlayType, Transform } = DC const { OverlayType, Transform } = DC


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


const DEF_STYLE = { const DEF_STYLE = {
width: 3, width: 3,

+ 1
- 1
src/plot/draw/DrawPoint.js ファイルの表示



const { OverlayType, Transform } = DC const { OverlayType, Transform } = DC


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


const DEF_STYLE = { const DEF_STYLE = {
pixelSize: 10, pixelSize: 10,

+ 1
- 1
src/plot/draw/DrawPolygon.js ファイルの表示



const { OverlayType, Transform } = DC const { OverlayType, Transform } = DC


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


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

+ 1
- 1
src/plot/draw/DrawPolyline.js ファイルの表示



const { OverlayType, Transform } = DC const { OverlayType, Transform } = DC


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


const DEF_STYLE = { const DEF_STYLE = {
width: 3, width: 3,

+ 1
- 1
src/plot/draw/DrawRect.js ファイルの表示



const { OverlayType, Transform } = DC const { OverlayType, Transform } = DC


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


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

+ 1
- 1
src/plot/edit/Edit.js ファイルの表示



const { OverlayType, Transform } = DC const { OverlayType, Transform } = DC


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


class Edit { class Edit {
constructor(plotInfo) { constructor(plotInfo) {

+ 1
- 1
src/plot/index.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2020-04-03 10:13:42 * @Date: 2020-04-03 10:13:42
* @Last Modified by: Caven * @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) { const install = function(DC) {

+ 4
- 4
src/plugins/animation/AroudView.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2020-03-02 23:14:20 * @Date: 2020-03-02 23:14:20
* @Last Modified by: Caven * @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 const { Cesium } = DC.Namespace


class AroundView { class AroundView {
constructor(viewer, options = {}) { 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._viewer = viewer
this._options = options this._options = options

+ 7
- 8
src/plugins/animation/AroundPoint.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2020-03-02 22:38:10 * @Date: 2020-03-02 22:38:10
* @Last Modified by: Caven * @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 const { Cesium } = DC.Namespace


class AroundPoint { class AroundPoint {
constructor(viewer, position, options = {}) { 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._viewer = viewer
this._position = position this._position = position

読み込み中…
キャンセル
保存