cesium_dev_kit 1.0.50 → 1.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +233 -0
- package/dist/index.js +13582 -68
- package/dist/index.min.js +1 -0
- package/index.js +2 -2
- package/package.json +15 -9
- package/.babelrc +0 -13
- package/dist/ColorDeal.js +0 -59
- package/dist/common.js +0 -40
- package/dist/initConf.js +0 -188
- package/dist/libs/Analysis.js +0 -779
- package/dist/libs/Base.js +0 -950
- package/dist/libs/ChartLayer.js +0 -24
- package/dist/libs/Control.js +0 -947
- package/dist/libs/CustomCesiumPlugin.js +0 -92
- package/dist/libs/DomUtil.js +0 -105
- package/dist/libs/Draw.js +0 -704
- package/dist/libs/Graphics.js +0 -734
- package/dist/libs/MapvLayer.js +0 -26
- package/dist/libs/Material.js +0 -590
- package/dist/libs/Math2d.js +0 -559
- package/dist/libs/Math3d.js +0 -646
- package/dist/libs/PassEffect.js +0 -154
- package/dist/libs/Plugin.js +0 -751
- package/dist/libs/Primitive.js +0 -1559
- package/dist/libs/Shaders.js +0 -298
- package/dist/libs/ThreeJs.js +0 -190
- package/dist/libs/cesium-plugin.js +0 -3387
- package/dist/libs/index.js +0 -117
- package/dist/libs/plot/AttackArrow.js +0 -266
- package/dist/libs/plot/BasePlot.js +0 -41
- package/dist/libs/plot/PincerArrow.js +0 -278
- package/dist/libs/plot/StraightArrow.js +0 -244
- package/dist/libs/plot/algorithm.js +0 -315
- package/dist/libs/plot/index.js +0 -19
- package/dist/libs/plot/plotUtil.js +0 -242
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.CustomCesiumPlugin = CustomCesiumPlugin;
|
|
7
|
-
var _cesiumPlugin = require("./cesium-plugin");
|
|
8
|
-
let Cesium = null;
|
|
9
|
-
/**
|
|
10
|
-
* 自定义插件
|
|
11
|
-
* @param {*} viewer
|
|
12
|
-
*/
|
|
13
|
-
function CustomCesiumPlugin(viewer, cesiumGlobal) {
|
|
14
|
-
if (viewer) {
|
|
15
|
-
this._viewer = viewer;
|
|
16
|
-
Cesium = cesiumGlobal;
|
|
17
|
-
new _cesiumPlugin.CesiumPlugin(Window, Cesium);
|
|
18
|
-
this._customPluginLayer = new Cesium.CustomDataSource('_customPluginLayer');
|
|
19
|
-
viewer && viewer.dataSources.add(this._customPluginLayer);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
CustomCesiumPlugin.prototype = {
|
|
23
|
-
createRectangularSensorGraphics: function (options) {
|
|
24
|
-
if (this._customPluginLayer && options) {
|
|
25
|
-
let r = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(options.heading || 90), Cesium.Math.toRadians(options.pitch || 0), Cesium.Math.toRadians(options.roll || 0));
|
|
26
|
-
let l = options.position;
|
|
27
|
-
return this._customPluginLayer.entities.add({
|
|
28
|
-
position: l,
|
|
29
|
-
orientation: Cesium.Transforms.headingPitchRollQuaternion(l, r),
|
|
30
|
-
rectangularSensor: new Cesium.Scene.RectangularSensorGraphics({
|
|
31
|
-
radius: options.radius || 100000,
|
|
32
|
-
xHalfAngle: Cesium.Math.toRadians(options.xHalfAngle || 45),
|
|
33
|
-
yHalfAngle: Cesium.Math.toRadians(options.yHalfAngle || 45),
|
|
34
|
-
material: options.material || new Cesium.Color(1.0, 0.0, 1.0, 0.4),
|
|
35
|
-
lineColor: options.lineColor || new Cesium.Color(1.0, 0.0, 1.0, 1.0),
|
|
36
|
-
showScanPlane: options.showScanPlane || true,
|
|
37
|
-
scanPlaneColor: options.scanPlaneColor || new Cesium.Color(1.0, 0.0, 1.0, 1.0),
|
|
38
|
-
scanPlaneMode: options.scanPlaneMode || 'vertical',
|
|
39
|
-
scanPlaneRate: options.scanPlaneRate || 3,
|
|
40
|
-
showThroughEllipsoid: options.showThroughEllipsoid || !1
|
|
41
|
-
})
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
createSatelliteCoverageSimulationGraphics: function (options) {
|
|
46
|
-
if (options) {
|
|
47
|
-
return new Cesium.Scene.SatelliteCoverageSimulation(this._viewer, {
|
|
48
|
-
position: options.position,
|
|
49
|
-
angle1: options.angle1 || 30,
|
|
50
|
-
angle2: options.angle2 || 45,
|
|
51
|
-
areaType: options.areaType || 2,
|
|
52
|
-
rotation: {
|
|
53
|
-
heading: Cesium.Math.toRadians(options.heading || 0),
|
|
54
|
-
pitch: Cesium.Math.toRadians(options.pitch || 0),
|
|
55
|
-
roll: Cesium.Math.toRadians(options.roll || 0)
|
|
56
|
-
},
|
|
57
|
-
color: options.color || {
|
|
58
|
-
red: 0.43137254901960786,
|
|
59
|
-
green: 0.9607843137254902,
|
|
60
|
-
blue: 0,
|
|
61
|
-
alpha: 0.8
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
createRadarPrimitive: function (options) {
|
|
67
|
-
if (options) {
|
|
68
|
-
return new Cesium.Scene.RadarPrimitive(this._viewer, {
|
|
69
|
-
position: options.position,
|
|
70
|
-
angle: options.angle || 90 - 10,
|
|
71
|
-
radius: options.radius || 700000,
|
|
72
|
-
rotation: {
|
|
73
|
-
heading: Cesium.Math.toRadians(options.heading || 0),
|
|
74
|
-
pitch: Cesium.Math.toRadians(options.pitch || 40),
|
|
75
|
-
roll: Cesium.Math.toRadians(options.roll || 0)
|
|
76
|
-
},
|
|
77
|
-
color: options.color || {
|
|
78
|
-
red: 1,
|
|
79
|
-
green: 0,
|
|
80
|
-
blue: 0,
|
|
81
|
-
alpha: 0.4
|
|
82
|
-
},
|
|
83
|
-
lineColor: options.lineColor || {
|
|
84
|
-
red: 1,
|
|
85
|
-
green: 1,
|
|
86
|
-
blue: 1,
|
|
87
|
-
alpha: 0.9
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
package/dist/libs/DomUtil.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* dom 工具
|
|
5
|
-
* @param {*} viewer
|
|
6
|
-
*/
|
|
7
|
-
function DomUtil() {}
|
|
8
|
-
DomUtil.prototype = {
|
|
9
|
-
/**
|
|
10
|
-
* 创建dom元素
|
|
11
|
-
* @param {*} tagName
|
|
12
|
-
* @param {*} className
|
|
13
|
-
* @param {*} container
|
|
14
|
-
*/
|
|
15
|
-
createDom: function (tagName, className, container) {
|
|
16
|
-
var el = document.createElement(tagName);
|
|
17
|
-
el.className = className || '';
|
|
18
|
-
if (container) {
|
|
19
|
-
container.appendChild(el);
|
|
20
|
-
}
|
|
21
|
-
return el;
|
|
22
|
-
},
|
|
23
|
-
//删除 element
|
|
24
|
-
removeDom: function (el) {
|
|
25
|
-
var parent = el.parentNode;
|
|
26
|
-
if (parent) {
|
|
27
|
-
parent.removeChild(el);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
//清空 element
|
|
31
|
-
emptyDom: function (el) {
|
|
32
|
-
while (el.firstChild) {
|
|
33
|
-
el.removeChild(el.firstChild);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
//添加 class
|
|
37
|
-
addDomClass: function (el, name) {
|
|
38
|
-
if (el.classList !== undefined) {
|
|
39
|
-
var classes = this.splitWords(name);
|
|
40
|
-
for (var i = 0, len = classes.length; i < len; i++) {
|
|
41
|
-
el.classList.add(classes[i]);
|
|
42
|
-
}
|
|
43
|
-
} else if (!this.hasClass(el, name)) {
|
|
44
|
-
var className = this.getClass(el);
|
|
45
|
-
this.setClass(el, (className ? className + ' ' : '') + name);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
//删除class
|
|
49
|
-
removeDomClass: function (el, name) {
|
|
50
|
-
if (el.classList !== undefined) {
|
|
51
|
-
el.classList.remove(name);
|
|
52
|
-
} else {
|
|
53
|
-
this.setClass(el, this.trim((' ' + this.getClass(el) + ' ').replace(' ' + name + ' ', ' ')));
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
//设置 class
|
|
57
|
-
setDomClass: function (el, name) {
|
|
58
|
-
if (el.className.baseVal === undefined) {
|
|
59
|
-
el.className = name;
|
|
60
|
-
} else {
|
|
61
|
-
// in case of SVG element
|
|
62
|
-
el.className.baseVal = name;
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
//获取 el class
|
|
66
|
-
getDomClass: function (el) {
|
|
67
|
-
// Check if the element is an SVGElementInstance and use the correspondingElement instead
|
|
68
|
-
// (Required for linked SVG elements in IE11.)
|
|
69
|
-
if (el.correspondingElement) {
|
|
70
|
-
el = el.correspondingElement;
|
|
71
|
-
}
|
|
72
|
-
return el.className.baseVal === undefined ? el.className : el.className.baseVal;
|
|
73
|
-
},
|
|
74
|
-
//创建 svg
|
|
75
|
-
createDomSvg: function (width, height, path, container) {
|
|
76
|
-
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg:svg');
|
|
77
|
-
svg.setAttribute('class', 'svg-path');
|
|
78
|
-
svg.setAttribute('width', width);
|
|
79
|
-
svg.setAttribute('height', height);
|
|
80
|
-
svg.setAttribute('viewBox', '0 0 ' + width + ' ' + height);
|
|
81
|
-
var pathEl = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
82
|
-
pathEl.setAttribute('d', path);
|
|
83
|
-
svg.appendChild(pathEl);
|
|
84
|
-
if (container) {
|
|
85
|
-
container.appendChild(svg);
|
|
86
|
-
}
|
|
87
|
-
return svg;
|
|
88
|
-
},
|
|
89
|
-
//生成uuid
|
|
90
|
-
createUUID: function (prefix) {
|
|
91
|
-
prefix = prefix || 'D';
|
|
92
|
-
const CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
|
93
|
-
let uuid = [];
|
|
94
|
-
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
|
|
95
|
-
uuid[14] = '4';
|
|
96
|
-
let r;
|
|
97
|
-
for (let i = 0; i < 36; i++) {
|
|
98
|
-
if (!uuid[i]) {
|
|
99
|
-
r = 0 | Math.random() * 16;
|
|
100
|
-
uuid[i] = CHARS[i == 19 ? r & 0x3 | 0x8 : r];
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return prefix + '-' + uuid.join('');
|
|
104
|
-
}
|
|
105
|
-
};
|