cesium_dev_kit 1.0.48 → 1.0.50
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/.babelrc +13 -0
- package/dist/ColorDeal.js +59 -0
- package/dist/common.js +40 -0
- package/dist/index.js +23 -13561
- package/dist/initConf.js +188 -0
- package/dist/libs/Analysis.js +779 -0
- package/dist/libs/Base.js +950 -0
- package/dist/libs/ChartLayer.js +24 -0
- package/dist/libs/Control.js +947 -0
- package/dist/libs/CustomCesiumPlugin.js +92 -0
- package/dist/libs/DomUtil.js +105 -0
- package/dist/libs/Draw.js +704 -0
- package/dist/libs/Graphics.js +734 -0
- package/dist/libs/MapvLayer.js +26 -0
- package/dist/libs/Material.js +590 -0
- package/dist/libs/Math2d.js +559 -0
- package/dist/libs/Math3d.js +646 -0
- package/dist/libs/PassEffect.js +154 -0
- package/dist/libs/Plugin.js +751 -0
- package/dist/libs/Primitive.js +1559 -0
- package/dist/libs/Shaders.js +298 -0
- package/dist/libs/ThreeJs.js +190 -0
- package/dist/libs/cesium-plugin.js +3387 -0
- package/dist/libs/index.js +117 -0
- package/dist/libs/plot/AttackArrow.js +266 -0
- package/dist/libs/plot/BasePlot.js +41 -0
- package/dist/libs/plot/PincerArrow.js +278 -0
- package/dist/libs/plot/StraightArrow.js +244 -0
- package/dist/libs/plot/algorithm.js +315 -0
- package/dist/libs/plot/index.js +19 -0
- package/dist/libs/plot/plotUtil.js +242 -0
- package/index.js +1 -1
- package/package.json +5 -12
- package/dist/index.min.js +0 -1
package/.babelrc
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.colorRGB2Hex = colorRGB2Hex;
|
|
7
|
+
exports.colorRgb = colorRgb;
|
|
8
|
+
exports.colorRgb1 = colorRgb1;
|
|
9
|
+
exports.colorRgbString = colorRgbString;
|
|
10
|
+
// 输入16进制颜色值 转 rgb 的数组值 255
|
|
11
|
+
function colorRgb(inColor) {
|
|
12
|
+
// 16进制颜色值的正则
|
|
13
|
+
const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
|
14
|
+
// 把颜色值变成小写
|
|
15
|
+
let color = inColor.toLowerCase();
|
|
16
|
+
if (reg.test(color)) {
|
|
17
|
+
// 如果只有三位的值,需变成六位,如:#fff => #ffffff
|
|
18
|
+
if (color.length === 4) {
|
|
19
|
+
let colorNew = '#';
|
|
20
|
+
for (let i = 1; i < 4; i += 1) {
|
|
21
|
+
colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1));
|
|
22
|
+
}
|
|
23
|
+
color = colorNew;
|
|
24
|
+
}
|
|
25
|
+
// 处理六位的颜色值,转为RGB
|
|
26
|
+
const colorChange = [];
|
|
27
|
+
for (let i = 1; i < 7; i += 2) {
|
|
28
|
+
colorChange.push(parseInt('0x' + color.slice(i, i + 2)));
|
|
29
|
+
}
|
|
30
|
+
return colorChange;
|
|
31
|
+
}
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
// 输入16进制颜色值 转 rgb 的字符 255
|
|
35
|
+
function colorRgbString(inColor) {
|
|
36
|
+
let arr = colorRgb(inColor);
|
|
37
|
+
return 'rgb(' + arr[0] + ',' + arr[1] + ',' + arr[2] + ')';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 输入16进制颜色值 转 rgb 的数组值 0.0 - 1.0
|
|
41
|
+
function colorRgb1(inColor) {
|
|
42
|
+
const colorChange = colorRgb(inColor);
|
|
43
|
+
colorChange.forEach((ele, index) => {
|
|
44
|
+
colorChange[index] = (ele / 255.0).toFixed(2);
|
|
45
|
+
});
|
|
46
|
+
return colorChange;
|
|
47
|
+
}
|
|
48
|
+
// RGB转16进制(rgb2hex)
|
|
49
|
+
function colorRGB2Hex(color) {
|
|
50
|
+
const rgb = color.split(',');
|
|
51
|
+
if (rgb.length <= 1) {
|
|
52
|
+
return color;
|
|
53
|
+
}
|
|
54
|
+
const r = parseInt(rgb[0].split('(')[1]);
|
|
55
|
+
const g = parseInt(rgb[1]);
|
|
56
|
+
const b = parseInt(rgb[2].split(')')[0]);
|
|
57
|
+
const hex = '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
58
|
+
return hex;
|
|
59
|
+
}
|
package/dist/common.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.evil = evil;
|
|
7
|
+
exports.getUrlKey = getUrlKey;
|
|
8
|
+
exports.getUrlParma = getUrlParma;
|
|
9
|
+
exports.string_to_name = string_to_name;
|
|
10
|
+
// 函数
|
|
11
|
+
function evil(fn) {
|
|
12
|
+
const Fn = Function; // 一个变量指向Function,防止有些前端编译工具报错
|
|
13
|
+
// return new Fn('return ' + fn)()
|
|
14
|
+
return new Fn('return ' + fn)();
|
|
15
|
+
}
|
|
16
|
+
// 获得get参数
|
|
17
|
+
function getUrlKey(name, url) {
|
|
18
|
+
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(url) || [null, '', null])[1].replace(/\+/g, '%20')) || null;
|
|
19
|
+
}
|
|
20
|
+
// 获得格式化后的get参数
|
|
21
|
+
function getUrlParma(p, type = 'string') {
|
|
22
|
+
let UrlParma = getUrlKey(p, window.location.href);
|
|
23
|
+
if (type === 'int') {
|
|
24
|
+
return parseInt(UrlParma);
|
|
25
|
+
}
|
|
26
|
+
if (type === 'float') {
|
|
27
|
+
return parseFloat(UrlParma);
|
|
28
|
+
}
|
|
29
|
+
if (UrlParma && type === 'array') {
|
|
30
|
+
UrlParma = UrlParma.split(',');
|
|
31
|
+
return [parseFloat(UrlParma[0]), parseFloat(UrlParma[1]), parseFloat(UrlParma[2])];
|
|
32
|
+
}
|
|
33
|
+
return UrlParma;
|
|
34
|
+
}
|
|
35
|
+
// 将一个字符串转换为变量名
|
|
36
|
+
function string_to_name(string) {
|
|
37
|
+
let _name = 'let new_name = ' + string;
|
|
38
|
+
evil(_name);
|
|
39
|
+
return _name;
|
|
40
|
+
}
|