@antv/l7-layers 2.15.2 → 2.15.3
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/es/Geometry/index.js +9 -31
- package/es/Geometry/models/billboard.js +51 -89
- package/es/Geometry/models/plane.js +81 -143
- package/es/Geometry/models/sprite.js +60 -118
- package/es/canvas/index.js +10 -33
- package/es/canvas/models/canvas.js +41 -97
- package/es/citybuliding/building.js +8 -27
- package/es/citybuliding/models/build.js +57 -82
- package/es/core/BaseLayer.js +320 -484
- package/es/core/BaseModel.js +97 -126
- package/es/core/LayerPickService.js +21 -32
- package/es/core/TextureService.js +0 -13
- package/es/core/interface.js +17 -24
- package/es/core/shape/Path.js +13 -20
- package/es/core/shape/extrude.js +10 -31
- package/es/core/triangulation.js +54 -114
- package/es/earth/index.js +9 -33
- package/es/earth/models/atmosphere.js +30 -54
- package/es/earth/models/base.js +47 -85
- package/es/earth/models/bloomsphere.js +30 -54
- package/es/earth/utils.js +9 -13
- package/es/heatmap/index.js +10 -40
- package/es/heatmap/models/grid.js +28 -52
- package/es/heatmap/models/grid3d.js +28 -52
- package/es/heatmap/models/heatmap.js +91 -146
- package/es/heatmap/models/hexagon.js +28 -52
- package/es/heatmap/triangulation.js +0 -4
- package/es/image/index.js +9 -28
- package/es/image/models/image.js +66 -100
- package/es/index.js +9 -17
- package/es/line/index.js +9 -34
- package/es/line/models/arc.js +66 -118
- package/es/line/models/arc_3d.js +60 -108
- package/es/line/models/earthArc_3d.js +63 -111
- package/es/line/models/great_circle.js +56 -100
- package/es/line/models/half.js +46 -77
- package/es/line/models/line.js +94 -148
- package/es/line/models/linearline.js +45 -80
- package/es/line/models/simpleLine.js +41 -74
- package/es/line/models/wall.js +52 -92
- package/es/mask/index.js +9 -28
- package/es/mask/models/fill.js +29 -54
- package/es/plugins/DataMappingPlugin.js +80 -117
- package/es/plugins/DataSourcePlugin.js +45 -68
- package/es/plugins/FeatureScalePlugin.js +67 -122
- package/es/plugins/LayerAnimateStylePlugin.js +0 -5
- package/es/plugins/LayerMaskPlugin.js +3 -11
- package/es/plugins/LayerModelPlugin.js +67 -104
- package/es/plugins/LayerStylePlugin.js +3 -9
- package/es/plugins/LightingPlugin.js +12 -18
- package/es/plugins/MultiPassRendererPlugin.js +11 -16
- package/es/plugins/PixelPickingPlugin.js +12 -21
- package/es/plugins/RegisterStyleAttributePlugin.js +5 -12
- package/es/plugins/ShaderUniformPlugin.js +13 -27
- package/es/plugins/UpdateModelPlugin.js +0 -5
- package/es/plugins/UpdateStyleAttributePlugin.js +5 -11
- package/es/point/index.js +26 -77
- package/es/point/models/earthExtrude.js +61 -102
- package/es/point/models/earthFill.js +57 -87
- package/es/point/models/extrude.js +60 -101
- package/es/point/models/fill.js +70 -100
- package/es/point/models/fillmage.js +63 -107
- package/es/point/models/image.js +48 -88
- package/es/point/models/index.js +2 -2
- package/es/point/models/normal.js +30 -54
- package/es/point/models/radar.js +40 -64
- package/es/point/models/simplePoint.js +41 -69
- package/es/point/models/text.js +197 -299
- package/es/point/shape/extrude.js +4 -13
- package/es/polygon/index.js +11 -40
- package/es/polygon/models/extrude.js +48 -92
- package/es/polygon/models/fill.js +54 -88
- package/es/polygon/models/index.js +3 -2
- package/es/polygon/models/ocean.js +42 -76
- package/es/polygon/models/water.js +37 -71
- package/es/raster/buffers/triangulation.js +2 -4
- package/es/raster/index.js +9 -32
- package/es/raster/models/raster.js +80 -116
- package/es/raster/models/rasterRgb.js +84 -127
- package/es/raster/models/rasterTerrainRgb.js +56 -84
- package/es/tile/interaction/getRasterData.js +14 -20
- package/es/tile/interaction/utils.js +7 -9
- package/es/tile/manager/base.js +63 -96
- package/es/tile/service/TileLayerService.js +30 -52
- package/es/tile/service/TilePickService.js +26 -40
- package/es/tile/service/TileSourceService.js +3 -7
- package/es/tile/tileFactory/DebugTile.js +28 -45
- package/es/tile/tileFactory/ImageTile.js +20 -38
- package/es/tile/tileFactory/MaskTile.js +22 -43
- package/es/tile/tileFactory/RasterRGBTile.js +22 -42
- package/es/tile/tileFactory/RasterTerrainRGBTile.js +20 -38
- package/es/tile/tileFactory/RasterTile.js +30 -53
- package/es/tile/tileFactory/Tile.js +63 -97
- package/es/tile/tileFactory/VectorTile.js +41 -68
- package/es/tile/tileFactory/index.js +0 -11
- package/es/tile/tileFactory/layers/TileDebugLayer.js +6 -27
- package/es/tile/tileFactory/util.js +0 -3
- package/es/tile/tileLayer/BaseLayer.js +105 -146
- package/es/tile/utils.js +1 -1
- package/es/utils/blend.js +0 -2
- package/es/utils/collision-index.js +9 -16
- package/es/utils/dataMappingStyle.js +8 -18
- package/es/utils/extrude_polyline.js +101 -149
- package/es/utils/grid-index.js +2 -27
- package/es/utils/identityScale.js +0 -8
- package/es/utils/layerData.js +30 -44
- package/es/utils/multiPassRender.js +11 -13
- package/es/utils/polylineNormal.js +31 -37
- package/es/utils/simpleLine.js +2 -16
- package/es/utils/stencil.js +2 -3
- package/es/utils/symbol-layout.js +27 -53
- package/es/wind/index.js +9 -29
- package/es/wind/models/utils.js +26 -51
- package/es/wind/models/wind.js +101 -147
- package/es/wind/models/windRender.js +53 -66
- package/lib/Geometry/index.js +9 -38
- package/lib/Geometry/models/billboard.js +51 -97
- package/lib/Geometry/models/index.js +0 -5
- package/lib/Geometry/models/plane.js +79 -151
- package/lib/Geometry/models/sprite.js +60 -127
- package/lib/canvas/index.js +10 -40
- package/lib/canvas/models/canvas.js +41 -101
- package/lib/canvas/models/index.js +0 -3
- package/lib/citybuliding/building.js +8 -35
- package/lib/citybuliding/models/build.js +57 -92
- package/lib/core/BaseLayer.js +320 -478
- package/lib/core/BaseModel.js +97 -139
- package/lib/core/LayerPickService.js +21 -37
- package/lib/core/TextureService.js +0 -16
- package/lib/core/interface.js +21 -31
- package/lib/core/schema.js +0 -1
- package/lib/core/shape/Path.js +14 -31
- package/lib/core/shape/extrude.js +10 -54
- package/lib/core/triangulation.js +53 -153
- package/lib/earth/index.js +9 -43
- package/lib/earth/models/atmosphere.js +30 -63
- package/lib/earth/models/base.js +47 -90
- package/lib/earth/models/bloomsphere.js +30 -63
- package/lib/earth/utils.js +7 -31
- package/lib/heatmap/index.js +10 -48
- package/lib/heatmap/models/grid.js +28 -60
- package/lib/heatmap/models/grid3d.js +28 -60
- package/lib/heatmap/models/heatmap.js +91 -162
- package/lib/heatmap/models/hexagon.js +28 -60
- package/lib/heatmap/models/index.js +0 -6
- package/lib/heatmap/triangulation.js +0 -5
- package/lib/image/index.js +9 -36
- package/lib/image/models/image.js +66 -109
- package/lib/image/models/index.js +0 -3
- package/lib/index.js +7 -61
- package/lib/line/index.js +9 -40
- package/lib/line/models/arc.js +64 -128
- package/lib/line/models/arc_3d.js +58 -119
- package/lib/line/models/earthArc_3d.js +61 -122
- package/lib/line/models/great_circle.js +56 -111
- package/lib/line/models/half.js +46 -87
- package/lib/line/models/index.js +0 -11
- package/lib/line/models/line.js +92 -156
- package/lib/line/models/linearline.js +45 -92
- package/lib/line/models/simpleLine.js +41 -84
- package/lib/line/models/wall.js +52 -103
- package/lib/mask/index.js +9 -36
- package/lib/mask/models/fill.js +29 -63
- package/lib/mask/models/index.js +0 -3
- package/lib/plugins/DataMappingPlugin.js +80 -128
- package/lib/plugins/DataSourcePlugin.js +45 -76
- package/lib/plugins/FeatureScalePlugin.js +67 -138
- package/lib/plugins/LayerAnimateStylePlugin.js +0 -10
- package/lib/plugins/LayerMaskPlugin.js +4 -17
- package/lib/plugins/LayerModelPlugin.js +68 -113
- package/lib/plugins/LayerStylePlugin.js +4 -14
- package/lib/plugins/LightingPlugin.js +12 -25
- package/lib/plugins/MultiPassRendererPlugin.js +11 -22
- package/lib/plugins/PixelPickingPlugin.js +12 -27
- package/lib/plugins/RegisterStyleAttributePlugin.js +5 -19
- package/lib/plugins/ShaderUniformPlugin.js +13 -34
- package/lib/plugins/UpdateModelPlugin.js +1 -10
- package/lib/plugins/UpdateStyleAttributePlugin.js +5 -16
- package/lib/point/index.js +26 -83
- package/lib/point/models/earthExtrude.js +61 -113
- package/lib/point/models/earthFill.js +57 -117
- package/lib/point/models/extrude.js +60 -111
- package/lib/point/models/fill.js +68 -109
- package/lib/point/models/fillmage.js +61 -115
- package/lib/point/models/image.js +48 -98
- package/lib/point/models/index.js +1 -12
- package/lib/point/models/normal.js +30 -64
- package/lib/point/models/radar.js +40 -74
- package/lib/point/models/simplePoint.js +41 -79
- package/lib/point/models/text.js +197 -307
- package/lib/point/shape/extrude.js +4 -20
- package/lib/polygon/index.js +11 -48
- package/lib/polygon/models/extrude.js +48 -103
- package/lib/polygon/models/fill.js +54 -98
- package/lib/polygon/models/index.js +2 -14
- package/lib/polygon/models/ocean.js +42 -88
- package/lib/polygon/models/water.js +37 -82
- package/lib/raster/buffers/triangulation.js +3 -7
- package/lib/raster/index.js +9 -40
- package/lib/raster/models/index.js +0 -5
- package/lib/raster/models/raster.js +80 -125
- package/lib/raster/models/rasterRgb.js +84 -139
- package/lib/raster/models/rasterTerrainRgb.js +56 -93
- package/lib/tile/interaction/getRasterData.js +14 -25
- package/lib/tile/interaction/utils.js +7 -19
- package/lib/tile/manager/base.js +63 -104
- package/lib/tile/service/TileLayerService.js +30 -57
- package/lib/tile/service/TilePickService.js +26 -48
- package/lib/tile/service/TileSourceService.js +2 -16
- package/lib/tile/style/utils.js +0 -3
- package/lib/tile/tileFactory/DebugTile.js +28 -53
- package/lib/tile/tileFactory/ImageTile.js +20 -46
- package/lib/tile/tileFactory/MaskTile.js +22 -51
- package/lib/tile/tileFactory/RasterRGBTile.js +22 -50
- package/lib/tile/tileFactory/RasterTerrainRGBTile.js +20 -46
- package/lib/tile/tileFactory/RasterTile.js +30 -63
- package/lib/tile/tileFactory/Tile.js +63 -102
- package/lib/tile/tileFactory/VectorTile.js +41 -76
- package/lib/tile/tileFactory/index.js +0 -25
- package/lib/tile/tileFactory/layers/TileDebugLayer.js +6 -32
- package/lib/tile/tileFactory/util.js +0 -9
- package/lib/tile/tileLayer/BaseLayer.js +105 -153
- package/lib/tile/utils.js +1 -5
- package/lib/utils/blend.js +0 -5
- package/lib/utils/collision-index.js +9 -25
- package/lib/utils/dataMappingStyle.js +8 -19
- package/lib/utils/extrude_polyline.js +101 -181
- package/lib/utils/grid-index.js +2 -28
- package/lib/utils/identityScale.js +0 -9
- package/lib/utils/layerData.js +30 -49
- package/lib/utils/multiPassRender.js +11 -16
- package/lib/utils/polylineNormal.js +31 -66
- package/lib/utils/simpleLine.js +2 -21
- package/lib/utils/stencil.js +0 -4
- package/lib/utils/symbol-layout.js +27 -55
- package/lib/wind/index.js +9 -37
- package/lib/wind/models/index.js +0 -3
- package/lib/wind/models/utils.js +26 -62
- package/lib/wind/models/wind.js +101 -157
- package/lib/wind/models/windRender.js +53 -71
- package/lib/wind/models/windShader.js +0 -1
- package/package.json +7 -7
package/lib/core/BaseModel.js
CHANGED
|
@@ -1,61 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
15
|
-
|
|
16
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
-
|
|
18
12
|
var _initializerDefineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/initializerDefineProperty"));
|
|
19
|
-
|
|
20
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
-
|
|
22
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
|
-
|
|
24
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
16
|
var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/helpers/applyDecoratedDescriptor"));
|
|
27
|
-
|
|
28
17
|
var _initializerWarningHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/initializerWarningHelper"));
|
|
29
|
-
|
|
30
18
|
var _l7Core = require("@antv/l7-core");
|
|
31
|
-
|
|
32
19
|
var _l7Utils = require("@antv/l7-utils");
|
|
33
|
-
|
|
34
20
|
var _d3Color = require("d3-color");
|
|
35
|
-
|
|
36
21
|
var _lodash = require("lodash");
|
|
37
|
-
|
|
38
22
|
var _blend = require("../utils/blend");
|
|
39
|
-
|
|
40
23
|
var _stencil = require("../utils/stencil");
|
|
41
|
-
|
|
42
24
|
var _dec, _class, _descriptor;
|
|
43
|
-
|
|
44
25
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
45
|
-
|
|
46
26
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
47
|
-
|
|
48
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
49
|
-
|
|
27
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
50
28
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
51
29
|
var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigService), (_class = /*#__PURE__*/function () {
|
|
52
30
|
// style texture data mapping
|
|
31
|
+
|
|
53
32
|
// 用于数据传递的数据纹理
|
|
54
33
|
// 默认有多少列(宽度)
|
|
55
34
|
// 计算得到的当前数据纹理有多少行(高度)
|
|
35
|
+
|
|
56
36
|
// 单个 cell 的长度
|
|
57
37
|
// 需要进行数据映射的属性集合
|
|
38
|
+
|
|
58
39
|
// style texture data mapping
|
|
40
|
+
|
|
59
41
|
function BaseModel(layer) {
|
|
60
42
|
(0, _classCallCheck2.default)(this, BaseModel);
|
|
61
43
|
(0, _initializerDefineProperty2.default)(this, "configService", _descriptor, this);
|
|
@@ -68,15 +50,15 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
68
50
|
this.iconService = layer.getContainer().get(_l7Core.TYPES.IIconService);
|
|
69
51
|
this.fontService = layer.getContainer().get(_l7Core.TYPES.IFontService);
|
|
70
52
|
this.cameraService = layer.getContainer().get(_l7Core.TYPES.ICameraService);
|
|
71
|
-
this.layerService = layer.getContainer().get(_l7Core.TYPES.ILayerService);
|
|
72
|
-
|
|
73
|
-
this.registerBuiltinAttributes(); // 开启动画
|
|
53
|
+
this.layerService = layer.getContainer().get(_l7Core.TYPES.ILayerService);
|
|
74
54
|
|
|
55
|
+
// 注册 Attribute
|
|
56
|
+
this.registerBuiltinAttributes();
|
|
57
|
+
// 开启动画
|
|
75
58
|
this.startModelAnimate();
|
|
76
59
|
var createTexture2D = this.rendererService.createTexture2D;
|
|
77
60
|
this.createTexture2D = createTexture2D;
|
|
78
61
|
this.DATA_TEXTURE_WIDTH = 1024; // 数据纹理固定宽度
|
|
79
|
-
|
|
80
62
|
this.rowCount = 1;
|
|
81
63
|
this.cellLength = 0;
|
|
82
64
|
this.cellProperties = [];
|
|
@@ -96,8 +78,8 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
96
78
|
hasStroke: 0,
|
|
97
79
|
hasOffsets: 0
|
|
98
80
|
};
|
|
99
|
-
this.dataTextureTest = this.layerService.getOESTextureFloat();
|
|
100
|
-
|
|
81
|
+
this.dataTextureTest = this.layerService.getOESTextureFloat();
|
|
82
|
+
// 只有在不支持数据纹理的情况下进行赋值
|
|
101
83
|
if (!this.dataTextureTest) {
|
|
102
84
|
this.dataTexture = this.createTexture2D({
|
|
103
85
|
// data: new Uint8ClampedArray(4),
|
|
@@ -110,20 +92,18 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
110
92
|
height: 1
|
|
111
93
|
});
|
|
112
94
|
}
|
|
113
|
-
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// style datatexture mapping
|
|
114
98
|
|
|
115
99
|
/**
|
|
116
100
|
* 清除上一次的计算结果 - 全量清除
|
|
117
101
|
*/
|
|
118
|
-
|
|
119
|
-
|
|
120
102
|
(0, _createClass2.default)(BaseModel, [{
|
|
121
103
|
key: "clearLastCalRes",
|
|
122
104
|
value: function clearLastCalRes() {
|
|
123
105
|
this.cellProperties = []; // 清空上一次计算的需要进行数据映射的属性集合
|
|
124
|
-
|
|
125
106
|
this.cellLength = 0; // 清空上一次计算的 cell 的长度
|
|
126
|
-
|
|
127
107
|
this.stylePropertiesExist = {
|
|
128
108
|
// 全量清空上一次是否需要对 style 属性进行数据映射的判断
|
|
129
109
|
hasThetaOffset: 0,
|
|
@@ -138,82 +118,91 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
138
118
|
key: "getCellTypeLayout",
|
|
139
119
|
value: function getCellTypeLayout() {
|
|
140
120
|
if (this.dataTextureTest) {
|
|
141
|
-
return [
|
|
142
|
-
|
|
143
|
-
this.
|
|
144
|
-
|
|
145
|
-
this.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
121
|
+
return [
|
|
122
|
+
// 0
|
|
123
|
+
this.rowCount,
|
|
124
|
+
// 数据纹理有几行
|
|
125
|
+
this.DATA_TEXTURE_WIDTH,
|
|
126
|
+
// 数据纹理有几列
|
|
127
|
+
0.0, 0.0,
|
|
128
|
+
// 1
|
|
129
|
+
this.stylePropertiesExist.hasOpacity,
|
|
130
|
+
// cell 中是否存在 opacity
|
|
131
|
+
this.stylePropertiesExist.hasStrokeOpacity,
|
|
132
|
+
// cell 中是否存在 strokeOpacity
|
|
133
|
+
this.stylePropertiesExist.hasStrokeWidth,
|
|
134
|
+
// cell 中是否存在 strokeWidth
|
|
135
|
+
this.stylePropertiesExist.hasStroke,
|
|
136
|
+
// cell 中是否存在 stroke
|
|
149
137
|
// 2
|
|
150
|
-
this.stylePropertiesExist.hasOffsets,
|
|
151
|
-
|
|
152
|
-
|
|
138
|
+
this.stylePropertiesExist.hasOffsets,
|
|
139
|
+
// cell 中是否存在 offsets
|
|
140
|
+
this.stylePropertiesExist.hasThetaOffset,
|
|
141
|
+
// cell 中是否存在 thetaOffset
|
|
142
|
+
0.0, 0.0,
|
|
143
|
+
// 3
|
|
153
144
|
0.0, 0.0, 0.0, 1.0];
|
|
154
145
|
} else {
|
|
155
|
-
return [1.0,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
0.0,
|
|
160
|
-
|
|
161
|
-
0.0,
|
|
146
|
+
return [1.0,
|
|
147
|
+
// 数据纹理有几行
|
|
148
|
+
1.0,
|
|
149
|
+
// 数据纹理有几列
|
|
150
|
+
0.0, 0.0, 0.0,
|
|
151
|
+
// cell 中是否存在 opacity
|
|
152
|
+
0.0,
|
|
153
|
+
// cell 中是否存在 strokeOpacity
|
|
154
|
+
0.0,
|
|
155
|
+
// cell 中是否存在 strokeWidth
|
|
156
|
+
0.0,
|
|
157
|
+
// cell 中是否存在 stroke
|
|
158
|
+
0.0,
|
|
159
|
+
// cell 中是否存在 offsets
|
|
162
160
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0];
|
|
163
161
|
}
|
|
164
162
|
}
|
|
163
|
+
|
|
165
164
|
/**
|
|
166
165
|
* 判断数据纹理是否需要重新计算 - 根据传入的值进行判断
|
|
167
166
|
* @param options
|
|
168
167
|
* @returns
|
|
169
168
|
*/
|
|
170
|
-
|
|
171
169
|
}, {
|
|
172
170
|
key: "dataTextureNeedUpdate",
|
|
173
171
|
value: function dataTextureNeedUpdate(options) {
|
|
174
172
|
var isUpdate = false;
|
|
175
|
-
|
|
176
173
|
if (!(0, _lodash.isEqual)(options.thetaOffset, this.cacheStyleProperties.thetaOffset)) {
|
|
177
174
|
isUpdate = true;
|
|
178
175
|
this.cacheStyleProperties.thetaOffset = options.thetaOffset;
|
|
179
176
|
}
|
|
180
|
-
|
|
181
177
|
if (!(0, _lodash.isEqual)(options.opacity, this.cacheStyleProperties.opacity)) {
|
|
182
178
|
isUpdate = true;
|
|
183
179
|
this.cacheStyleProperties.opacity = options.opacity;
|
|
184
180
|
}
|
|
185
|
-
|
|
186
181
|
if (!(0, _lodash.isEqual)(options.strokeOpacity, this.cacheStyleProperties.strokeOpacity)) {
|
|
187
182
|
isUpdate = true;
|
|
188
183
|
this.cacheStyleProperties.strokeOpacity = options.strokeOpacity;
|
|
189
184
|
}
|
|
190
|
-
|
|
191
185
|
if (!(0, _lodash.isEqual)(options.strokeWidth, this.cacheStyleProperties.strokeWidth)) {
|
|
192
186
|
isUpdate = true;
|
|
193
187
|
this.cacheStyleProperties.strokeWidth = options.strokeWidth;
|
|
194
188
|
}
|
|
195
|
-
|
|
196
189
|
if (!(0, _lodash.isEqual)(options.stroke, this.cacheStyleProperties.stroke)) {
|
|
197
190
|
isUpdate = true;
|
|
198
191
|
this.cacheStyleProperties.stroke = options.stroke;
|
|
199
192
|
}
|
|
200
|
-
|
|
201
193
|
if (!(0, _lodash.isEqual)(options.offsets, this.cacheStyleProperties.offsets)) {
|
|
202
194
|
isUpdate = true;
|
|
203
195
|
this.cacheStyleProperties.offsets = options.offsets;
|
|
204
196
|
}
|
|
205
|
-
|
|
206
197
|
if (this.dataTexture === undefined) {
|
|
207
198
|
isUpdate = true;
|
|
208
199
|
}
|
|
209
|
-
|
|
210
200
|
return isUpdate;
|
|
211
201
|
}
|
|
212
202
|
/**
|
|
213
203
|
* 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量
|
|
214
204
|
* @param options
|
|
215
205
|
*/
|
|
216
|
-
|
|
217
206
|
}, {
|
|
218
207
|
key: "judgeStyleAttributes",
|
|
219
208
|
value: function judgeStyleAttributes(options) {
|
|
@@ -228,7 +217,6 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
228
217
|
this.stylePropertiesExist.hasOpacity = 1;
|
|
229
218
|
this.cellLength += 1;
|
|
230
219
|
}
|
|
231
|
-
|
|
232
220
|
if (options.strokeOpacity !== undefined && !(0, _lodash.isNumber)(options.strokeOpacity)) {
|
|
233
221
|
// 数据映射
|
|
234
222
|
this.cellProperties.push({
|
|
@@ -238,7 +226,6 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
238
226
|
this.stylePropertiesExist.hasStrokeOpacity = 1;
|
|
239
227
|
this.cellLength += 1;
|
|
240
228
|
}
|
|
241
|
-
|
|
242
229
|
if (options.strokeWidth !== undefined && !(0, _lodash.isNumber)(options.strokeWidth)) {
|
|
243
230
|
// 数据映射
|
|
244
231
|
this.cellProperties.push({
|
|
@@ -248,7 +235,6 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
248
235
|
this.stylePropertiesExist.hasStrokeWidth = 1;
|
|
249
236
|
this.cellLength += 1;
|
|
250
237
|
}
|
|
251
|
-
|
|
252
238
|
if (options.stroke !== undefined && !this.isStaticColor(options.stroke)) {
|
|
253
239
|
// 数据映射
|
|
254
240
|
this.cellProperties.push({
|
|
@@ -258,7 +244,6 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
258
244
|
this.stylePropertiesExist.hasStroke = 1;
|
|
259
245
|
this.cellLength += 4;
|
|
260
246
|
}
|
|
261
|
-
|
|
262
247
|
if (options.offsets !== undefined && !this.isOffsetStatic(options.offsets)) {
|
|
263
248
|
// 数据映射
|
|
264
249
|
this.cellProperties.push({
|
|
@@ -268,7 +253,6 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
268
253
|
this.stylePropertiesExist.hasOffsets = 1;
|
|
269
254
|
this.cellLength += 2;
|
|
270
255
|
}
|
|
271
|
-
|
|
272
256
|
if (options.thetaOffset !== undefined && !(0, _lodash.isNumber)(options.thetaOffset)) {
|
|
273
257
|
// 数据映射
|
|
274
258
|
this.cellProperties.push({
|
|
@@ -279,12 +263,12 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
279
263
|
this.cellLength += 1;
|
|
280
264
|
}
|
|
281
265
|
}
|
|
266
|
+
|
|
282
267
|
/**
|
|
283
268
|
* 判断变量 stroke 是否是常量值
|
|
284
269
|
* @param stroke
|
|
285
270
|
* @returns
|
|
286
271
|
*/
|
|
287
|
-
|
|
288
272
|
}, {
|
|
289
273
|
key: "isStaticColor",
|
|
290
274
|
value: function isStaticColor(stroke) {
|
|
@@ -295,7 +279,6 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
295
279
|
return false;
|
|
296
280
|
}
|
|
297
281
|
}
|
|
298
|
-
|
|
299
282
|
return false;
|
|
300
283
|
}
|
|
301
284
|
/**
|
|
@@ -303,7 +286,6 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
303
286
|
* @param stroke
|
|
304
287
|
* @returns
|
|
305
288
|
*/
|
|
306
|
-
|
|
307
289
|
}, {
|
|
308
290
|
key: "getStrokeColor",
|
|
309
291
|
value: function getStrokeColor(stroke) {
|
|
@@ -318,12 +300,12 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
318
300
|
return [0, 0, 0, 0];
|
|
319
301
|
}
|
|
320
302
|
}
|
|
303
|
+
|
|
321
304
|
/**
|
|
322
305
|
* 判断 offsets 是否是常量
|
|
323
306
|
* @param offsets
|
|
324
307
|
* @returns
|
|
325
308
|
*/
|
|
326
|
-
|
|
327
309
|
}, {
|
|
328
310
|
key: "isOffsetStatic",
|
|
329
311
|
value: function isOffsetStatic(offsets) {
|
|
@@ -333,12 +315,12 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
333
315
|
return false;
|
|
334
316
|
}
|
|
335
317
|
}
|
|
318
|
+
|
|
336
319
|
/**
|
|
337
320
|
* 补空位
|
|
338
321
|
* @param d
|
|
339
322
|
* @param count
|
|
340
323
|
*/
|
|
341
|
-
|
|
342
324
|
}, {
|
|
343
325
|
key: "patchMod",
|
|
344
326
|
value: function patchMod(d, count) {
|
|
@@ -346,26 +328,24 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
346
328
|
d.push(-1);
|
|
347
329
|
}
|
|
348
330
|
}
|
|
331
|
+
|
|
349
332
|
/**
|
|
350
333
|
* 根据映射的数据字段往推入数据
|
|
351
334
|
* @param d
|
|
352
335
|
* @param cellData
|
|
353
336
|
* @param cellPropertiesLayouts
|
|
354
337
|
*/
|
|
355
|
-
|
|
356
338
|
}, {
|
|
357
339
|
key: "patchData",
|
|
358
340
|
value: function patchData(d, cellData, cellPropertiesLayouts) {
|
|
359
341
|
var _iterator = _createForOfIteratorHelper(cellPropertiesLayouts),
|
|
360
|
-
|
|
361
|
-
|
|
342
|
+
_step;
|
|
362
343
|
try {
|
|
363
344
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
364
345
|
var layout = _step.value;
|
|
365
346
|
var attr = layout.attr,
|
|
366
|
-
|
|
347
|
+
count = layout.count;
|
|
367
348
|
var value = cellData[attr];
|
|
368
|
-
|
|
369
349
|
if (value !== undefined) {
|
|
370
350
|
// 数据中存在该属性
|
|
371
351
|
if (attr === 'stroke') {
|
|
@@ -390,6 +370,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
390
370
|
_iterator.f();
|
|
391
371
|
}
|
|
392
372
|
}
|
|
373
|
+
|
|
393
374
|
/**
|
|
394
375
|
* 计算推入数据纹理的数据
|
|
395
376
|
* @param cellLength
|
|
@@ -397,7 +378,6 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
397
378
|
* @param cellPropertiesLayouts
|
|
398
379
|
* @returns
|
|
399
380
|
*/
|
|
400
|
-
|
|
401
381
|
}, {
|
|
402
382
|
key: "calDataFrame",
|
|
403
383
|
value: function calDataFrame(cellLength, encodeData, cellPropertiesLayouts) {
|
|
@@ -406,48 +386,44 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
406
386
|
|
|
407
387
|
var totalLength = rowCount * this.DATA_TEXTURE_WIDTH;
|
|
408
388
|
var d = [];
|
|
409
|
-
|
|
410
389
|
for (var i = 0; i < encodeDatalength; i++) {
|
|
411
390
|
// 根据 encodeData 数据推入数据
|
|
412
391
|
var cellData = encodeData[i];
|
|
413
392
|
this.patchData(d, cellData, cellPropertiesLayouts);
|
|
414
393
|
}
|
|
415
|
-
|
|
416
394
|
for (var _i = d.length; _i < totalLength; _i++) {
|
|
417
395
|
// 每行不足的部分用 -1 补足(数据纹理时 width * height 的矩形数据集合)
|
|
418
396
|
d.push(-1);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
|
|
397
|
+
}
|
|
398
|
+
// console.log('data', d)
|
|
422
399
|
return {
|
|
423
400
|
data: d,
|
|
424
401
|
width: this.DATA_TEXTURE_WIDTH,
|
|
425
402
|
height: rowCount
|
|
426
403
|
};
|
|
427
|
-
}
|
|
404
|
+
}
|
|
428
405
|
|
|
406
|
+
// style datatexture mapping
|
|
429
407
|
}, {
|
|
430
408
|
key: "getBlend",
|
|
431
409
|
value: function getBlend() {
|
|
432
410
|
var _this$layer$getLayerC = this.layer.getLayerConfig(),
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
411
|
+
_this$layer$getLayerC2 = _this$layer$getLayerC.blend,
|
|
412
|
+
blend = _this$layer$getLayerC2 === void 0 ? 'normal' : _this$layer$getLayerC2;
|
|
436
413
|
return _blend.BlendTypes[_l7Core.BlendType[blend]];
|
|
437
414
|
}
|
|
438
415
|
}, {
|
|
439
416
|
key: "getStencil",
|
|
440
417
|
value: function getStencil(option) {
|
|
441
418
|
var _this$layer$getLayerC3 = this.layer.getLayerConfig(),
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
419
|
+
_this$layer$getLayerC4 = _this$layer$getLayerC3.mask,
|
|
420
|
+
mask = _this$layer$getLayerC4 === void 0 ? false : _this$layer$getLayerC4,
|
|
421
|
+
_this$layer$getLayerC5 = _this$layer$getLayerC3.maskInside,
|
|
422
|
+
maskInside = _this$layer$getLayerC5 === void 0 ? true : _this$layer$getLayerC5,
|
|
423
|
+
enableMask = _this$layer$getLayerC3.enableMask,
|
|
424
|
+
_this$layer$getLayerC6 = _this$layer$getLayerC3.maskOperation,
|
|
425
|
+
maskOperation = _this$layer$getLayerC6 === void 0 ? _l7Core.MaskOperation.AND : _this$layer$getLayerC6;
|
|
426
|
+
// TODO 临时处理,后期移除MaskLayer
|
|
451
427
|
if (this.layer.type === 'MaskLayer') {
|
|
452
428
|
return (0, _stencil.getStencilMask)({
|
|
453
429
|
isStencil: true,
|
|
@@ -461,11 +437,12 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
461
437
|
})); // 用于遮罩的stencil 参数
|
|
462
438
|
}
|
|
463
439
|
|
|
464
|
-
var maskflag = mask ||
|
|
465
|
-
|
|
440
|
+
var maskflag = mask ||
|
|
441
|
+
// mask 兼容历史写法
|
|
442
|
+
enableMask && this.layer.masks.length !== 0 ||
|
|
443
|
+
// 外部图层的mask
|
|
466
444
|
this.layer.tileMask !== undefined; // 瓦片图层
|
|
467
445
|
// !!(mask || enableMask || this.layer.tileMask);
|
|
468
|
-
|
|
469
446
|
return (0, _stencil.getStencil)(maskflag, maskInside);
|
|
470
447
|
}
|
|
471
448
|
}, {
|
|
@@ -488,76 +465,58 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
488
465
|
value: function () {
|
|
489
466
|
var _needUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
490
467
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
491
|
-
while (1) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
case "end":
|
|
498
|
-
return _context.stop();
|
|
499
|
-
}
|
|
468
|
+
while (1) switch (_context.prev = _context.next) {
|
|
469
|
+
case 0:
|
|
470
|
+
return _context.abrupt("return", false);
|
|
471
|
+
case 1:
|
|
472
|
+
case "end":
|
|
473
|
+
return _context.stop();
|
|
500
474
|
}
|
|
501
475
|
}, _callee);
|
|
502
476
|
}));
|
|
503
|
-
|
|
504
477
|
function needUpdate() {
|
|
505
478
|
return _needUpdate.apply(this, arguments);
|
|
506
479
|
}
|
|
507
|
-
|
|
508
480
|
return needUpdate;
|
|
509
481
|
}() // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
510
|
-
|
|
511
482
|
}, {
|
|
512
483
|
key: "buildModels",
|
|
513
484
|
value: function () {
|
|
514
485
|
var _buildModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
515
486
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
516
|
-
while (1) {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
case "end":
|
|
523
|
-
return _context2.stop();
|
|
524
|
-
}
|
|
487
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
488
|
+
case 0:
|
|
489
|
+
throw new Error('Method not implemented.');
|
|
490
|
+
case 1:
|
|
491
|
+
case "end":
|
|
492
|
+
return _context2.stop();
|
|
525
493
|
}
|
|
526
494
|
}, _callee2);
|
|
527
495
|
}));
|
|
528
|
-
|
|
529
496
|
function buildModels() {
|
|
530
497
|
return _buildModels.apply(this, arguments);
|
|
531
498
|
}
|
|
532
|
-
|
|
533
499
|
return buildModels;
|
|
534
500
|
}() // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
535
|
-
|
|
536
501
|
}, {
|
|
537
502
|
key: "initModels",
|
|
538
503
|
value: function () {
|
|
539
504
|
var _initModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
540
505
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
541
|
-
while (1) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
case "end":
|
|
548
|
-
return _context3.stop();
|
|
549
|
-
}
|
|
506
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
507
|
+
case 0:
|
|
508
|
+
throw new Error('Method not implemented.');
|
|
509
|
+
case 1:
|
|
510
|
+
case "end":
|
|
511
|
+
return _context3.stop();
|
|
550
512
|
}
|
|
551
513
|
}, _callee3);
|
|
552
514
|
}));
|
|
553
|
-
|
|
554
515
|
function initModels() {
|
|
555
516
|
return _initModels.apply(this, arguments);
|
|
556
517
|
}
|
|
557
|
-
|
|
558
518
|
return initModels;
|
|
559
519
|
}() // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
560
|
-
|
|
561
520
|
}, {
|
|
562
521
|
key: "clearModels",
|
|
563
522
|
value: function clearModels() {
|
|
@@ -568,8 +527,8 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
568
527
|
key: "getAttribute",
|
|
569
528
|
value: function getAttribute() {
|
|
570
529
|
throw new Error('Method not implemented.');
|
|
571
|
-
}
|
|
572
|
-
|
|
530
|
+
}
|
|
531
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
573
532
|
}, {
|
|
574
533
|
key: "render",
|
|
575
534
|
value: function render(renderOptions) {
|
|
@@ -589,8 +548,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
|
|
|
589
548
|
key: "startModelAnimate",
|
|
590
549
|
value: function startModelAnimate() {
|
|
591
550
|
var _ref = this.layer.getLayerConfig(),
|
|
592
|
-
|
|
593
|
-
|
|
551
|
+
animateOption = _ref.animateOption;
|
|
594
552
|
if (animateOption.enable) {
|
|
595
553
|
this.layer.setAnimateStartTime();
|
|
596
554
|
}
|