Преглед изворни кода

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

tags/1.9.3
Caven Chen пре 5 година
родитељ
комит
2cb209dbf5

+ 8
- 0
CHANGE.md Прегледај датотеку

# 更新 # 更新


## 1.9.3

### 2020-8-22

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

## 1.9.2 ## 1.9.2


### 2020-8-15 ### 2020-8-15

+ 2
- 2
dist/dc.base.min.js
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 1
- 1
dist/dc.core.min.js
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 1
- 1
package.json Прегледај датотеку

{ {
"name": "@dvgis/dc-sdk", "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.", "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", "main": "index.js",
"repository": "https://github.com/dvgis/dc-sdk.git", "repository": "https://github.com/dvgis/dc-sdk.git",

+ 13
- 10
src/core/Loader.js Прегледај датотеку

import { import {
area, area,
bounds, bounds,
mid,
center, center,
distance, distance,
heading, heading,


const { Cesium } = DC.Namespace 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 = { const core = {
ImageryLayerFactory, ImageryLayerFactory,
TerrainFactory, TerrainFactory,
Polygon, Polygon,
Model, Model,
Tileset, Tileset,
Math: Cesium.Math
Math: {
...Cesium.Math,
area,
bounds,
mid,
center,
distance,
heading,
isBetween,
parabola,
curve
}
} }


DC.mixin(core) DC.mixin(core)

+ 1
- 0
src/core/math/index.js Прегледај датотеку



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

+ 29
- 0
src/core/math/mid.js Прегледај датотеку

/**
* @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 Прегледај датотеку

if (entity.billboard) { if (entity.billboard) {
billboard = new Billboard(position, entity.billboard.image.getValue(now)) billboard = new Billboard(position, entity.billboard.image.getValue(now))
billboard.attr = { billboard.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
} }
} }
return billboard return billboard

+ 1
- 1
src/core/overlay/base/DivIcon.js Прегледај датотеку

divIcon = new DC.DivIcon(position, content) divIcon = new DC.DivIcon(position, content)
if (entity.billboard) { if (entity.billboard) {
divIcon.attr = { divIcon.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
} }
} }
return divIcon return divIcon

+ 3
- 2
src/core/overlay/base/Label.js Прегледај датотеку

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

+ 1
- 1
src/core/overlay/base/Point.js Прегледај датотеку

) )
point = new Point(position) point = new Point(position)
point.attr = { point.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
} }
return point return point
} }

+ 1
- 1
src/core/overlay/base/Polygon.js Прегледај датотеку

) )
polygon = new Polygon(positions) polygon = new Polygon(positions)
polygon.attr = { polygon.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
} }
} }
return polygon return polygon

+ 1
- 1
src/core/overlay/base/Polyline.js Прегледај датотеку

) )
polyline = new Polyline(positions) polyline = new Polyline(positions)
polyline.attr = { polyline.attr = {
...entity.properties.getValue(now)
...entity?.properties?.getValue(now)
} }
} }
return polyline return polyline

Loading…
Откажи
Сачувај