浏览代码

1.添加覆盖物支持Entity转换函数,2. 添加wms地图服务的支持

tags/1.9.3
Caven Chen 5 年前
父节点
当前提交
2cb209dbf5

+ 8
- 0
CHANGE.md 查看文件

@@ -1,5 +1,13 @@
# 更新

## 1.9.3

### 2020-8-22

> 1. 添加贝塞尔曲线、两点中心点的函数
> 2. 添加覆盖物支持Entity转换函数
> 3. 添加wms地图服务的支持

## 1.9.2

### 2020-8-15

+ 2
- 2
dist/dc.base.min.js
文件差异内容过多而无法显示
查看文件


+ 1
- 1
dist/dc.core.min.js
文件差异内容过多而无法显示
查看文件


+ 1
- 1
package.json 查看文件

@@ -1,6 +1,6 @@
{
"name": "@dvgis/dc-sdk",
"version": "1.9.2",
"version": "1.9.3",
"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",

+ 13
- 10
src/core/Loader.js 查看文件

@@ -30,6 +30,7 @@ import {
import {
area,
bounds,
mid,
center,
distance,
heading,
@@ -40,15 +41,6 @@ import {

const { Cesium } = DC.Namespace

Cesium.Math.area = area
Cesium.Math.bounds = bounds
Cesium.Math.center = center
Cesium.Math.distance = distance
Cesium.Math.heading = heading
Cesium.Math.isBetween = isBetween
Cesium.Math.parabola = parabola
Cesium.Math.curve = curve

const core = {
ImageryLayerFactory,
TerrainFactory,
@@ -69,7 +61,18 @@ const core = {
Polygon,
Model,
Tileset,
Math: Cesium.Math
Math: {
...Cesium.Math,
area,
bounds,
mid,
center,
distance,
heading,
isBetween,
parabola,
curve
}
}

DC.mixin(core)

+ 1
- 0
src/core/math/index.js 查看文件

@@ -5,6 +5,7 @@

export { default as area } from './area'
export { default as bounds } from './bounds'
export { default as mid } from './mid'
export { default as center } from './center'
export { default as distance } from './distance'
export { default as heading } from './heading'

+ 29
- 0
src/core/math/mid.js 查看文件

@@ -0,0 +1,29 @@
/**
* @Author: Caven
* @Date: 2020-08-21 18:16:52
*/

import Position from '../position/Position'
import Transform from '../transform/Transform'
const { Cesium } = DC.Namespace

export default function mid(startPosition, endPosition) {
if (startPosition instanceof Position) {
startPosition = Transform.transformWGS84ToCartographic(startPosition)
}

if (endPosition instanceof Position) {
endPosition = Transform.transformWGS84ToCartographic(endPosition)
}

let mc = new Cesium.EllipsoidGeodesic(
startPosition,
endPosition
).interpolateUsingFraction(0.5)

return new Position(
Cesium.Math.toDegrees(mc.longitude),
Cesium.Math.toDegrees(mc.latitude),
mc.height
)
}

+ 1
- 1
src/core/overlay/base/Billboard.js 查看文件

@@ -99,7 +99,7 @@ class Billboard extends Overlay {
if (entity.billboard) {
billboard = new Billboard(position, entity.billboard.image.getValue(now))
billboard.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
}
}
return billboard

+ 1
- 1
src/core/overlay/base/DivIcon.js 查看文件

@@ -166,7 +166,7 @@ class DivIcon extends Overlay {
divIcon = new DC.DivIcon(position, content)
if (entity.billboard) {
divIcon.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
}
}
return divIcon

+ 3
- 2
src/core/overlay/base/Label.js 查看文件

@@ -85,14 +85,15 @@ class Label extends Overlay {
* @returns {any}
*/
static fromEntity(entity) {
let now = Cesium.JulianDate.now()
let position = Transform.transformCartesianToWGS84(
entity.position.getValue(Cesium.JulianDate.now())
entity.position.getValue(now)
)
let label = undefined
if (entity.billboard) {
label = new Label(position, entity.name)
label.attr = {
...entity.properties.getValue(Cesium.JulianDate.now())
...entity?.properties?.getValue(now)
}
}
return label

+ 1
- 1
src/core/overlay/base/Point.js 查看文件

@@ -78,7 +78,7 @@ class Point extends Overlay {
)
point = new Point(position)
point.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
}
return point
}

+ 1
- 1
src/core/overlay/base/Polygon.js 查看文件

@@ -120,7 +120,7 @@ class Polygon extends Overlay {
)
polygon = new Polygon(positions)
polygon.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
}
}
return polygon

+ 1
- 1
src/core/overlay/base/Polyline.js 查看文件

@@ -92,7 +92,7 @@ class Polyline extends Overlay {
)
polyline = new Polyline(positions)
polyline.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
}
}
return polyline

正在加载...
取消
保存