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