@vtx/cs-map 1.0.102 → 1.0.104
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/lib/cesium-tiles-layer/demo/putian/index.css +8 -0
- package/lib/cesium-tiles-layer/demo/putian/index.less +9 -0
- package/lib/cone-glow-layer/BottomCircle.js +59 -0
- package/lib/cone-glow-layer/BottomCircle.js.map +1 -0
- package/lib/cone-glow-layer/ButtomRotateCircle.js +67 -0
- package/lib/cone-glow-layer/ButtomRotateCircle.js.map +1 -0
- package/lib/cone-glow-layer/ConeGlowLayer.js +202 -0
- package/lib/cone-glow-layer/ConeGlowLayer.js.map +1 -0
- package/lib/cone-glow-layer/Texture.js +45 -0
- package/lib/cone-glow-layer/Texture.js.map +1 -0
- package/lib/dom/index.js +53 -10
- package/lib/dom/index.js.map +1 -1
- package/lib/image-layer/ImageLayer.js +1 -1
- package/lib/image-layer/ImageLayer.js.map +1 -1
- package/lib/map/index.js +22 -16
- package/lib/map/index.js.map +1 -1
- package/lib/road-line-layer/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,3 +13,11 @@
|
|
|
13
13
|
z-index: 2;
|
|
14
14
|
background-image: radial-gradient(rgba(219, 225, 239, 0.05) 50%, rgba(65, 57, 57, 0.5) 70%, #111010 90%);
|
|
15
15
|
}
|
|
16
|
+
.label {
|
|
17
|
+
padding: 2px 10px;
|
|
18
|
+
color: #ffffff;
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
background: linear-gradient(271deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 51%, rgba(0, 0, 0, 0) 100%);
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = ConeGlowBottomCircleMaterialProperty;
|
|
7
|
+
var _cesium = require("cesium");
|
|
8
|
+
var _Texture = require("./Texture.js");
|
|
9
|
+
function ConeGlowBottomCircleMaterialProperty(color) {
|
|
10
|
+
this._definitionChanged = new _cesium.Event();
|
|
11
|
+
this._color = undefined;
|
|
12
|
+
this._colorSubscription = undefined;
|
|
13
|
+
this.color = color;
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperties(ConeGlowBottomCircleMaterialProperty.prototype, {
|
|
16
|
+
isConstant: {
|
|
17
|
+
get: function get() {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
definitionChanged: {
|
|
22
|
+
get: function get() {
|
|
23
|
+
return this._definitionChanged;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
color: (0, _cesium.createPropertyDescriptor)("color")
|
|
27
|
+
});
|
|
28
|
+
ConeGlowBottomCircleMaterialProperty.prototype.getType = function () {
|
|
29
|
+
return "ConeGlowBottomCircle";
|
|
30
|
+
};
|
|
31
|
+
ConeGlowBottomCircleMaterialProperty.prototype.getValue = function (time, result) {
|
|
32
|
+
if (!(0, _cesium.defined)(result)) {
|
|
33
|
+
result = {};
|
|
34
|
+
}
|
|
35
|
+
result.color = _cesium.Property.getValueOrClonedDefault(this._color, time, _cesium.Color.WHITE, result.color);
|
|
36
|
+
result.image = _cesium.Material.ConeGlowBottomCircleImage;
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
ConeGlowBottomCircleMaterialProperty.prototype.equals = function (other) {
|
|
40
|
+
return this === other || other instanceof ConeGlowBottomCircleMaterialProperty && _cesium.Property.equals(this._color, other._color);
|
|
41
|
+
};
|
|
42
|
+
_cesium.Material.ConeGlowBottomCircleType = "ConeGlowBottomCircle";
|
|
43
|
+
_cesium.Material.ConeGlowBottomCircleImage = (0, _Texture.createBottomCircleTexture)();
|
|
44
|
+
_cesium.Material.ConeGlowBottomCircleSource = "czm_material czm_getMaterial(czm_materialInput materialInput) {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture2D(image, vec2(st));\n material.alpha = colorImage.a * color.a;\n material.diffuse = 1.5* color.rgb;\n return material;\n }";
|
|
45
|
+
_cesium.Material._materialCache.addMaterial(_cesium.Material.ConeGlowBottomCircleType, {
|
|
46
|
+
fabric: {
|
|
47
|
+
type: _cesium.Material.ConeGlowBottomCircleType,
|
|
48
|
+
uniforms: {
|
|
49
|
+
color: new _cesium.Color(1.0, 0.0, 0.0, 0.5),
|
|
50
|
+
image: _cesium.Material.ConeGlowBottomCircleImage,
|
|
51
|
+
time: 0
|
|
52
|
+
},
|
|
53
|
+
source: _cesium.Material.ConeGlowBottomCircleSource
|
|
54
|
+
},
|
|
55
|
+
translucent: function translucent() {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=BottomCircle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomCircle.js","names":["_cesium","require","_Texture","ConeGlowBottomCircleMaterialProperty","color","_definitionChanged","Event","_color","undefined","_colorSubscription","Object","defineProperties","prototype","isConstant","get","definitionChanged","createPropertyDescriptor","getType","getValue","time","result","defined","Property","getValueOrClonedDefault","Color","WHITE","image","Material","ConeGlowBottomCircleImage","equals","other","ConeGlowBottomCircleType","createBottomCircleTexture","ConeGlowBottomCircleSource","_materialCache","addMaterial","fabric","type","uniforms","source","translucent"],"sources":["cone-glow-layer/BottomCircle.js"],"sourcesContent":["import {\n Event,\n createPropertyDescriptor,\n defined,\n Property,\n Color,\n Material\n} from \"cesium\";\nimport { createBottomCircleTexture } from \"./Texture.js\"\n\nexport default function ConeGlowBottomCircleMaterialProperty(color) {\n this._definitionChanged = new Event();\n this._color = undefined;\n this._colorSubscription = undefined;\n this.color = color;\n}\nObject.defineProperties(ConeGlowBottomCircleMaterialProperty.prototype, {\n isConstant: {\n get: function() {\n return false;\n }\n },\n definitionChanged: {\n get: function() {\n return this._definitionChanged;\n }\n },\n color: createPropertyDescriptor(\"color\")\n});\nConeGlowBottomCircleMaterialProperty.prototype.getType = function() {\n return \"ConeGlowBottomCircle\";\n}\nConeGlowBottomCircleMaterialProperty.prototype.getValue = function(time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.color = Property.getValueOrClonedDefault(this._color, time, Color.WHITE, result.color);\n result.image = Material.ConeGlowBottomCircleImage;\n return result;\n}\nConeGlowBottomCircleMaterialProperty.prototype.equals = function(other) {\n return this === other ||\n (other instanceof ConeGlowBottomCircleMaterialProperty &&\n Property.equals(this._color, other._color))\n}\nMaterial.ConeGlowBottomCircleType = \"ConeGlowBottomCircle\";\nMaterial.ConeGlowBottomCircleImage = createBottomCircleTexture();\nMaterial.ConeGlowBottomCircleSource =\n `czm_material czm_getMaterial(czm_materialInput materialInput) {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture2D(image, vec2(st));\n material.alpha = colorImage.a * color.a;\n material.diffuse = 1.5* color.rgb;\n return material;\n }`;\n\nMaterial._materialCache.addMaterial(Material.ConeGlowBottomCircleType, {\n fabric: {\n type: Material.ConeGlowBottomCircleType,\n uniforms: {\n color: new Color(1.0, 0.0, 0.0, 0.5),\n image: Material.ConeGlowBottomCircleImage,\n time: 0\n },\n source: Material.ConeGlowBottomCircleSource\n },\n translucent: function() {\n return true;\n }\n});\n\n\n\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OAAA;AAEe,SAASE,oCAAoCA,CAACC,KAAK,EAAE;EAChE,IAAI,CAACC,kBAAkB,GAAG,IAAIC,aAAK,CAAC,CAAC;EACrC,IAAI,CAACC,MAAM,GAAGC,SAAS;EACvB,IAAI,CAACC,kBAAkB,GAAGD,SAAS;EACnC,IAAI,CAACJ,KAAK,GAAGA,KAAK;AACtB;AACAM,MAAM,CAACC,gBAAgB,CAACR,oCAAoC,CAACS,S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M,EAAE;IACJC,IAAI,EAAEV,gBAAQ,CAACI,wBAAwB;IACvCO,QAAQ,EAAE;MACNlC,KAAK,EAAE,IAAIoB,aAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;MACpCE,KAAK,EAAEC,gBAAQ,CAACC,yBAAyB;MACzCT,IAAI,EAAE;IACV,CAAC;IACDoB,MAAM,EAAEZ,gBAAQ,CAACM;EACrB,CAAC;EACDO,WAAW,EAAE,SAAAA,YAAA,EAAW;IACpB,OAAO,IAAI;EACf;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = ConeGlowBottomRotateCircleMaterialProperty;
|
|
7
|
+
var _cesium = require("cesium");
|
|
8
|
+
var _Texture = require("./Texture.js");
|
|
9
|
+
function ConeGlowBottomRotateCircleMaterialProperty(color) {
|
|
10
|
+
this._definitionChanged = new _cesium.Event();
|
|
11
|
+
this._color = undefined;
|
|
12
|
+
this._colorSubscription = undefined;
|
|
13
|
+
this.color = color;
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperties(ConeGlowBottomRotateCircleMaterialProperty.prototype, {
|
|
16
|
+
isConstant: {
|
|
17
|
+
get: function get() {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
definitionChanged: {
|
|
22
|
+
get: function get() {
|
|
23
|
+
return this._definitionChanged;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
color: (0, _cesium.createPropertyDescriptor)("color")
|
|
27
|
+
});
|
|
28
|
+
ConeGlowBottomRotateCircleMaterialProperty.prototype.getType = function () {
|
|
29
|
+
return "ConeGlowBottomRotateCircle";
|
|
30
|
+
};
|
|
31
|
+
ConeGlowBottomRotateCircleMaterialProperty.prototype.getValue = function (time, result) {
|
|
32
|
+
if (!(0, _cesium.defined)(result)) {
|
|
33
|
+
result = {};
|
|
34
|
+
}
|
|
35
|
+
result.color = _cesium.Property.getValueOrClonedDefault(this._color, time, _cesium.Color.WHITE, result.color);
|
|
36
|
+
result.image = _cesium.Material.ConeGlowBottomRotateCircleImage;
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
ConeGlowBottomRotateCircleMaterialProperty.prototype.equals = function (other) {
|
|
40
|
+
return this === other || other instanceof ConeGlowBottomRotateCircleMaterialProperty && _cesium.Property.equals(this._color, other._color);
|
|
41
|
+
};
|
|
42
|
+
_cesium.Material.ConeGlowBottomRotateCircleType = "ConeGlowBottomRotateCircle";
|
|
43
|
+
_cesium.Material.ConeGlowBottomRotateCircleImage = (0, _Texture.createBottomRotateCircleTexture)();
|
|
44
|
+
_cesium.Material.ConeGlowBottomRotateCircleSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n\
|
|
45
|
+
{\n\
|
|
46
|
+
czm_material material = czm_getDefaultMaterial(materialInput);\n\
|
|
47
|
+
vec2 st = materialInput.st;\n\
|
|
48
|
+
vec4 colorImage = texture2D(image, vec2(st ));\n\
|
|
49
|
+
material.diffuse = 2.5 * color.rgb ;\n\
|
|
50
|
+
material.alpha = colorImage.a ;\n\
|
|
51
|
+
return material;\n\
|
|
52
|
+
}";
|
|
53
|
+
_cesium.Material._materialCache.addMaterial(_cesium.Material.ConeGlowBottomRotateCircleType, {
|
|
54
|
+
fabric: {
|
|
55
|
+
type: _cesium.Material.ConeGlowBottomRotateCircleType,
|
|
56
|
+
uniforms: {
|
|
57
|
+
color: new _cesium.Color(1.0, 0.0, 0.0, 0.5),
|
|
58
|
+
image: _cesium.Material.ConeGlowBottomRotateCircleImage,
|
|
59
|
+
time: 0
|
|
60
|
+
},
|
|
61
|
+
source: _cesium.Material.ConeGlowBottomRotateCircleSource
|
|
62
|
+
},
|
|
63
|
+
translucent: function translucent() {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=ButtomRotateCircle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtomRotateCircle.js","names":["_cesium","require","_Texture","ConeGlowBottomRotateCircleMaterialProperty","color","_definitionChanged","Event","_color","undefined","_colorSubscription","Object","defineProperties","prototype","isConstant","get","definitionChanged","createPropertyDescriptor","getType","getValue","time","result","defined","Property","getValueOrClonedDefault","Color","WHITE","image","Material","ConeGlowBottomRotateCircleImage","equals","other","ConeGlowBottomRotateCircleType","createBottomRotateCircleTexture","ConeGlowBottomRotateCircleSource","_materialCache","addMaterial","fabric","type","uniforms","source","translucent"],"sources":["cone-glow-layer/ButtomRotateCircle.js"],"sourcesContent":["import {\n Event,\n createPropertyDescriptor,\n defined,\n Property,\n Color,\n Material\n} from \"cesium\";\nimport { createBottomRotateCircleTexture } from \"./Texture.js\";\n\nexport default function ConeGlowBottomRotateCircleMaterialProperty(color) {\n this._definitionChanged = new Event();\n this._color = undefined;\n this._colorSubscription = undefined;\n this.color = color;\n}\nObject.defineProperties(ConeGlowBottomRotateCircleMaterialProperty.prototype, {\n isConstant: {\n get: function() {\n return false;\n }\n },\n definitionChanged: {\n get: function() {\n return this._definitionChanged;\n }\n },\n color: createPropertyDescriptor(\"color\")\n});\nConeGlowBottomRotateCircleMaterialProperty.prototype.getType = function() {\n return \"ConeGlowBottomRotateCircle\";\n}\nConeGlowBottomRotateCircleMaterialProperty.prototype.getValue = function(time, result) {\n if (!defined(result)) {\n result = {};\n }\n result.color = Property.getValueOrClonedDefault(this._color, time, Color.WHITE, result.color);\n result.image = Material.ConeGlowBottomRotateCircleImage;\n return result;\n}\nConeGlowBottomRotateCircleMaterialProperty.prototype.equals = function(other) {\n return this === other ||\n (other instanceof ConeGlowBottomRotateCircleMaterialProperty &&\n Property.equals(this._color, other._color))\n}\nMaterial.ConeGlowBottomRotateCircleType = \"ConeGlowBottomRotateCircle\";\nMaterial.ConeGlowBottomRotateCircleImage = createBottomRotateCircleTexture();\nMaterial.ConeGlowBottomRotateCircleSource =\n \"czm_material czm_getMaterial(czm_materialInput materialInput)\\n\\\n{\\n\\\n czm_material material = czm_getDefaultMaterial(materialInput);\\n\\\n vec2 st = materialInput.st;\\n\\\n vec4 colorImage = texture2D(image, vec2(st ));\\n\\\n material.diffuse = 2.5 * color.rgb ;\\n\\\n material.alpha = colorImage.a ;\\n\\\n return material;\\n\\\n }\";\nMaterial._materialCache.addMaterial(Material.ConeGlowBottomRotateCircleType, {\n fabric: {\n type: Material.ConeGlowBottomRotateCircleType,\n uniforms: {\n color: new Color(1.0, 0.0, 0.0, 0.5),\n image: Material.ConeGlowBottomRotateCircleImage,\n time: 0\n },\n source: Material.ConeGlowBottomRotateCircleSource\n },\n translucent: function() {\n return true;\n }\n});\n\n\n\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OAAA;AAEe,SAASE,0CAA0CA,CAACC,KAAK,EAAE;EACtE,IAAI,CAACC,kBAAkB,GAAG,IAAIC,aAAK,CAAC,CAAC;EACrC,IAAI,CAACC,MAAM,GAAGC,SAAS;EACvB,IAAI,CAACC,kBAAkB,GAAGD,SAAS;EACnC,IAAI,CAACJ,KAAK,GAAGA,KAAK;AACtB;AACAM,MAAM,CAACC,gBAAgB,CAACR,0CAA0C,CAACS,SAAS,EAAE;EAC1EC,UAAU,EAAE;IACRC,GAAG,EAAE,SAAAA,IAAA,EAAW;MACZ,OAAO,KAAK;IAChB;EACJ,CAAC;EACDC,iBAAiB,EAAE;IACfD,GAAG,EAAE,SAAAA,IAAA,EAAW;MACZ,OAAO,IAAI,CAACT,kBAAkB;IAClC;EACJ,CAAC;EACDD,KAAK,EAAE,IAAAY,gCAAwB,EAAC,OAAO;AAC3C,CAAC,CAAC;AACFb,0CAA0C,CAACS,SAAS,CAACK,OAAO,GAAG,YAAW;EACtE,OAAO,4BAA4B;AACvC,CAAC;AACDd,0CAA0C,C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AAI;EACf;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _cesium = require("cesium");
|
|
8
|
+
var _BottomCircle = _interopRequireDefault(require("./BottomCircle.js"));
|
|
9
|
+
var _ButtomRotateCircle = _interopRequireDefault(require("./ButtomRotateCircle.js"));
|
|
10
|
+
var _transformRgb = _interopRequireDefault(require("../_util/transformRgb"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
14
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
17
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
18
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
20
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
21
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
+
var ConeGlowLayer = exports["default"] = /*#__PURE__*/function () {
|
|
25
|
+
function ConeGlowLayer(options) {
|
|
26
|
+
var _options$data;
|
|
27
|
+
_classCallCheck(this, ConeGlowLayer);
|
|
28
|
+
var _options$show = options.show,
|
|
29
|
+
show = _options$show === void 0 ? true : _options$show;
|
|
30
|
+
this.viewer = options.map;
|
|
31
|
+
this.map = options.map;
|
|
32
|
+
this.options = options; // color 颜色 height 光柱高度 bottomRadius 底部圆的半径
|
|
33
|
+
this.height = options.height || 300;
|
|
34
|
+
this.topRadius = options.topRadius || 0;
|
|
35
|
+
this.bottomRadius = options.bottomRadius || 30;
|
|
36
|
+
this.color = options.color || '#FFFFFF'; //给个亮亮的颜色
|
|
37
|
+
|
|
38
|
+
this.primitives = [];
|
|
39
|
+
this.layer = null;
|
|
40
|
+
this.show = show;
|
|
41
|
+
if ((_options$data = options.data) !== null && _options$data !== void 0 && _options$data.length) {
|
|
42
|
+
this.loadData(options.data);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return _createClass(ConeGlowLayer, [{
|
|
46
|
+
key: "show",
|
|
47
|
+
set: function set(value) {
|
|
48
|
+
var _this$primitives;
|
|
49
|
+
if ((_this$primitives = this.primitives) !== null && _this$primitives !== void 0 && _this$primitives.length) {
|
|
50
|
+
this.primitives.map(function (primitive) {
|
|
51
|
+
primitive.show = value;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (this.layer) {
|
|
55
|
+
this.layer.show = value;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "loadData",
|
|
60
|
+
value: function loadData(data) {
|
|
61
|
+
var _this = this;
|
|
62
|
+
this.data = data;
|
|
63
|
+
var map = this.map;
|
|
64
|
+
var show = this.show;
|
|
65
|
+
var height = this.height;
|
|
66
|
+
var topRadius = this.topRadius;
|
|
67
|
+
var bottomRadius = this.bottomRadius;
|
|
68
|
+
this.destroy();
|
|
69
|
+
this.primitives = [];
|
|
70
|
+
var layer = new _cesium.CustomDataSource({
|
|
71
|
+
show: show
|
|
72
|
+
});
|
|
73
|
+
layer.cancelPopup = true;
|
|
74
|
+
map.dataSources.add(layer);
|
|
75
|
+
this.layer = layer;
|
|
76
|
+
var colors = {};
|
|
77
|
+
data.map(function (item) {
|
|
78
|
+
var position = _cesium.Cartesian3.fromDegrees.apply(_cesium.Cartesian3, _toConsumableArray(item.data));
|
|
79
|
+
var color_str = item.color || _this.color || '#0080ff';
|
|
80
|
+
var rgba = _cesium.Color.fromCssColorString((0, _transformRgb["default"])(color_str, 1));
|
|
81
|
+
|
|
82
|
+
// 添加底部圆
|
|
83
|
+
layer.entities.add({
|
|
84
|
+
position: position,
|
|
85
|
+
ellipse: {
|
|
86
|
+
semiMinorAxis: (item.bottomRadius || bottomRadius) * 2,
|
|
87
|
+
semiMajorAxis: (item.bottomRadius || bottomRadius) * 2,
|
|
88
|
+
height: item.data[2] || 0.0,
|
|
89
|
+
material: new _BottomCircle["default"](rgba)
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// 添加底部旋转圆
|
|
94
|
+
var stRotation = 360;
|
|
95
|
+
layer.entities.add({
|
|
96
|
+
position: position,
|
|
97
|
+
ellipse: {
|
|
98
|
+
semiMinorAxis: (item.bottomRadius || bottomRadius) * 1.45,
|
|
99
|
+
semiMajorAxis: (item.bottomRadius || bottomRadius) * 1.45,
|
|
100
|
+
height: item.data[2] || 0.0,
|
|
101
|
+
material: new _ButtomRotateCircle["default"](rgba),
|
|
102
|
+
stRotation: new _cesium.CallbackProperty(function () {
|
|
103
|
+
stRotation--;
|
|
104
|
+
stRotation < 0 && (stRotation = 360);
|
|
105
|
+
return _cesium.Math.toRadians(stRotation);
|
|
106
|
+
}, false)
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// 缓存颜色
|
|
111
|
+
colors[color_str] = colors[color_str] || {
|
|
112
|
+
item: item,
|
|
113
|
+
_instances: [],
|
|
114
|
+
color: color_str
|
|
115
|
+
};
|
|
116
|
+
var modelMatrix = _cesium.Matrix4.multiplyByTranslation(_cesium.Transforms.eastNorthUpToFixedFrame(position), new _cesium.Cartesian3(0.0, 0.0, (item.height || height) * 0.5), new _cesium.Matrix4());
|
|
117
|
+
var cylinderGeometry = new _cesium.CylinderGeometry({
|
|
118
|
+
length: item.height || height,
|
|
119
|
+
topRadius: item.topRadius || topRadius || 0.0,
|
|
120
|
+
bottomRadius: (item.bottomRadius || bottomRadius) * 0.7,
|
|
121
|
+
vertexFormat: _cesium.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// 缓存颜色对应的数据
|
|
125
|
+
colors[color_str]._instances.push(new _cesium.GeometryInstance({
|
|
126
|
+
geometry: cylinderGeometry,
|
|
127
|
+
modelMatrix: modelMatrix
|
|
128
|
+
}));
|
|
129
|
+
});
|
|
130
|
+
for (var color_str in colors) {
|
|
131
|
+
var _colors$color_str = colors[color_str],
|
|
132
|
+
color = _colors$color_str.color,
|
|
133
|
+
_instances = _colors$color_str._instances;
|
|
134
|
+
var cylinder = new _cesium.Primitive({
|
|
135
|
+
geometryInstances: _instances,
|
|
136
|
+
show: show,
|
|
137
|
+
appearance: new _cesium.MaterialAppearance({
|
|
138
|
+
material: new _cesium.Material({
|
|
139
|
+
fabric: {
|
|
140
|
+
type: "VtxfShader1",
|
|
141
|
+
uniforms: {
|
|
142
|
+
color: _cesium.Color.fromCssColorString((0, _transformRgb["default"])(color, 1)),
|
|
143
|
+
alpha: 2
|
|
144
|
+
},
|
|
145
|
+
source: "\n uniform vec4 color;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n material.diffuse =2.9 * color.rgb;\n material.alpha = color.a * dis * alpha ;\n return material;\n }\n "
|
|
146
|
+
},
|
|
147
|
+
translucent: false
|
|
148
|
+
}),
|
|
149
|
+
faceForward: false,
|
|
150
|
+
// 当绘制的三角面片法向不能朝向视点时,自动翻转法向,从而避免法向计算后发黑等问题
|
|
151
|
+
closed: true // 是否为封闭体,实际上执行的是是否进行背面裁剪
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
map.scene.primitives.add(cylinder);
|
|
155
|
+
this.primitives.push(cylinder);
|
|
156
|
+
}
|
|
157
|
+
this.viewer.scene.preUpdate.addEventListener(this.preUpdateHandle, this);
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
key: "preUpdateHandle",
|
|
161
|
+
value: function preUpdateHandle() {
|
|
162
|
+
var _this$primitives2,
|
|
163
|
+
_this2 = this;
|
|
164
|
+
if ((_this$primitives2 = this.primitives) !== null && _this$primitives2 !== void 0 && _this$primitives2.length) {
|
|
165
|
+
this.primitives.forEach(function (primitive) {
|
|
166
|
+
//圆锥闪烁动画
|
|
167
|
+
var alpha = primitive.appearance.material.uniforms.alpha;
|
|
168
|
+
if (alpha >= 2) {
|
|
169
|
+
_this2.symbol = '-';
|
|
170
|
+
} else if (alpha <= 0.5) {
|
|
171
|
+
_this2.symbol = '+';
|
|
172
|
+
}
|
|
173
|
+
if (_this2.symbol === "-") {
|
|
174
|
+
primitive.appearance.material.uniforms.alpha -= 0.1;
|
|
175
|
+
} else {
|
|
176
|
+
primitive.appearance.material.uniforms.alpha += 0.1;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// 销毁
|
|
183
|
+
}, {
|
|
184
|
+
key: "destroy",
|
|
185
|
+
value: function destroy() {
|
|
186
|
+
var _this$primitives3;
|
|
187
|
+
var map = this.map;
|
|
188
|
+
if ((_this$primitives3 = this.primitives) !== null && _this$primitives3 !== void 0 && _this$primitives3.length) {
|
|
189
|
+
this.primitives.map(function (primitive) {
|
|
190
|
+
map.scene.primitives.remove(primitive);
|
|
191
|
+
});
|
|
192
|
+
this.primitives = null;
|
|
193
|
+
}
|
|
194
|
+
if (this.layer) {
|
|
195
|
+
map.dataSources.remove(this.layer);
|
|
196
|
+
this.layer = null;
|
|
197
|
+
}
|
|
198
|
+
map.scene.preUpdate.removeEventListener(this.preUpdateHandle, this);
|
|
199
|
+
}
|
|
200
|
+
}]);
|
|
201
|
+
}();
|
|
202
|
+
//# sourceMappingURL=ConeGlowLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConeGlowLayer.js","names":["_cesium","require","_BottomCircle","_interopRequireDefault","_ButtomRotateCircle","_transformRgb","e","__esModule","_typeof","o","Symbol","iterator","constructor","prototype","_toConsumableArray","r","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","TypeError","a","_arrayLikeToArray","t","toString","call","slice","name","Array","from","test","isArray","length","n","_classCallCheck","_defineProperties","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_createClass","i","_toPrimitive","toPrimitive","String","Number","ConeGlowLayer","exports","options","_options$data","_options$show","show","viewer","map","height","topRadius","bottomRadius","color","primitives","layer","data","loadData","set","value","_this$primitives","primitive","_this","destroy","CustomDataSource","cancelPopup","dataSources","add","colors","item","position","Cartesian3","fromDegrees","apply","color_str","rgba","Color","fromCssColorString","transformRgb","entities","ellipse","semiMinorAxis","semiMajorAxis","material","ConeGlowBottomCircleMaterialProperty","stRotation","ConeGlowBottomRotateCircleMaterialProperty","CallbackProperty","CesiumMath","toRadians","_instances","modelMatrix","Matrix4","multiplyByTranslation","Transforms","eastNorthUpToFixedFrame","cylinderGeometry","CylinderGeometry","vertexFormat","MaterialAppearance","MaterialSupport","TEXTURED","push","GeometryInstance","geometry","_colors$color_str","cylinder","Primitive","geometryInstances","appearance","Material","fabric","type","uniforms","alpha","source","translucent","faceForward","closed","scene","preUpdate","addEventListener","preUpdateHandle","_this$primitives2","_this2","forEach","symbol","_this$primitives3","remove","removeEventListener"],"sources":["cone-glow-layer/ConeGlowLayer.js"],"sourcesContent":["import {\n Color,\n Matrix4,\n Transforms,\n Cartesian3,\n CylinderGeometry,\n MaterialAppearance,\n GeometryInstance,\n Primitive,\n Material,\n CallbackProperty,\n Math as CesiumMath,\n CustomDataSource\n} from 'cesium';\nimport ConeGlowBottomCircleMaterialProperty from \"./BottomCircle.js\";\nimport ConeGlowBottomRotateCircleMaterialProperty from \"./ButtomRotateCircle.js\";\nimport transformRgb from \"../_util/transformRgb\";\n\nexport default class ConeGlowLayer {\n constructor(options) {\n const {show = true} = options;\n this.viewer = options.map;\n this.map = options.map;\n\n this.options = options; // color 颜色 height 光柱高度 bottomRadius 底部圆的半径\n this.height = options.height || 300;\n this.topRadius = options.topRadius || 0;\n this.bottomRadius = options.bottomRadius || 30;\n this.color = options.color || '#FFFFFF'; //给个亮亮的颜色\n\n this.primitives = [];\n this.layer = null;\n\n this.show = show;\n\n if (options.data?.length) {\n this.loadData(options.data);\n }\n }\n\n set show(value) {\n if (this.primitives?.length) {\n this.primitives.map(primitive => {\n primitive.show = value;\n })\n }\n\n if (this.layer) {\n this.layer.show = value;\n }\n }\n\n loadData(data) {\n this.data = data;\n const map = this.map;\n const show = this.show;\n const height = this.height;\n const topRadius = this.topRadius;\n const bottomRadius = this.bottomRadius;\n\n this.destroy();\n\n this.primitives = [];\n\n const layer = new CustomDataSource({show});\n layer.cancelPopup = true;\n map.dataSources.add(layer);\n this.layer = layer;\n\n const colors = {};\n\n data.map((item) => {\n const position = Cartesian3.fromDegrees(...item.data);\n\n let color_str = item.color || this.color || '#0080ff';\n let rgba = Color.fromCssColorString(transformRgb(color_str, 1));\n\n // 添加底部圆\n layer.entities.add({\n position,\n ellipse: {\n semiMinorAxis: (item.bottomRadius || bottomRadius) * 2,\n semiMajorAxis: (item.bottomRadius || bottomRadius) * 2,\n height: item.data[2] || 0.0,\n material: new ConeGlowBottomCircleMaterialProperty(rgba),\n }\n })\n\n // 添加底部旋转圆\n let stRotation = 360;\n layer.entities.add({\n position,\n ellipse: {\n semiMinorAxis: (item.bottomRadius || bottomRadius) * 1.45,\n semiMajorAxis: (item.bottomRadius || bottomRadius) * 1.45,\n height: item.data[2] || 0.0,\n material: new ConeGlowBottomRotateCircleMaterialProperty(rgba),\n stRotation: new CallbackProperty(() => {\n stRotation--;\n stRotation < 0 && (stRotation = 360);\n return CesiumMath.toRadians(stRotation);\n }, false),\n }\n });\n\n // 缓存颜色\n colors[color_str] = colors[color_str] || {\n item,\n _instances: [],\n color: color_str\n };\n\n const modelMatrix = Matrix4.multiplyByTranslation(\n Transforms.eastNorthUpToFixedFrame(position),\n new Cartesian3(0.0, 0.0, (item.height || height) * 0.5), new Matrix4()\n );\n\n const cylinderGeometry = new CylinderGeometry({\n length: item.height || height,\n topRadius: (item.topRadius || topRadius || 0.0),\n bottomRadius: (item.bottomRadius || bottomRadius) * 0.7,\n vertexFormat: MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat\n });\n\n // 缓存颜色对应的数据\n colors[color_str]._instances.push(new GeometryInstance({\n geometry: cylinderGeometry,\n modelMatrix: modelMatrix,\n }))\n });\n\n for (let color_str in colors) {\n const {color, _instances} = colors[color_str];\n\n const cylinder = new Primitive({\n geometryInstances: _instances,\n show,\n appearance: new MaterialAppearance({\n material: new Material({\n fabric: {\n type: \"VtxfShader1\",\n uniforms: {\n color: Color.fromCssColorString(transformRgb(color, 1)),\n alpha: 2\n },\n source: `\n uniform vec4 color;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n material.diffuse =2.9 * color.rgb;\n material.alpha = color.a * dis * alpha ;\n return material;\n }\n `\n },\n translucent: false\n }),\n faceForward: false, // 当绘制的三角面片法向不能朝向视点时,自动翻转法向,从而避免法向计算后发黑等问题\n closed: true // 是否为封闭体,实际上执行的是是否进行背面裁剪\n }),\n })\n map.scene.primitives.add(cylinder);\n this.primitives.push(cylinder);\n }\n\n this.viewer.scene.preUpdate.addEventListener(this.preUpdateHandle, this);\n }\n\n preUpdateHandle() {\n if (this.primitives?.length) {\n this.primitives.forEach((primitive) => {\n //圆锥闪烁动画\n let alpha = primitive.appearance.material.uniforms.alpha;\n if (alpha >= 2) {\n this.symbol = '-'\n } else if (alpha <= 0.5) {\n this.symbol = '+'\n }\n\n if (this.symbol === \"-\") {\n primitive.appearance.material.uniforms.alpha -= 0.1;\n } else {\n primitive.appearance.material.uniforms.alpha += 0.1;\n }\n })\n }\n }\n\n // 销毁\n destroy() {\n const map = this.map;\n\n if (this.primitives?.length) {\n this.primitives.map(primitive => {\n map.scene.primitives.remove(primitive);\n })\n this.primitives = null;\n }\n\n if (this.layer) {\n map.dataSources.remove(this.layer);\n this.layer = null;\n }\n\n map.scene.preUpdate.removeEventListener(this.preUpdateHandle, this);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAcA,IA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I,CAACE,MAAM,KAAK,GAAG,EAAE;YACrBjE,SAAS,CAACgD,UAAU,CAAC1B,QAAQ,CAAC8B,QAAQ,CAACC,KAAK,IAAI,GAAG;UACvD,CAAC,MAAM;YACHrD,SAAS,CAACgD,UAAU,CAAC1B,QAAQ,CAAC8B,QAAQ,CAACC,KAAK,IAAI,GAAG;UACvD;QACJ,CAAC,CAAC;MACN;IACJ;;IAEA;EAAA;IAAA/E,GAAA;IAAAwB,KAAA,EACA,SAAAI,QAAA,EAAU;MAAA,IAAAgE,iBAAA;MACN,IAAM9E,GAAG,GAAG,IAAI,CAACA,GAAG;MAEpB,KAAA8E,iBAAA,GAAI,IAAI,CAACzE,UAAU,cAAAyE,iBAAA,eAAfA,iBAAA,CAAiBtG,MAAM,EAAE;QACzB,IAAI,CAAC6B,UAAU,CAACL,GAAG,CAAC,UAAAY,SAAS,EAAI;UAC7BZ,GAAG,CAACsE,KAAK,CAACjE,UAAU,CAAC0E,MAAM,CAACnE,SAAS,CAAC;QAC1C,CAAC,CAAC;QACF,IAAI,CAACP,UAAU,GAAG,IAAI;MAC1B;MAEA,IAAI,IAAI,CAACC,KAAK,EAAE;QACZN,GAAG,CAACiB,WAAW,CAAC8D,MAAM,CAAC,IAAI,CAACzE,KAAK,CAAC;QAClC,IAAI,CAACA,KAAK,GAAG,IAAI;MACrB;MAEAN,GAAG,CAACsE,KAAK,CAACC,SAAS,CAACS,mBAAmB,CAAC,IAAI,CAACP,eAAe,EAAE,IAAI,CAAC;IACvE;EAAC;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createBottomCircleTexture = createBottomCircleTexture;
|
|
7
|
+
exports.createBottomRotateCircleTexture = createBottomRotateCircleTexture;
|
|
8
|
+
//底部圆材质图片
|
|
9
|
+
function createBottomCircleTexture() {
|
|
10
|
+
var canvas = document.createElement("canvas");
|
|
11
|
+
canvas.width = 512;
|
|
12
|
+
canvas.height = 512;
|
|
13
|
+
var ctx = canvas.getContext("2d");
|
|
14
|
+
var gradient = ctx.createRadialGradient(256, 256, 0, 256, 256, 256);
|
|
15
|
+
gradient.addColorStop(0.1, "rgba(255, 255, 255, 1.0)");
|
|
16
|
+
gradient.addColorStop(0.2, "rgba(255, 255, 255, 0.0)");
|
|
17
|
+
gradient.addColorStop(0.3, "rgba(255, 255, 255, 0.9)");
|
|
18
|
+
gradient.addColorStop(0.5, "rgba(255, 255, 255, 0.0)");
|
|
19
|
+
gradient.addColorStop(0.9, "rgba(255, 255, 255, 0.2)");
|
|
20
|
+
gradient.addColorStop(1.0, "rgba(255, 255, 255, 1.0)");
|
|
21
|
+
ctx.clearRect(0, 0, 512, 512);
|
|
22
|
+
ctx.beginPath();
|
|
23
|
+
ctx.arc(256, 256, 256, 0, Math.PI * 2, true);
|
|
24
|
+
//ctx.fillStyle = "rgb(0, 155, 255)";
|
|
25
|
+
ctx.fillStyle = gradient;
|
|
26
|
+
ctx.fill();
|
|
27
|
+
ctx.restore();
|
|
28
|
+
return canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//底部运动圆材质图片
|
|
32
|
+
function createBottomRotateCircleTexture() {
|
|
33
|
+
var canvas = document.createElement("canvas");
|
|
34
|
+
canvas.width = 512;
|
|
35
|
+
canvas.height = 512;
|
|
36
|
+
var ctx = canvas.getContext("2d");
|
|
37
|
+
ctx.clearRect(0, 0, 512, 512);
|
|
38
|
+
ctx.strokeStyle = "rgb(255, 255, 0)";
|
|
39
|
+
ctx.setLineDash([80, 80]);
|
|
40
|
+
ctx.lineWidth = 30;
|
|
41
|
+
ctx.arc(256, 256, 241, 0, Math.PI * 2, true);
|
|
42
|
+
ctx.stroke();
|
|
43
|
+
return canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=Texture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Texture.js","names":["createBottomCircleTexture","canvas","document","createElement","width","height","ctx","getContext","gradient","createRadialGradient","addColorStop","clearRect","beginPath","arc","Math","PI","fillStyle","fill","restore","toDataURL","replace","createBottomRotateCircleTexture","strokeStyle","setLineDash","lineWidth","stroke"],"sources":["cone-glow-layer/Texture.js"],"sourcesContent":["//底部圆材质图片\nexport function createBottomCircleTexture() {\n let canvas = document.createElement(\"canvas\");\n canvas.width = 512;\n canvas.height = 512;\n let ctx = canvas.getContext(\"2d\");\n\n let gradient = ctx.createRadialGradient(256, 256, 0, 256, 256, 256);\n gradient.addColorStop(0.1, \"rgba(255, 255, 255, 1.0)\");\n gradient.addColorStop(0.2, \"rgba(255, 255, 255, 0.0)\");\n gradient.addColorStop(0.3, \"rgba(255, 255, 255, 0.9)\");\n gradient.addColorStop(0.5, \"rgba(255, 255, 255, 0.0)\");\n gradient.addColorStop(0.9, \"rgba(255, 255, 255, 0.2)\");\n gradient.addColorStop(1.0, \"rgba(255, 255, 255, 1.0)\");\n\n ctx.clearRect(0, 0, 512, 512);\n ctx.beginPath();\n ctx.arc(256, 256, 256, 0, Math.PI * 2, true);\n //ctx.fillStyle = \"rgb(0, 155, 255)\";\n ctx.fillStyle = gradient;\n ctx.fill();\n ctx.restore();\n return canvas.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\n}\n\n//底部运动圆材质图片\nexport function createBottomRotateCircleTexture() {\n let canvas = document.createElement(\"canvas\");\n canvas.width = 512;\n canvas.height = 512;\n let ctx = canvas.getContext(\"2d\");\n ctx.clearRect(0, 0, 512, 512);\n ctx.strokeStyle = \"rgb(255, 255, 0)\";\n ctx.setLineDash([80, 80]);\n ctx.lineWidth = 30;\n ctx.arc(256, 256, 241, 0, Math.PI * 2, true);\n ctx.stroke();\n return canvas.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\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+BAA+BA,CAAA,EAAG;EAC9C,IAAIpB,MAAM,GAAGC,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC;EAC7CF,MAAM,CAACG,KAAK,GAAG,GAAG;EAClBH,MAAM,CAACI,MAAM,GAAG,GAAG;EACnB,IAAIC,GAAG,GAAGL,MAAM,CAACM,UAAU,CAAC,IAAI,CAAC;EACjCD,GAAG,CAACK,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;EAC7BL,GAAG,CAACgB,WAAW,GAAG,kBAAkB;EACpChB,GAAG,CAACiB,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;EACzBjB,GAAG,CAACkB,SAAS,GAAG,EAAE;EAClBlB,GAAG,CAACO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAEC,IAAI,CAACC,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC;EAC5CT,GAAG,CAACmB,MAAM,CAAC,CAAC;EACZ,OAAOxB,MAAM,CAACkB,SAAS,CAAC,WAAW,CAAC,CAACC,OAAO,CAAC,WAAW,EAAE,oBAAoB,CAAC;AACnF","ignoreList":[]}
|
package/lib/dom/index.js
CHANGED
|
@@ -6,10 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = _default;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
10
|
var _ahooks = require("ahooks");
|
|
10
11
|
var _useProps2 = _interopRequireDefault(require("../use-props"));
|
|
11
12
|
var _Dom = _interopRequireDefault(require("./Dom"));
|
|
12
|
-
var _excluded = ["data", "
|
|
13
|
+
var _excluded = ["data", "cssText", "show", "children"];
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -22,16 +23,17 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
|
|
|
22
23
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
23
24
|
function _default(props) {
|
|
24
25
|
var data = props.data,
|
|
25
|
-
|
|
26
|
+
cssText = props.cssText,
|
|
26
27
|
_props$show = props.show,
|
|
27
28
|
show = _props$show === void 0 ? true : _props$show,
|
|
28
29
|
children = props.children,
|
|
29
30
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
30
31
|
var _useProps = (0, _useProps2["default"])(),
|
|
31
32
|
map = _useProps.map;
|
|
32
|
-
var domRef = (0, _react.useRef)();
|
|
33
|
+
var domRef = (0, _react.useRef)(document.createElement('div'));
|
|
33
34
|
var overlay = (0, _react.useRef)();
|
|
34
35
|
(0, _react.useEffect)(function () {
|
|
36
|
+
domRef.current.style.cssText = "\n display: ".concat(show ? 'block' : 'none', ";\n position: absolute;\n user-select: none;\n pointer-events: none;\n ").concat(cssText, "\n ");
|
|
35
37
|
overlay.current = new _Dom["default"](_objectSpread({
|
|
36
38
|
map: map,
|
|
37
39
|
position: data,
|
|
@@ -39,19 +41,60 @@ function _default(props) {
|
|
|
39
41
|
positioning: "bottom-center",
|
|
40
42
|
offset: [0, -10]
|
|
41
43
|
}, otherProps));
|
|
44
|
+
map._element.appendChild(domRef.current);
|
|
42
45
|
return function () {
|
|
43
46
|
overlay.current.destroy();
|
|
47
|
+
map._element.removeChild(domRef.current);
|
|
44
48
|
};
|
|
45
49
|
}, []);
|
|
46
50
|
(0, _ahooks.useUpdateEffect)(function () {
|
|
47
51
|
overlay.current.setPosition(data);
|
|
48
52
|
}, [JSON.stringify(data)]);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
position: 'absolute'
|
|
54
|
-
}, style)
|
|
55
|
-
}, children);
|
|
53
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
54
|
+
domRef.current.style.display = show ? 'block' : 'none';
|
|
55
|
+
}, [show]);
|
|
56
|
+
return /*#__PURE__*/_reactDom["default"].createPortal(children, domRef.current);
|
|
56
57
|
}
|
|
58
|
+
|
|
59
|
+
// export default function (props) {
|
|
60
|
+
// const {data, style, show = true, children, ...otherProps} = props;
|
|
61
|
+
// const {map} = useProps();
|
|
62
|
+
//
|
|
63
|
+
// const domRef = useRef();
|
|
64
|
+
// const overlay = useRef();
|
|
65
|
+
//
|
|
66
|
+
// useEffect(() => {
|
|
67
|
+
// overlay.current = new Dom({
|
|
68
|
+
// map,
|
|
69
|
+
// position: data,
|
|
70
|
+
// element: domRef.current,
|
|
71
|
+
// positioning: "bottom-center",
|
|
72
|
+
// offset: [0, -10],
|
|
73
|
+
// ...otherProps
|
|
74
|
+
// });
|
|
75
|
+
//
|
|
76
|
+
// return () => {
|
|
77
|
+
// overlay.current.destroy();
|
|
78
|
+
// }
|
|
79
|
+
// }, []);
|
|
80
|
+
//
|
|
81
|
+
// useUpdateEffect(() => {
|
|
82
|
+
// overlay.current.setPosition(data)
|
|
83
|
+
// }, [JSON.stringify(data)])
|
|
84
|
+
//
|
|
85
|
+
// return (
|
|
86
|
+
// <div
|
|
87
|
+
// ref={domRef}
|
|
88
|
+
// style={{
|
|
89
|
+
// display: show ? 'block' : 'none',
|
|
90
|
+
// position: 'absolute',
|
|
91
|
+
// userSelect: 'none',
|
|
92
|
+
// pointerEvents: 'none',
|
|
93
|
+
// ...style
|
|
94
|
+
// }}
|
|
95
|
+
// >
|
|
96
|
+
// {children}
|
|
97
|
+
// </div>
|
|
98
|
+
// )
|
|
99
|
+
// }
|
|
57
100
|
//# sourceMappingURL=index.js.map
|
package/lib/dom/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_reactDom","_interopRequireDefault","_ahooks","_useProps2","_Dom","_excluded","e","__esModule","_getRequireWildcardCache","WeakMap","r","t","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","_objectWithoutProperties","_objectWithoutPropertiesLoose","s","includes","propertyIsEnumerable","_default","props","data","cssText","_props$show","show","children","otherProps","_useProps","useProps","map","domRef","useRef","document","createElement","overlay","useEffect","current","style","concat","Dom","position","element","positioning","offset","_element","appendChild","destroy","removeChild","useUpdateEffect","setPosition","JSON","stringify","display","ReactDOM","createPortal"],"sources":["dom/index.jsx"],"sourcesContent":["import React, {useRef, useEffect} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useUpdateEffect} from 'ahooks';\nimport useProps from '../use-props';\nimport Dom from './Dom';\n\nexport default function (props) {\n const {data, cssText, show = true, children, ...otherProps} = props;\n const {map} = useProps();\n\n const domRef = useRef(document.createElement('div'));\n const overlay = useRef();\n\n useEffect(() => {\n domRef.current.style.cssText = `\n display: ${show ? 'block' : 'none'};\n position: absolute;\n user-select: none;\n pointer-events: none;\n ${cssText}\n `;\n\n overlay.current = new Dom({\n map,\n position: data,\n element: domRef.current,\n positioning: \"bottom-center\",\n offset: [0, -10],\n ...otherProps\n });\n\n map._element.appendChild(domRef.current);\n\n return () => {\n overlay.current.destroy();\n\n map._element.removeChild(domRef.current);\n }\n }, []);\n\n useUpdateEffect(() => {\n overlay.current.setPosition(data)\n }, [JSON.stringify(data)])\n\n useUpdateEffect(() => {\n domRef.current.style.display = show ? 'block' : 'none';\n }, [show])\n\n return ReactDOM.createPortal(\n children,\n domRef.current\n );\n}\n\n// export default function (props) {\n// const {data, style, show = true, children, ...otherProps} = props;\n// const {map} = useProps();\n//\n// const domRef = useRef();\n// const overlay = useRef();\n//\n// useEffect(() => {\n// overlay.current = new Dom({\n// map,\n// position: data,\n// element: domRef.current,\n// positioning: \"bottom-center\",\n// offset: [0, -10],\n// ...otherProps\n// });\n//\n// return () => {\n// overlay.current.destroy();\n// }\n// }, []);\n//\n// useUpdateEffect(() => {\n// overlay.current.setPosition(data)\n// }, [JSON.stringify(data)])\n//\n// return (\n// <div\n// ref={domRef}\n// style={{\n// display: show ? 'block' : 'none',\n// position: 'absolute',\n// userSelect: 'none',\n// pointerEvents: 'none',\n// ...style\n// }}\n// >\n// {children}\n// </div>\n// )\n// }\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,IAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAwB,IAAAM,SAAA;AAAA,SAAAJ,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,yBAAAF,CAAA,6BAAAG,OAAA,mBAAAC,CAAA,OAAAD,O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,CAAC9B,IAAI,CAAC,CAAC,CAAC;EAE1B,IAAA2B,uBAAe,EAAC,YAAM;IAClBlB,MAAM,CAACM,OAAO,CAACC,KAAK,CAACe,OAAO,GAAG5B,IAAI,GAAG,OAAO,GAAG,MAAM;EAC1D,CAAC,EAAE,CAACA,IAAI,CAAC,CAAC;EAEV,oBAAO6B,oBAAQ,CAACC,YAAY,CACxB7B,QAAQ,EACRK,MAAM,CAACM,OACX,CAAC;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -108,7 +108,7 @@ var ImageLayer = /*#__PURE__*/function (_ImageryLayer) {
|
|
|
108
108
|
version: '1.1.1',
|
|
109
109
|
transparent: true
|
|
110
110
|
}, _params),
|
|
111
|
-
layers: _params.typeName || _params.QUERY_LAYERS,
|
|
111
|
+
layers: _params.typeName || _params.QUERY_LAYERS || _params.layers,
|
|
112
112
|
tileWidth: 1024,
|
|
113
113
|
tileHeight: 1024,
|
|
114
114
|
maximumLevel: 18
|