@antv/l7-layers 2.17.4 → 2.17.6
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 +325 -483
- package/es/core/BaseModel.js +51 -80
- package/es/core/CommonStyleAttribute.js +2 -5
- 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 +27 -39
- package/es/core/triangulation.js +99 -136
- 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 +92 -149
- 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 -35
- package/es/line/models/arc.js +63 -112
- package/es/line/models/arc_3d.js +58 -102
- package/es/line/models/earthArc_3d.js +60 -105
- package/es/line/models/flow.js +36 -60
- package/es/line/models/great_circle.js +53 -94
- package/es/line/models/line.js +92 -144
- package/es/line/models/linearline.js +42 -74
- package/es/line/models/simpleLine.js +38 -67
- package/es/line/models/wall.js +52 -92
- package/es/line/shaders/dash/line_dash_vert.glsl +1 -2
- package/es/line/shaders/line_frag.glsl +1 -3
- package/es/line/shaders/line_vert.glsl +2 -0
- package/es/line/shaders/linear/line_linear_frag.glsl +1 -1
- package/es/mask/index.js +9 -28
- package/es/mask/models/fill.js +29 -54
- package/es/plugins/DataMappingPlugin.js +78 -114
- 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 +69 -118
- package/es/plugins/LayerStylePlugin.js +4 -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 -78
- package/es/point/models/earthExtrude.js +58 -95
- package/es/point/models/earthFill.js +52 -80
- package/es/point/models/extrude.js +57 -94
- package/es/point/models/fill.js +56 -81
- package/es/point/models/fillmage.js +60 -100
- package/es/point/models/image.js +47 -83
- package/es/point/models/index.js +2 -2
- package/es/point/models/normal.js +30 -54
- package/es/point/models/radar.js +38 -63
- package/es/point/models/simplePoint.js +38 -62
- package/es/point/models/text.js +199 -296
- package/es/point/shape/extrude.js +4 -13
- package/es/polygon/index.js +11 -41
- package/es/polygon/models/extrude.js +87 -135
- package/es/polygon/models/fill.js +50 -79
- 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 +33 -55
- package/es/tile/service/TilePickService.js +26 -40
- package/es/tile/service/TileSourceService.js +3 -7
- package/es/tile/tileFactory/DebugTile.js +29 -46
- 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/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 +325 -474
- package/lib/core/BaseModel.js +51 -90
- package/lib/core/CommonStyleAttribute.js +2 -7
- 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 +27 -62
- package/lib/core/triangulation.js +98 -177
- 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 +92 -166
- 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 +61 -122
- package/lib/line/models/arc_3d.js +56 -113
- package/lib/line/models/earthArc_3d.js +58 -115
- package/lib/line/models/flow.js +36 -70
- package/lib/line/models/great_circle.js +53 -104
- package/lib/line/models/index.js +0 -11
- package/lib/line/models/line.js +90 -152
- package/lib/line/models/linearline.js +42 -86
- package/lib/line/models/simpleLine.js +38 -77
- package/lib/line/models/wall.js +52 -103
- package/lib/line/shaders/dash/line_dash_vert.glsl +1 -2
- package/lib/line/shaders/line_frag.glsl +1 -3
- package/lib/line/shaders/line_vert.glsl +2 -0
- package/lib/line/shaders/linear/line_linear_frag.glsl +1 -1
- 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 +78 -125
- 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 +70 -127
- package/lib/plugins/LayerStylePlugin.js +5 -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 +58 -106
- package/lib/point/models/earthFill.js +52 -110
- package/lib/point/models/extrude.js +57 -103
- package/lib/point/models/fill.js +54 -90
- package/lib/point/models/fillmage.js +58 -107
- package/lib/point/models/image.js +47 -92
- package/lib/point/models/index.js +1 -12
- package/lib/point/models/normal.js +30 -64
- package/lib/point/models/radar.js +38 -72
- package/lib/point/models/simplePoint.js +38 -72
- package/lib/point/models/text.js +199 -305
- package/lib/point/shape/extrude.js +4 -20
- package/lib/polygon/index.js +11 -48
- package/lib/polygon/models/extrude.js +87 -146
- package/lib/polygon/models/fill.js +50 -89
- 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 +33 -60
- 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 +29 -54
- 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/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
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
|
|
5
4
|
var _dec, _class;
|
|
6
|
-
|
|
7
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
6
|
import { IDebugLog, ILayerStage } from '@antv/l7-core';
|
|
9
7
|
import { injectable } from 'inversify';
|
|
@@ -12,38 +10,31 @@ import TileLayer from "../tile/tileLayer/BaseLayer";
|
|
|
12
10
|
/**
|
|
13
11
|
* Layer Model 初始化,更新,销毁
|
|
14
12
|
*/
|
|
15
|
-
|
|
16
13
|
var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
|
|
17
14
|
function LayerModelPlugin() {
|
|
18
15
|
_classCallCheck(this, LayerModelPlugin);
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
_createClass(LayerModelPlugin, [{
|
|
22
18
|
key: "build",
|
|
23
19
|
value: function () {
|
|
24
20
|
var _build = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(layer) {
|
|
25
21
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
26
|
-
while (1) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
case "end":
|
|
37
|
-
return _context.stop();
|
|
38
|
-
}
|
|
22
|
+
while (1) switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
// 更新Model 配置项 style options
|
|
25
|
+
layer.prepareBuildModel();
|
|
26
|
+
// 初始化 Model
|
|
27
|
+
_context.next = 3;
|
|
28
|
+
return layer.buildModels();
|
|
29
|
+
case 3:
|
|
30
|
+
case "end":
|
|
31
|
+
return _context.stop();
|
|
39
32
|
}
|
|
40
33
|
}, _callee);
|
|
41
34
|
}));
|
|
42
|
-
|
|
43
35
|
function build(_x) {
|
|
44
36
|
return _build.apply(this, arguments);
|
|
45
37
|
}
|
|
46
|
-
|
|
47
38
|
return build;
|
|
48
39
|
}()
|
|
49
40
|
}, {
|
|
@@ -51,27 +42,21 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
51
42
|
value: function () {
|
|
52
43
|
var _initLayerModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(layer) {
|
|
53
44
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
54
|
-
while (1) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
case 3:
|
|
64
|
-
case "end":
|
|
65
|
-
return _context2.stop();
|
|
66
|
-
}
|
|
45
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
46
|
+
case 0:
|
|
47
|
+
_context2.next = 2;
|
|
48
|
+
return this.build(layer);
|
|
49
|
+
case 2:
|
|
50
|
+
layer.styleNeedUpdate = false;
|
|
51
|
+
case 3:
|
|
52
|
+
case "end":
|
|
53
|
+
return _context2.stop();
|
|
67
54
|
}
|
|
68
55
|
}, _callee2, this);
|
|
69
56
|
}));
|
|
70
|
-
|
|
71
57
|
function initLayerModel(_x2) {
|
|
72
58
|
return _initLayerModel.apply(this, arguments);
|
|
73
59
|
}
|
|
74
|
-
|
|
75
60
|
return initLayerModel;
|
|
76
61
|
}()
|
|
77
62
|
}, {
|
|
@@ -79,120 +64,86 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
79
64
|
value: function () {
|
|
80
65
|
var _prepareLayerModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(layer) {
|
|
81
66
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
82
|
-
while (1) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
case 3:
|
|
92
|
-
case "end":
|
|
93
|
-
return _context3.stop();
|
|
94
|
-
}
|
|
67
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
68
|
+
case 0:
|
|
69
|
+
_context3.next = 2;
|
|
70
|
+
return this.build(layer);
|
|
71
|
+
case 2:
|
|
72
|
+
layer.styleNeedUpdate = false;
|
|
73
|
+
case 3:
|
|
74
|
+
case "end":
|
|
75
|
+
return _context3.stop();
|
|
95
76
|
}
|
|
96
77
|
}, _callee3, this);
|
|
97
78
|
}));
|
|
98
|
-
|
|
99
79
|
function prepareLayerModel(_x3) {
|
|
100
80
|
return _prepareLayerModel.apply(this, arguments);
|
|
101
81
|
}
|
|
102
|
-
|
|
103
82
|
return prepareLayerModel;
|
|
104
83
|
}()
|
|
105
84
|
}, {
|
|
106
85
|
key: "apply",
|
|
107
86
|
value: function apply(layer) {
|
|
108
87
|
var _this = this;
|
|
109
|
-
|
|
110
88
|
layer.hooks.init.tapPromise('LayerModelPlugin', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
111
89
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
112
|
-
while (1) {
|
|
113
|
-
|
|
90
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
91
|
+
case 0:
|
|
92
|
+
if (!layer.getSource().isTile) {
|
|
93
|
+
_context4.next = 4;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
layer.prepareBuildModel();
|
|
97
|
+
layer.tileLayer = new TileLayer(layer);
|
|
98
|
+
return _context4.abrupt("return");
|
|
99
|
+
case 4:
|
|
100
|
+
layer.log(IDebugLog.BuildModelStart, ILayerStage.INIT);
|
|
101
|
+
_context4.next = 7;
|
|
102
|
+
return _this.initLayerModel(layer);
|
|
103
|
+
case 7:
|
|
104
|
+
layer.log(IDebugLog.BuildModelEnd, ILayerStage.INIT);
|
|
105
|
+
case 8:
|
|
106
|
+
case "end":
|
|
107
|
+
return _context4.stop();
|
|
108
|
+
}
|
|
109
|
+
}, _callee4);
|
|
110
|
+
})));
|
|
111
|
+
layer.hooks.beforeRenderData.tapPromise('LayerModelPlugin', /*#__PURE__*/function () {
|
|
112
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(flag) {
|
|
113
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
114
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
114
115
|
case 0:
|
|
116
|
+
if (flag) {
|
|
117
|
+
_context5.next = 2;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
return _context5.abrupt("return", false);
|
|
121
|
+
case 2:
|
|
115
122
|
if (!layer.getSource().isTile) {
|
|
116
|
-
|
|
123
|
+
_context5.next = 5;
|
|
117
124
|
break;
|
|
118
125
|
}
|
|
119
|
-
|
|
120
|
-
layer.prepareBuildModel();
|
|
121
126
|
layer.tileLayer = new TileLayer(layer);
|
|
122
|
-
return
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return _this.initLayerModel(layer);
|
|
128
|
-
|
|
129
|
-
case 7:
|
|
130
|
-
layer.log(IDebugLog.BuildModelEnd, ILayerStage.INIT);
|
|
131
|
-
|
|
127
|
+
return _context5.abrupt("return", false);
|
|
128
|
+
case 5:
|
|
129
|
+
layer.log(IDebugLog.BuildModelStart, ILayerStage.UPDATE);
|
|
130
|
+
_context5.next = 8;
|
|
131
|
+
return _this.prepareLayerModel(layer);
|
|
132
132
|
case 8:
|
|
133
|
+
layer.log(IDebugLog.BuildModelEnd, ILayerStage.UPDATE);
|
|
134
|
+
return _context5.abrupt("return", true);
|
|
135
|
+
case 10:
|
|
133
136
|
case "end":
|
|
134
|
-
return
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}, _callee4);
|
|
138
|
-
})));
|
|
139
|
-
layer.hooks.beforeRenderData.tapPromise('LayerModelPlugin', /*#__PURE__*/function () {
|
|
140
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(flag) {
|
|
141
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
142
|
-
while (1) {
|
|
143
|
-
switch (_context5.prev = _context5.next) {
|
|
144
|
-
case 0:
|
|
145
|
-
if (flag) {
|
|
146
|
-
_context5.next = 2;
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return _context5.abrupt("return", false);
|
|
151
|
-
|
|
152
|
-
case 2:
|
|
153
|
-
if (!layer.getSource().isTile) {
|
|
154
|
-
_context5.next = 5;
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
layer.tileLayer = new TileLayer(layer);
|
|
159
|
-
return _context5.abrupt("return", false);
|
|
160
|
-
|
|
161
|
-
case 5:
|
|
162
|
-
layer.log(IDebugLog.BuildModelStart, ILayerStage.UPDATE);
|
|
163
|
-
_context5.next = 8;
|
|
164
|
-
return _this.prepareLayerModel(layer);
|
|
165
|
-
|
|
166
|
-
case 8:
|
|
167
|
-
layer.log(IDebugLog.BuildModelEnd, ILayerStage.UPDATE);
|
|
168
|
-
return _context5.abrupt("return", true);
|
|
169
|
-
|
|
170
|
-
case 10:
|
|
171
|
-
case "end":
|
|
172
|
-
return _context5.stop();
|
|
173
|
-
}
|
|
137
|
+
return _context5.stop();
|
|
174
138
|
}
|
|
175
139
|
}, _callee5);
|
|
176
140
|
}));
|
|
177
|
-
|
|
178
141
|
return function (_x4) {
|
|
179
142
|
return _ref2.apply(this, arguments);
|
|
180
143
|
};
|
|
181
144
|
}());
|
|
182
|
-
layer.hooks.beforeRender.tap('LayerModelPlugin', function () {
|
|
183
|
-
// 判断数据映射是否需要更新
|
|
184
|
-
if (layer.styleNeedUpdate) {
|
|
185
|
-
_this.prepareLayerModel(layer).then(function () {
|
|
186
|
-
layer.styleNeedUpdate = false;
|
|
187
|
-
layer.renderLayers();
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
layer.styleNeedUpdate = false;
|
|
192
|
-
});
|
|
193
145
|
}
|
|
194
146
|
}]);
|
|
195
|
-
|
|
196
147
|
return LayerModelPlugin;
|
|
197
148
|
}()) || _class);
|
|
198
149
|
export { LayerModelPlugin as default };
|
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
|
|
4
3
|
var _dec, _class;
|
|
5
|
-
|
|
6
4
|
import { injectable } from 'inversify';
|
|
7
5
|
import 'reflect-metadata';
|
|
8
6
|
/**
|
|
9
7
|
* 更新图层样式,初始图层相关配置
|
|
10
8
|
*/
|
|
11
|
-
|
|
12
9
|
var LayerStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
|
|
13
10
|
function LayerStylePlugin() {
|
|
14
11
|
_classCallCheck(this, LayerStylePlugin);
|
|
15
12
|
}
|
|
16
|
-
|
|
17
13
|
_createClass(LayerStylePlugin, [{
|
|
18
14
|
key: "apply",
|
|
19
15
|
value: function apply(layer) {
|
|
20
16
|
layer.hooks.afterInit.tap('LayerStylePlugin', function () {
|
|
21
17
|
var _layer$getLayerConfig = layer.getLayerConfig(),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
autoFit = _layer$getLayerConfig.autoFit,
|
|
19
|
+
fitBoundsOptions = _layer$getLayerConfig.fitBoundsOptions;
|
|
20
|
+
// mask 初始化
|
|
26
21
|
if (autoFit) {
|
|
27
22
|
layer.fitBounds(fitBoundsOptions);
|
|
28
23
|
}
|
|
24
|
+
layer.styleNeedUpdate = false;
|
|
29
25
|
});
|
|
30
26
|
}
|
|
31
27
|
}]);
|
|
32
|
-
|
|
33
28
|
return LayerStylePlugin;
|
|
34
29
|
}()) || _class);
|
|
35
30
|
export { LayerStylePlugin as default };
|
|
@@ -2,9 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
|
-
|
|
6
5
|
var _dec, _class;
|
|
7
|
-
|
|
8
6
|
var _excluded = ["type"];
|
|
9
7
|
import { injectable } from 'inversify';
|
|
10
8
|
import 'reflect-metadata';
|
|
@@ -51,46 +49,43 @@ export function generateLightingUniforms(lights) {
|
|
|
51
49
|
u_SpotLights: new Array(3).fill(_objectSpread({}, DEFAULT_SPOT_LIGHT)),
|
|
52
50
|
u_NumOfSpotLights: 0
|
|
53
51
|
};
|
|
54
|
-
|
|
55
52
|
if (!lights || !lights.length) {
|
|
56
53
|
lights = [DEFAULT_LIGHT];
|
|
57
54
|
}
|
|
58
|
-
|
|
59
55
|
lights.forEach(function (_ref) {
|
|
60
56
|
var _ref$type = _ref.type,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
type = _ref$type === void 0 ? 'directional' : _ref$type,
|
|
58
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
64
59
|
var lightsUniformName = lightTypeUniformMap[type].lights;
|
|
65
|
-
var lightsNumUniformName = lightTypeUniformMap[type].num;
|
|
66
|
-
|
|
67
|
-
var num = lightsMap[lightsNumUniformName]; // @ts-ignore
|
|
68
|
-
|
|
69
|
-
lightsMap[lightsUniformName][num] = _objectSpread(_objectSpread({}, lightsMap[lightsUniformName][num]), rest); // @ts-ignore
|
|
60
|
+
var lightsNumUniformName = lightTypeUniformMap[type].num;
|
|
70
61
|
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
var num = lightsMap[lightsNumUniformName];
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
lightsMap[lightsUniformName][num] = _objectSpread(_objectSpread({}, lightsMap[lightsUniformName][num]), rest);
|
|
66
|
+
// @ts-ignore
|
|
71
67
|
lightsMap[lightsNumUniformName]++;
|
|
72
68
|
});
|
|
73
69
|
return lightsMap;
|
|
74
70
|
}
|
|
71
|
+
|
|
75
72
|
/**
|
|
76
73
|
* 光照 & Shadow
|
|
77
74
|
*/
|
|
78
|
-
|
|
79
75
|
var LightingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
|
|
80
76
|
function LightingPlugin() {
|
|
81
77
|
_classCallCheck(this, LightingPlugin);
|
|
82
78
|
}
|
|
83
|
-
|
|
84
79
|
_createClass(LightingPlugin, [{
|
|
85
80
|
key: "apply",
|
|
86
81
|
value: function apply(layer) {
|
|
87
82
|
layer.hooks.beforeRender.tap('LightingPlugin', function () {
|
|
88
83
|
var _layer$getLayerConfig = layer.getLayerConfig(),
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
enableLighting = _layer$getLayerConfig.enableLighting;
|
|
91
85
|
if (enableLighting) {
|
|
92
86
|
layer.models.forEach(function (model) {
|
|
93
|
-
return (
|
|
87
|
+
return (
|
|
88
|
+
// @ts-ignore
|
|
94
89
|
model.addUniforms(_objectSpread({}, generateLightingUniforms()))
|
|
95
90
|
);
|
|
96
91
|
});
|
|
@@ -98,7 +93,6 @@ var LightingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function (
|
|
|
98
93
|
});
|
|
99
94
|
}
|
|
100
95
|
}]);
|
|
101
|
-
|
|
102
96
|
return LightingPlugin;
|
|
103
97
|
}()) || _class);
|
|
104
98
|
export { LightingPlugin as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
|
|
4
3
|
var _dec, _class;
|
|
5
|
-
|
|
6
4
|
import { injectable } from 'inversify';
|
|
7
5
|
import 'reflect-metadata';
|
|
8
6
|
import { createMultiPassRenderer } from "../utils/multiPassRender";
|
|
7
|
+
|
|
9
8
|
/**
|
|
10
9
|
* 自定义渲染管线:
|
|
11
10
|
* ClearPass -> PixelPickingPass(可选) -> RenderPass/TAAPass -> PostProcessing -> CopyPass
|
|
@@ -19,29 +18,27 @@ import { createMultiPassRenderer } from "../utils/multiPassRender";
|
|
|
19
18
|
* ],
|
|
20
19
|
* })
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
21
|
var MultiPassRendererPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
|
|
24
22
|
function MultiPassRendererPlugin() {
|
|
25
23
|
_classCallCheck(this, MultiPassRendererPlugin);
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
_createClass(MultiPassRendererPlugin, [{
|
|
29
26
|
key: "apply",
|
|
30
27
|
value: function apply(layer, _ref) {
|
|
31
28
|
var _this = this;
|
|
32
|
-
|
|
33
29
|
var rendererService = _ref.rendererService,
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
postProcessingPassFactory = _ref.postProcessingPassFactory,
|
|
31
|
+
normalPassFactory = _ref.normalPassFactory;
|
|
36
32
|
layer.hooks.init.tapPromise('MultiPassRendererPlugin', function () {
|
|
37
33
|
var _layer$getLayerConfig = layer.getLayerConfig(),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
enableMultiPassRenderer = _layer$getLayerConfig.enableMultiPassRenderer,
|
|
35
|
+
_layer$getLayerConfig2 = _layer$getLayerConfig.passes,
|
|
36
|
+
passes = _layer$getLayerConfig2 === void 0 ? [] : _layer$getLayerConfig2;
|
|
42
37
|
|
|
43
|
-
|
|
38
|
+
// SceneConfig 的 enableMultiPassRenderer 配置项可以统一关闭
|
|
39
|
+
_this.enabled = !!enableMultiPassRenderer && layer.getLayerConfig().enableMultiPassRenderer !== false;
|
|
44
40
|
|
|
41
|
+
// 根据 LayerConfig passes 配置项初始化
|
|
45
42
|
if (_this.enabled) {
|
|
46
43
|
layer.multiPassRenderer = createMultiPassRenderer(layer, passes, postProcessingPassFactory, normalPassFactory);
|
|
47
44
|
layer.multiPassRenderer.setRenderFlag(true);
|
|
@@ -51,15 +48,13 @@ var MultiPassRendererPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/f
|
|
|
51
48
|
if (_this.enabled) {
|
|
52
49
|
// 渲染前根据 viewport 调整 FBO size
|
|
53
50
|
var _rendererService$getV = rendererService.getViewportSize(),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
width = _rendererService$getV.width,
|
|
52
|
+
height = _rendererService$getV.height;
|
|
57
53
|
layer.multiPassRenderer.resize(width, height);
|
|
58
54
|
}
|
|
59
55
|
});
|
|
60
56
|
}
|
|
61
57
|
}]);
|
|
62
|
-
|
|
63
58
|
return MultiPassRendererPlugin;
|
|
64
59
|
}()) || _class);
|
|
65
60
|
export { MultiPassRendererPlugin as default };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
|
|
4
3
|
var _dec, _class;
|
|
5
|
-
|
|
6
4
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
7
5
|
import { decodePickingColor, encodePickingColor, rgb2arr } from '@antv/l7-utils';
|
|
8
6
|
import { injectable } from 'inversify';
|
|
@@ -16,7 +14,6 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
16
14
|
function PixelPickingPlugin() {
|
|
17
15
|
_classCallCheck(this, PixelPickingPlugin);
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
_createClass(PixelPickingPlugin, [{
|
|
21
18
|
key: "apply",
|
|
22
19
|
value: function apply(layer, _ref) {
|
|
@@ -24,8 +21,7 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
24
21
|
// TODO: 由于 Shader 目前无法根据是否开启拾取进行内容修改,因此即使不开启也需要生成 a_PickingColor
|
|
25
22
|
layer.hooks.init.tapPromise('PixelPickingPlugin', function () {
|
|
26
23
|
var _layer$getLayerConfig = layer.getLayerConfig(),
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
enablePicking = _layer$getLayerConfig.enablePicking;
|
|
29
25
|
styleAttributeService.registerStyleAttribute({
|
|
30
26
|
name: 'pickingColor',
|
|
31
27
|
type: AttributeType.Attribute,
|
|
@@ -44,12 +40,11 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
42
|
});
|
|
47
|
-
});
|
|
48
|
-
|
|
43
|
+
});
|
|
44
|
+
// 必须要与 PixelPickingPass 结合使用,因此必须开启 multiPassRenderer
|
|
49
45
|
layer.hooks.beforePickingEncode.tap('PixelPickingPlugin', function () {
|
|
50
46
|
var _layer$getLayerConfig2 = layer.getLayerConfig(),
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
enablePicking = _layer$getLayerConfig2.enablePicking;
|
|
53
48
|
if (enablePicking && layer.isVisible()) {
|
|
54
49
|
layer.models.forEach(function (model) {
|
|
55
50
|
return model.addUniforms({
|
|
@@ -60,9 +55,8 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
60
55
|
});
|
|
61
56
|
layer.hooks.afterPickingEncode.tap('PixelPickingPlugin', function () {
|
|
62
57
|
var _layer$getLayerConfig3 = layer.getLayerConfig(),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
enablePicking = _layer$getLayerConfig3.enablePicking;
|
|
59
|
+
// 区分选中高亮 和滑过高亮
|
|
66
60
|
if (enablePicking && layer.isVisible()) {
|
|
67
61
|
layer.models.forEach(function (model) {
|
|
68
62
|
return model.addUniforms({
|
|
@@ -73,10 +67,9 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
73
67
|
});
|
|
74
68
|
layer.hooks.beforeHighlight.tap('PixelPickingPlugin', function (pickedColor) {
|
|
75
69
|
var _layer$getLayerConfig4 = layer.getLayerConfig(),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
highlightColor = _layer$getLayerConfig4.highlightColor,
|
|
71
|
+
_layer$getLayerConfig5 = _layer$getLayerConfig4.activeMix,
|
|
72
|
+
activeMix = _layer$getLayerConfig5 === void 0 ? 0 : _layer$getLayerConfig5;
|
|
80
73
|
var highlightColorInArray = typeof highlightColor === 'string' ? rgb2arr(highlightColor) : highlightColor || [1, 0, 0, 1];
|
|
81
74
|
layer.updateLayerConfig({
|
|
82
75
|
pickedFeatureID: decodePickingColor(new Uint8Array(pickedColor))
|
|
@@ -94,10 +87,9 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
94
87
|
});
|
|
95
88
|
layer.hooks.beforeSelect.tap('PixelPickingPlugin', function (pickedColor) {
|
|
96
89
|
var _layer$getLayerConfig6 = layer.getLayerConfig(),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
selectColor = _layer$getLayerConfig6.selectColor,
|
|
91
|
+
_layer$getLayerConfig7 = _layer$getLayerConfig6.selectMix,
|
|
92
|
+
selectMix = _layer$getLayerConfig7 === void 0 ? 0 : _layer$getLayerConfig7;
|
|
101
93
|
var highlightColorInArray = typeof selectColor === 'string' ? rgb2arr(selectColor) : selectColor || [1, 0, 0, 1];
|
|
102
94
|
layer.updateLayerConfig({
|
|
103
95
|
pickedFeatureID: decodePickingColor(new Uint8Array(pickedColor))
|
|
@@ -120,7 +112,6 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
120
112
|
});
|
|
121
113
|
}
|
|
122
114
|
}]);
|
|
123
|
-
|
|
124
115
|
return PixelPickingPlugin;
|
|
125
116
|
}()) || _class);
|
|
126
117
|
export { PixelPickingPlugin as default };
|
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
|
|
4
3
|
var _dec, _class;
|
|
5
|
-
|
|
6
4
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
7
5
|
import { injectable } from 'inversify';
|
|
8
6
|
import 'reflect-metadata';
|
|
9
7
|
import { isTileGroup } from "../tile/utils";
|
|
8
|
+
|
|
10
9
|
/**
|
|
11
10
|
* 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
|
|
12
11
|
*/
|
|
13
|
-
|
|
14
12
|
var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
|
|
15
13
|
function RegisterStyleAttributePlugin() {
|
|
16
14
|
_classCallCheck(this, RegisterStyleAttributePlugin);
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
_createClass(RegisterStyleAttributePlugin, [{
|
|
20
17
|
key: "apply",
|
|
21
18
|
value: function apply(layer, _ref) {
|
|
22
19
|
var _this = this;
|
|
23
|
-
|
|
24
20
|
var styleAttributeService = _ref.styleAttributeService;
|
|
25
21
|
layer.hooks.init.tapPromise('RegisterStyleAttributePlugin', function () {
|
|
26
22
|
// 过滤 tileGroup layer (瓦片图层不需要注册)
|
|
27
23
|
if (isTileGroup(layer)) {
|
|
28
24
|
return;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
_this.registerBuiltinAttributes(styleAttributeService, layer);
|
|
32
27
|
});
|
|
33
28
|
}
|
|
@@ -38,11 +33,10 @@ var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE
|
|
|
38
33
|
if (layer.type === 'MaskLayer') {
|
|
39
34
|
this.registerPositionAttribute(styleAttributeService);
|
|
40
35
|
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
}
|
|
37
|
+
// Tip: normal render layer
|
|
38
|
+
this.registerPositionAttribute(styleAttributeService);
|
|
39
|
+
// this.registerFilterAttribute(styleAttributeService);//数据层数据过滤
|
|
46
40
|
this.registerColorAttribute(styleAttributeService);
|
|
47
41
|
this.registerVertexIdAttribute(styleAttributeService);
|
|
48
42
|
}
|
|
@@ -132,7 +126,6 @@ var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE
|
|
|
132
126
|
});
|
|
133
127
|
}
|
|
134
128
|
}]);
|
|
135
|
-
|
|
136
129
|
return RegisterStyleAttributePlugin;
|
|
137
130
|
}()) || _class);
|
|
138
131
|
export { RegisterStyleAttributePlugin as default };
|