Explorar el Código

发布1.14.1版本

tags/1.14.1
Caven Chen hace 4 años
padre
commit
86f5c23a20
Se han modificado 7 ficheros con 123 adiciones y 18 borrados
  1. 9
    7
      README.md
  2. 9
    7
      README_zh.md
  3. 2
    2
      dist/dc.base.min.js
  4. 1
    1
      dist/dc.core.min.js
  5. 1
    1
      package.json
  6. 52
    0
      src/core/layer/CzmlLayer.js
  7. 49
    0
      src/core/layer/KmlLayer.js

+ 9
- 7
README.md Ver fichero

@@ -11,7 +11,9 @@

> DC-SDK is a 2D and 3D integrated WebGis application framework based on the secondary development of Cesium. This framework optimizes the usage mode of Cesium and adds some additional functions, aiming to build WebGis applications for developers quickly.

> [Home Page](http://dc.dvgis.cn)
## Home

> http://dc.dvgis.cn

```warningH
Tips:This SDK is JS+GIS framework package. Developers need to have some front-end technology and GIS related technology
@@ -33,8 +35,8 @@ Tips:This SDK is JS+GIS framework package. Developers need to have some front-
`NPM / YARN`

```shell
yarn add @dvgis/dc-sdk
npm install @dvgis/dc-sdk
yarn add @dvgis/dc-sdk
npm install @dvgis/dc-sdk
```

```js
@@ -128,7 +130,7 @@ module.exports = {

```js
global.DC = DC
DC.use(DcCore)
DC.use(DcCore) // node
DC.ready(() => {
let viewer = new DC.Viewer(divId) // divId is the Id attribute value of a div node. If it is not passed in, the 3D scene cannot be initialized
})
@@ -136,15 +138,15 @@ DC.ready(() => {

## Documentation

[DC Api](https://resource.dvgis.cn/dc-api)
[DC Sdk Api](https://resource.dvgis.cn/dc-api)

[Cesium Api](https://cesium.com/docs/cesiumjs-ref-doc/)

## Demo

| ![picture](http://dc.dvgis.cn/examples/images/baselayer/google.png) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/baidu.png?v=1) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/tdt.png?v=1) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/arcgis.png) |
| ![picture](http://dc.dvgis.cn/examples/images/baselayer/baidu.png?v=1) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/tdt.png?v=1) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/arcgis.png) | ![picture](http://dc.dvgis.cn/examples/images/mini-scene/china.gif) |
| :-----------------------------------------------------------: | :-----------------------------------------------------------: | :------------------------------------------------------------------: | :--------------------------------------------------------------: |
| ![picture](http://dc.dvgis.cn/examples/images/scene/globe_rotate.gif) | ![picture](http://dc.dvgis.cn/examples/images/mini-scene/factory.gif) | ![picture](http://dc.dvgis.cn/examples/images/layer/cluster_circle.gif) | ![picture](http://dc.dvgis.cn/examples/images/model/shp_custom_shader.gif) |
| ![picture](http://dc.dvgis.cn/examples/images/mini-scene/dfmz.gif) | ![picture](http://dc.dvgis.cn/examples/images/mini-scene/factory.gif) | ![picture](http://dc.dvgis.cn/examples/images/layer/cluster_circle.gif) | ![picture](http://dc.dvgis.cn/examples/images/model/shp_custom_shader.gif) |
| ![picture](http://dc.dvgis.cn/examples/images/overlay/polyline_image_trail.gif) | ![picture](http://dc.dvgis.cn/examples/images/overlay/wall_trail.gif) | ![picture](http://dc.dvgis.cn/examples/images/overlay/water.gif) | ![picture](http://dc.dvgis.cn/examples/images/overlay/plot-overlay.png) |

[More>>](http://dc.dvgis.cn/#/examples)

+ 9
- 7
README_zh.md Ver fichero

@@ -11,7 +11,9 @@

> DC-SDK 是基于 Cesium 进行二次开发的2、3D一体 WebGis 应用框架,该框架优化了 Cesium 的使用方式和增添了一些额外功能,旨在为开发者快速构建 WebGis 应用。

> [主页](http://dc.dvgis.cn)
##主页

> http://dc.dvgis.cn

```warning
Tips:本框架是 JS+GIS 的框架包。开发者需要有一定的前端技术和 GIS 相关技术
@@ -33,8 +35,8 @@ Tips:本框架是 JS+GIS 的框架包。开发者需要有一定的前端技
`NPM / YARN`

```shell
yarn add @dvgis/dc-sdk
npm install @dvgis/dc-sdk
yarn add @dvgis/dc-sdk
npm install @dvgis/dc-sdk
```

```js
@@ -128,7 +130,7 @@ module.exports = {

```js
global.DC = DC
DC.use(DcCore)
DC.use(DcCore) // Node 方式
DC.ready(() => {
let viewer = new DC.Viewer(divId) // divId 为一个div节点的Id属性值,如果不传入,会无法初始化3D场景
})
@@ -136,15 +138,15 @@ DC.ready(() => {

## 文档

[DC Api](https://resource.dvgis.cn/dc-api)
[DC Sdk Api](https://resource.dvgis.cn/dc-api)

[Cesium Api](https://cesium.com/docs/cesiumjs-ref-doc/)

## 示例

| ![picture](http://dc.dvgis.cn/examples/images/baselayer/google.png) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/baidu.png?v=1) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/tdt.png?v=1) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/arcgis.png) |
| ![picture](http://dc.dvgis.cn/examples/images/baselayer/baidu.png?v=1) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/tdt.png?v=1) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/arcgis.png) | ![picture](http://dc.dvgis.cn/examples/images/mini-scene/china.gif) |
| :-----------------------------------------------------------: | :-----------------------------------------------------------: | :------------------------------------------------------------------: | :--------------------------------------------------------------: |
| ![picture](http://dc.dvgis.cn/examples/images/scene/globe_rotate.gif) | ![picture](http://dc.dvgis.cn/examples/images/mini-scene/factory.gif) | ![picture](http://dc.dvgis.cn/examples/images/layer/cluster_circle.gif) | ![picture](http://dc.dvgis.cn/examples/images/model/shp_custom_shader.gif) |
| ![picture](http://dc.dvgis.cn/examples/images/mini-scene/dfmz.gif) | ![picture](http://dc.dvgis.cn/examples/images/mini-scene/factory.gif) | ![picture](http://dc.dvgis.cn/examples/images/layer/cluster_circle.gif) | ![picture](http://dc.dvgis.cn/examples/images/model/shp_custom_shader.gif) |
| ![picture](http://dc.dvgis.cn/examples/images/overlay/polyline_image_trail.gif) | ![picture](http://dc.dvgis.cn/examples/images/overlay/wall_trail.gif) | ![picture](http://dc.dvgis.cn/examples/images/overlay/water.gif) | ![picture](http://dc.dvgis.cn/examples/images/overlay/plot-overlay.png) |

[更多>>](http://dc.dvgis.cn/#/examples)

+ 2
- 2
dist/dc.base.min.js
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 1
- 1
dist/dc.core.min.js
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 1
- 1
package.json Ver fichero

@@ -1,6 +1,6 @@
{
"name": "@dvgis/dc-sdk",
"version": "1.14.0",
"version": "1.14.1",
"description": " The SDK is a secondary development based on the open source project Cesium, which optimizes some operations of Cesium and enables developers to quickly develop 3D applications through the framework.",
"main": "index.js",
"repository": "https://github.com/dvgis/dc-sdk.git",

+ 52
- 0
src/core/layer/CzmlLayer.js Ver fichero

@@ -0,0 +1,52 @@
/**
* @Author: Caven
* @Date: 2020-01-19 13:38:48
*/

import State from '../state/State'
import Layer from './Layer'

const { Cesium } = DC.Namespace

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

set show(show) {
this._show = show
this._delegate &&
this._delegate.then(dataSource => {
dataSource.show = this._show
})
}

get show() {
return this._show
}

/**
*
* @param method
* @param context
* @returns {CzmlLayer}
*/
eachOverlay(method, context) {
if (this._delegate) {
this._delegate.then(dataSource => {
let entities = dataSource.entities.values
entities.forEach(item => {
method.call(context, item)
})
})
return this
}
}
}

Layer.registerType('czml')

export default CzmlLayer

+ 49
- 0
src/core/layer/KmlLayer.js Ver fichero

@@ -0,0 +1,49 @@
/**
* @Author: Caven
* @Date: 2020-01-19 11:03:17
*/

import State from '../state/State'
import Layer from './Layer'

const { Cesium } = DC.Namespace

class KmlLayer extends Layer {
constructor(id, url, options = {}) {
if (!url) {
throw new Error('KmlLayer: the url is empty')
}
super(id)
this._delegate = Cesium.KmlDataSource.load(url, options)
this.type = Layer.getLayerType('kml')
this._state = State.INITIALIZED
}

set show(show) {
this._show = show
this._delegate &&
this._delegate.then(dataSource => {
dataSource.show = this._show
})
}

get show() {
return this._show
}

eachOverlay(method, context) {
if (this._delegate) {
this._delegate.then(dataSource => {
let entities = dataSource.entities.values
entities.forEach(item => {
method.call(context, item)
})
})
return this
}
}
}

Layer.registerType('kml')

export default KmlLayer

Cargando…
Cancelar
Guardar