@antv/l7-layers 2.20.20 → 2.21.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/canvas/index.d.ts +13 -8
- package/es/canvas/index.js +63 -36
- package/es/canvas/models/canvas.d.ts +19 -14
- package/es/canvas/models/canvas.js +125 -139
- package/es/canvas/models/constants.d.ts +2 -0
- package/es/canvas/models/constants.js +6 -0
- package/es/canvas/models/index.d.ts +2 -5
- package/es/canvas/models/index.js +2 -5
- package/es/core/BaseLayer.d.ts +18 -19
- package/es/core/BaseLayer.js +134 -101
- package/es/core/BaseModel.js +15 -31
- package/es/core/LayerPickService.js +4 -6
- package/es/core/TextureService.js +1 -2
- package/es/core/interface.d.ts +31 -4
- package/es/core/shape/Path.js +1 -2
- package/es/core/shape/arrow.js +2 -6
- package/es/core/shape/extrude.js +0 -1
- package/es/core/triangulation.js +2 -2
- package/es/earth/models/base.js +0 -1
- package/es/heatmap/index.js +0 -1
- package/es/heatmap/models/heatmap.d.ts +0 -1
- package/es/heatmap/models/heatmap.js +2 -5
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -89
- package/es/line/models/arc.js +5 -5
- package/es/line/models/arc_3d.js +4 -4
- package/es/line/models/great_circle.js +4 -4
- package/es/line/models/line.js +8 -12
- package/es/line/models/simple_line.js +1 -2
- package/es/line/models/wall.js +5 -4
- package/es/line/shaders/line/line_vert.glsl +0 -2
- package/es/line/shaders/wall/wall_vert.glsl +15 -0
- package/es/plugins/DataMappingPlugin.d.ts +4 -7
- package/es/plugins/DataMappingPlugin.js +8 -25
- package/es/plugins/DataSourcePlugin.d.ts +0 -1
- package/es/plugins/DataSourcePlugin.js +4 -7
- package/es/plugins/FeatureScalePlugin.d.ts +2 -5
- package/es/plugins/FeatureScalePlugin.js +5 -7
- package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -1
- package/es/plugins/LayerAnimateStylePlugin.js +2 -5
- package/es/plugins/LayerMaskPlugin.d.ts +0 -1
- package/es/plugins/LayerMaskPlugin.js +2 -8
- package/es/plugins/LayerModelPlugin.d.ts +0 -1
- package/es/plugins/LayerModelPlugin.js +13 -18
- package/es/plugins/LayerStylePlugin.d.ts +0 -1
- package/es/plugins/LayerStylePlugin.js +2 -5
- package/es/plugins/LightingPlugin.d.ts +0 -1
- package/es/plugins/LightingPlugin.js +2 -5
- package/es/plugins/MultiPassRendererPlugin.d.ts +0 -1
- package/es/plugins/MultiPassRendererPlugin.js +2 -5
- package/es/plugins/PixelPickingPlugin.d.ts +2 -6
- package/es/plugins/PixelPickingPlugin.js +6 -12
- package/es/plugins/RegisterStyleAttributePlugin.d.ts +2 -5
- package/es/plugins/RegisterStyleAttributePlugin.js +2 -5
- package/es/plugins/ShaderUniformPlugin.d.ts +7 -8
- package/es/plugins/ShaderUniformPlugin.js +17 -43
- package/es/plugins/UpdateModelPlugin.d.ts +0 -1
- package/es/plugins/UpdateModelPlugin.js +2 -5
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +2 -5
- package/es/plugins/UpdateStyleAttributePlugin.js +2 -6
- package/es/plugins/index.d.ts +15 -0
- package/es/plugins/index.js +18 -0
- package/es/point/models/fill.d.ts +1 -1
- package/es/point/models/fill.js +7 -10
- package/es/point/models/fillImage.js +4 -3
- package/es/point/models/image.js +4 -3
- package/es/polygon/models/extrude.js +0 -1
- package/es/polygon/models/fill.js +2 -3
- package/es/polygon/models/index.js +0 -1
- package/es/polygon/models/ocean.js +1 -2
- package/es/polygon/models/water.js +0 -2
- package/es/tile/core/BaseLayer.js +4 -5
- package/es/tile/interaction/getRasterData.js +0 -3
- package/es/tile/service/TileLayerService.d.ts +0 -1
- package/es/tile/service/TileLayerService.js +0 -1
- package/es/tile/service/TilePickService.d.ts +1 -1
- package/es/tile/service/TilePickService.js +2 -3
- package/es/tile/tile/Tile.js +8 -6
- package/es/utils/blend.js +7 -8
- package/es/utils/polylineNormal.js +0 -1
- package/es/utils/rampcolor_legend.js +1 -2
- package/es/wind/index.js +0 -1
- package/lib/canvas/index.js +63 -37
- package/lib/canvas/models/canvas.js +125 -138
- package/lib/canvas/models/constants.js +12 -0
- package/lib/canvas/models/index.js +22 -7
- package/lib/core/BaseLayer.js +134 -101
- package/lib/core/BaseModel.js +14 -30
- package/lib/core/LayerPickService.js +4 -6
- package/lib/core/TextureService.js +1 -2
- package/lib/core/shape/Path.js +1 -2
- package/lib/core/shape/arrow.js +2 -6
- package/lib/core/shape/extrude.js +0 -1
- package/lib/core/triangulation.js +2 -2
- package/lib/earth/models/base.js +0 -1
- package/lib/heatmap/index.js +0 -1
- package/lib/heatmap/models/heatmap.js +2 -5
- package/lib/index.js +9 -90
- package/lib/line/models/arc.js +4 -4
- package/lib/line/models/arc_3d.js +4 -4
- package/lib/line/models/great_circle.js +4 -4
- package/lib/line/models/line.js +10 -12
- package/lib/line/models/simple_line.js +0 -1
- package/lib/line/models/wall.js +5 -4
- package/lib/line/shaders/line/line_vert.glsl +0 -2
- package/lib/line/shaders/wall/wall_vert.glsl +15 -0
- package/lib/plugins/DataMappingPlugin.js +7 -24
- package/lib/plugins/DataSourcePlugin.js +3 -6
- package/lib/plugins/FeatureScalePlugin.js +5 -7
- package/lib/plugins/LayerAnimateStylePlugin.js +2 -5
- package/lib/plugins/LayerMaskPlugin.js +2 -8
- package/lib/plugins/LayerModelPlugin.js +13 -18
- package/lib/plugins/LayerStylePlugin.js +2 -5
- package/lib/plugins/LightingPlugin.js +2 -5
- package/lib/plugins/MultiPassRendererPlugin.js +2 -5
- package/lib/plugins/PixelPickingPlugin.js +6 -12
- package/lib/plugins/RegisterStyleAttributePlugin.js +2 -5
- package/lib/plugins/ShaderUniformPlugin.js +16 -42
- package/lib/plugins/UpdateModelPlugin.js +2 -5
- package/lib/plugins/UpdateStyleAttributePlugin.js +2 -5
- package/lib/plugins/index.js +26 -0
- package/lib/point/models/fill.js +10 -13
- package/lib/point/models/fillImage.js +4 -3
- package/lib/point/models/image.js +4 -3
- package/lib/polygon/models/extrude.js +0 -1
- package/lib/polygon/models/fill.js +1 -2
- package/lib/polygon/models/ocean.js +0 -1
- package/lib/polygon/models/water.js +0 -2
- package/lib/tile/core/BaseLayer.js +4 -5
- package/lib/tile/interaction/getRasterData.js +0 -3
- package/lib/tile/service/TileLayerService.js +0 -1
- package/lib/tile/service/TilePickService.js +2 -3
- package/lib/tile/tile/Tile.js +8 -6
- package/lib/utils/blend.js +7 -8
- package/lib/utils/polylineNormal.js +0 -1
- package/lib/utils/rampcolor_legend.js +1 -2
- package/lib/wind/index.js +0 -1
- package/package.json +18 -20
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import _initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
4
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor";
|
|
8
|
-
import _initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWarningHelper";
|
|
9
|
-
var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
|
|
10
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
-
import { IDebugLog, ILayerStage
|
|
6
|
+
import { IDebugLog, ILayerStage } from '@antv/l7-core';
|
|
12
7
|
import { lodashUtil, normalize, rgb2arr } from '@antv/l7-utils';
|
|
13
|
-
import { inject, injectable } from 'inversify';
|
|
14
|
-
import 'reflect-metadata';
|
|
15
8
|
var cloneDeep = lodashUtil.cloneDeep;
|
|
16
|
-
var DataMappingPlugin =
|
|
9
|
+
var DataMappingPlugin = /*#__PURE__*/function () {
|
|
17
10
|
function DataMappingPlugin() {
|
|
18
11
|
_classCallCheck(this, DataMappingPlugin);
|
|
19
|
-
_initializerDefineProperty(this, "mapService", _descriptor, this);
|
|
20
|
-
_initializerDefineProperty(this, "fontService", _descriptor2, this);
|
|
21
12
|
}
|
|
22
13
|
_createClass(DataMappingPlugin, [{
|
|
23
14
|
key: "apply",
|
|
24
15
|
value: function apply(layer, _ref) {
|
|
25
16
|
var _this = this;
|
|
26
|
-
var styleAttributeService = _ref.styleAttributeService
|
|
17
|
+
var styleAttributeService = _ref.styleAttributeService,
|
|
18
|
+
mapService = _ref.mapService,
|
|
19
|
+
fontService = _ref.fontService;
|
|
20
|
+
this.mapService = mapService;
|
|
21
|
+
this.fontService = fontService;
|
|
27
22
|
layer.hooks.init.tapPromise('DataMappingPlugin', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
28
23
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
29
24
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -87,7 +82,6 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
|
|
|
87
82
|
return attribute.needRemapping;
|
|
88
83
|
} // 如果filter变化
|
|
89
84
|
);
|
|
90
|
-
|
|
91
85
|
var filterData = dataArray;
|
|
92
86
|
// 数据过滤完 再执行数据映射
|
|
93
87
|
if (filter !== null && filter !== void 0 && filter.needRemapping && filter !== null && filter !== void 0 && filter.scale) {
|
|
@@ -99,7 +93,6 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
|
|
|
99
93
|
// 过滤数据
|
|
100
94
|
var encodeData = _this.mapping(layer, attributesToRemapping, filterData, layer.getEncodedData() // TODO 优化
|
|
101
95
|
);
|
|
102
|
-
|
|
103
96
|
layer.setEncodedData(encodeData);
|
|
104
97
|
}
|
|
105
98
|
|
|
@@ -276,15 +269,5 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
|
|
|
276
269
|
}
|
|
277
270
|
}]);
|
|
278
271
|
return DataMappingPlugin;
|
|
279
|
-
}()
|
|
280
|
-
configurable: true,
|
|
281
|
-
enumerable: true,
|
|
282
|
-
writable: true,
|
|
283
|
-
initializer: null
|
|
284
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "fontService", [_dec3], {
|
|
285
|
-
configurable: true,
|
|
286
|
-
enumerable: true,
|
|
287
|
-
writable: true,
|
|
288
|
-
initializer: null
|
|
289
|
-
})), _class2)) || _class);
|
|
272
|
+
}();
|
|
290
273
|
export { DataMappingPlugin as default };
|
|
@@ -1,13 +1,10 @@
|
|
|
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
|
-
var _dec, _class;
|
|
5
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
-
import { IDebugLog, ILayerStage
|
|
5
|
+
import { IDebugLog, ILayerStage } from '@antv/l7-core';
|
|
7
6
|
import Source from '@antv/l7-source';
|
|
8
|
-
|
|
9
|
-
import 'reflect-metadata';
|
|
10
|
-
var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
|
|
7
|
+
var DataSourcePlugin = /*#__PURE__*/function () {
|
|
11
8
|
function DataSourcePlugin() {
|
|
12
9
|
_classCallCheck(this, DataSourcePlugin);
|
|
13
10
|
}
|
|
@@ -15,7 +12,7 @@ var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
15
12
|
key: "apply",
|
|
16
13
|
value: function apply(layer) {
|
|
17
14
|
var _this = this;
|
|
18
|
-
this.mapService = layer.getContainer().
|
|
15
|
+
this.mapService = layer.getContainer().mapService;
|
|
19
16
|
layer.hooks.init.tapPromise('DataSourcePlugin', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
20
17
|
var source, _ref2, data, options;
|
|
21
18
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -102,5 +99,5 @@ var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
102
99
|
}
|
|
103
100
|
}]);
|
|
104
101
|
return DataSourcePlugin;
|
|
105
|
-
}()
|
|
102
|
+
}();
|
|
106
103
|
export { DataSourcePlugin as default };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type { ILayer, ILayerPlugin,
|
|
2
|
-
import 'reflect-metadata';
|
|
1
|
+
import type { ILayer, ILayerPlugin, L7Container } from '@antv/l7-core';
|
|
3
2
|
/**
|
|
4
3
|
* 根据 Source 原始数据为指定字段创建 Scale,保存在 StyleAttribute 上,供下游插件使用
|
|
5
4
|
*/
|
|
6
5
|
export default class FeatureScalePlugin implements ILayerPlugin {
|
|
7
6
|
private scaleOptions;
|
|
8
|
-
apply(layer: ILayer, { styleAttributeService
|
|
9
|
-
styleAttributeService: IStyleAttributeService;
|
|
10
|
-
}): void;
|
|
7
|
+
apply(layer: ILayer, { styleAttributeService }: L7Container): void;
|
|
11
8
|
private isNumber;
|
|
12
9
|
private caculateScalesForAttributes;
|
|
13
10
|
/**
|
|
@@ -3,25 +3,23 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
-
var _scaleMap
|
|
6
|
+
var _scaleMap;
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
import { IDebugLog, ILayerStage, ScaleTypes, StyleScaleType } from '@antv/l7-core';
|
|
9
9
|
import { lodashUtil } from '@antv/l7-utils';
|
|
10
10
|
import { extent } from 'd3-array';
|
|
11
11
|
import * as d3interpolate from 'd3-interpolate';
|
|
12
12
|
import * as d3 from 'd3-scale';
|
|
13
|
-
import { injectable } from 'inversify';
|
|
14
|
-
import 'reflect-metadata';
|
|
15
13
|
import identity from "../utils/identityScale";
|
|
16
14
|
var isNil = lodashUtil.isNil,
|
|
17
15
|
isString = lodashUtil.isString,
|
|
18
16
|
uniq = lodashUtil.uniq;
|
|
19
17
|
var dateRegex = /^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;
|
|
20
|
-
var scaleMap = (_scaleMap = {}, _defineProperty(_scaleMap, ScaleTypes.LINEAR, d3.scaleLinear),
|
|
18
|
+
var scaleMap = (_scaleMap = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_scaleMap, ScaleTypes.LINEAR, d3.scaleLinear), ScaleTypes.POWER, d3.scalePow), ScaleTypes.LOG, d3.scaleLog), ScaleTypes.IDENTITY, identity), ScaleTypes.SEQUENTIAL, d3.scaleSequential), ScaleTypes.TIME, d3.scaleTime), ScaleTypes.QUANTILE, d3.scaleQuantile), ScaleTypes.QUANTIZE, d3.scaleQuantize), ScaleTypes.THRESHOLD, d3.scaleThreshold), ScaleTypes.CAT, d3.scaleOrdinal), _defineProperty(_scaleMap, ScaleTypes.DIVERGING, d3.scaleDiverging));
|
|
21
19
|
/**
|
|
22
20
|
* 根据 Source 原始数据为指定字段创建 Scale,保存在 StyleAttribute 上,供下游插件使用
|
|
23
21
|
*/
|
|
24
|
-
var FeatureScalePlugin =
|
|
22
|
+
var FeatureScalePlugin = /*#__PURE__*/function () {
|
|
25
23
|
function FeatureScalePlugin() {
|
|
26
24
|
_classCallCheck(this, FeatureScalePlugin);
|
|
27
25
|
_defineProperty(this, "scaleOptions", {});
|
|
@@ -280,7 +278,7 @@ var FeatureScalePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
280
278
|
// quantile domain 需要根据ID 进行去重
|
|
281
279
|
var values = [];
|
|
282
280
|
if (type === ScaleTypes.QUANTILE) {
|
|
283
|
-
// 根据 obejct 属性 _id 进行去重
|
|
281
|
+
// 根据 obejct 属性 _id 进行去重
|
|
284
282
|
var idMap = new Map();
|
|
285
283
|
data === null || data === void 0 || data.forEach(function (obj) {
|
|
286
284
|
idMap.set(obj._id, obj[field]);
|
|
@@ -336,5 +334,5 @@ var FeatureScalePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
336
334
|
}
|
|
337
335
|
}]);
|
|
338
336
|
return FeatureScalePlugin;
|
|
339
|
-
}()
|
|
337
|
+
}();
|
|
340
338
|
export { FeatureScalePlugin as default };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
var
|
|
5
|
-
import { injectable } from 'inversify';
|
|
6
|
-
import 'reflect-metadata';
|
|
7
|
-
var LayerAnimateStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
|
|
4
|
+
var LayerAnimateStylePlugin = /*#__PURE__*/function () {
|
|
8
5
|
function LayerAnimateStylePlugin() {
|
|
9
6
|
_classCallCheck(this, LayerAnimateStylePlugin);
|
|
10
7
|
}
|
|
@@ -23,5 +20,5 @@ var LayerAnimateStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/f
|
|
|
23
20
|
}
|
|
24
21
|
}]);
|
|
25
22
|
return LayerAnimateStylePlugin;
|
|
26
|
-
}()
|
|
23
|
+
}();
|
|
27
24
|
export { LayerAnimateStylePlugin as default };
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
var _dec, _class;
|
|
5
|
-
import { injectable } from 'inversify';
|
|
6
|
-
import 'reflect-metadata';
|
|
7
3
|
/**
|
|
8
4
|
* 更新图层样式,初始图层相关配置
|
|
9
5
|
*/
|
|
10
|
-
var LayerStylePlugin =
|
|
6
|
+
var LayerStylePlugin = /*#__PURE__*/function () {
|
|
11
7
|
function LayerStylePlugin() {
|
|
12
8
|
_classCallCheck(this, LayerStylePlugin);
|
|
13
9
|
}
|
|
@@ -20,8 +16,6 @@ var LayerStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
20
16
|
enableMask = _layer$getLayerConfig.enableMask;
|
|
21
17
|
// mask 初始化
|
|
22
18
|
if (!layer.tileLayer && maskLayers && maskLayers.length > 0) {
|
|
23
|
-
var _layer$masks;
|
|
24
|
-
(_layer$masks = layer.masks).push.apply(_layer$masks, _toConsumableArray(maskLayers));
|
|
25
19
|
layer.updateLayerConfig({
|
|
26
20
|
mask: true && enableMask
|
|
27
21
|
});
|
|
@@ -30,5 +24,5 @@ var LayerStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
30
24
|
}
|
|
31
25
|
}]);
|
|
32
26
|
return LayerStylePlugin;
|
|
33
|
-
}()
|
|
27
|
+
}();
|
|
34
28
|
export { LayerStylePlugin as default };
|
|
@@ -1,16 +1,13 @@
|
|
|
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
|
-
var _dec, _class;
|
|
5
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
5
|
import { IDebugLog, ILayerStage } from '@antv/l7-core';
|
|
7
|
-
import
|
|
8
|
-
import 'reflect-metadata';
|
|
9
|
-
import TileLayer from "../tile/core/BaseLayer";
|
|
6
|
+
// import TileLayer from '../tile/core/BaseLayer';
|
|
10
7
|
/**
|
|
11
8
|
* Layer Model 初始化,更新,销毁
|
|
12
9
|
*/
|
|
13
|
-
var LayerModelPlugin =
|
|
10
|
+
var LayerModelPlugin = /*#__PURE__*/function () {
|
|
14
11
|
function LayerModelPlugin() {
|
|
15
12
|
_classCallCheck(this, LayerModelPlugin);
|
|
16
13
|
}
|
|
@@ -90,19 +87,18 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
90
87
|
while (1) switch (_context4.prev = _context4.next) {
|
|
91
88
|
case 0:
|
|
92
89
|
if (!layer.getSource().isTile) {
|
|
93
|
-
_context4.next =
|
|
90
|
+
_context4.next = 3;
|
|
94
91
|
break;
|
|
95
92
|
}
|
|
96
93
|
layer.prepareBuildModel();
|
|
97
|
-
layer.tileLayer = new TileLayer(layer);
|
|
98
94
|
return _context4.abrupt("return");
|
|
99
|
-
case
|
|
95
|
+
case 3:
|
|
100
96
|
layer.log(IDebugLog.BuildModelStart, ILayerStage.INIT);
|
|
101
|
-
_context4.next =
|
|
97
|
+
_context4.next = 6;
|
|
102
98
|
return _this.initLayerModel(layer);
|
|
103
|
-
case
|
|
99
|
+
case 6:
|
|
104
100
|
layer.log(IDebugLog.BuildModelEnd, ILayerStage.INIT);
|
|
105
|
-
case
|
|
101
|
+
case 7:
|
|
106
102
|
case "end":
|
|
107
103
|
return _context4.stop();
|
|
108
104
|
}
|
|
@@ -120,19 +116,18 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
120
116
|
return _context5.abrupt("return", false);
|
|
121
117
|
case 2:
|
|
122
118
|
if (!layer.getSource().isTile) {
|
|
123
|
-
_context5.next =
|
|
119
|
+
_context5.next = 4;
|
|
124
120
|
break;
|
|
125
121
|
}
|
|
126
|
-
layer.tileLayer = new TileLayer(layer);
|
|
127
122
|
return _context5.abrupt("return", false);
|
|
128
|
-
case
|
|
123
|
+
case 4:
|
|
129
124
|
layer.log(IDebugLog.BuildModelStart, ILayerStage.UPDATE);
|
|
130
|
-
_context5.next =
|
|
125
|
+
_context5.next = 7;
|
|
131
126
|
return _this.prepareLayerModel(layer);
|
|
132
|
-
case
|
|
127
|
+
case 7:
|
|
133
128
|
layer.log(IDebugLog.BuildModelEnd, ILayerStage.UPDATE);
|
|
134
129
|
return _context5.abrupt("return", true);
|
|
135
|
-
case
|
|
130
|
+
case 9:
|
|
136
131
|
case "end":
|
|
137
132
|
return _context5.stop();
|
|
138
133
|
}
|
|
@@ -145,5 +140,5 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
145
140
|
}
|
|
146
141
|
}]);
|
|
147
142
|
return LayerModelPlugin;
|
|
148
|
-
}()
|
|
143
|
+
}();
|
|
149
144
|
export { LayerModelPlugin as default };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
var _dec, _class;
|
|
4
|
-
import { injectable } from 'inversify';
|
|
5
|
-
import 'reflect-metadata';
|
|
6
3
|
/**
|
|
7
4
|
* 更新图层样式,初始图层相关配置
|
|
8
5
|
*/
|
|
9
|
-
var LayerStylePlugin =
|
|
6
|
+
var LayerStylePlugin = /*#__PURE__*/function () {
|
|
10
7
|
function LayerStylePlugin() {
|
|
11
8
|
_classCallCheck(this, LayerStylePlugin);
|
|
12
9
|
}
|
|
@@ -26,5 +23,5 @@ var LayerStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
|
|
|
26
23
|
}
|
|
27
24
|
}]);
|
|
28
25
|
return LayerStylePlugin;
|
|
29
|
-
}()
|
|
26
|
+
}();
|
|
30
27
|
export { LayerStylePlugin as default };
|
|
@@ -2,10 +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
|
-
var _dec, _class;
|
|
6
5
|
var _excluded = ["type"];
|
|
7
|
-
import { injectable } from 'inversify';
|
|
8
|
-
import 'reflect-metadata';
|
|
9
6
|
var lightTypeUniformMap = {
|
|
10
7
|
directional: {
|
|
11
8
|
lights: 'u_DirectionalLights',
|
|
@@ -72,7 +69,7 @@ export function generateLightingUniforms(lights) {
|
|
|
72
69
|
/**
|
|
73
70
|
* 光照 & Shadow
|
|
74
71
|
*/
|
|
75
|
-
var LightingPlugin =
|
|
72
|
+
var LightingPlugin = /*#__PURE__*/function () {
|
|
76
73
|
function LightingPlugin() {
|
|
77
74
|
_classCallCheck(this, LightingPlugin);
|
|
78
75
|
}
|
|
@@ -94,5 +91,5 @@ var LightingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function (
|
|
|
94
91
|
}
|
|
95
92
|
}]);
|
|
96
93
|
return LightingPlugin;
|
|
97
|
-
}()
|
|
94
|
+
}();
|
|
98
95
|
export { LightingPlugin as default };
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
var _dec, _class;
|
|
4
|
-
import { injectable } from 'inversify';
|
|
5
|
-
import 'reflect-metadata';
|
|
6
3
|
import { createMultiPassRenderer } from "../utils/multiPassRender";
|
|
7
4
|
|
|
8
5
|
/**
|
|
@@ -18,7 +15,7 @@ import { createMultiPassRenderer } from "../utils/multiPassRender";
|
|
|
18
15
|
* ],
|
|
19
16
|
* })
|
|
20
17
|
*/
|
|
21
|
-
var MultiPassRendererPlugin =
|
|
18
|
+
var MultiPassRendererPlugin = /*#__PURE__*/function () {
|
|
22
19
|
function MultiPassRendererPlugin() {
|
|
23
20
|
_classCallCheck(this, MultiPassRendererPlugin);
|
|
24
21
|
}
|
|
@@ -56,5 +53,5 @@ var MultiPassRendererPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/f
|
|
|
56
53
|
}
|
|
57
54
|
}]);
|
|
58
55
|
return MultiPassRendererPlugin;
|
|
59
|
-
}()
|
|
56
|
+
}();
|
|
60
57
|
export { MultiPassRendererPlugin as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ILayer, ILayerPlugin,
|
|
2
|
-
import 'reflect-metadata';
|
|
1
|
+
import type { ILayer, ILayerPlugin, L7Container } from '@antv/l7-core';
|
|
3
2
|
export default class PixelPickingPlugin implements ILayerPlugin {
|
|
4
3
|
/**
|
|
5
4
|
* Use map to keep order of insertion.
|
|
@@ -8,8 +7,5 @@ export default class PixelPickingPlugin implements ILayerPlugin {
|
|
|
8
7
|
private pickingUniformMap;
|
|
9
8
|
private pickOption2Array;
|
|
10
9
|
private updatePickOption;
|
|
11
|
-
apply(layer: ILayer, {
|
|
12
|
-
rendererService: IRendererService;
|
|
13
|
-
styleAttributeService: IStyleAttributeService;
|
|
14
|
-
}): void;
|
|
10
|
+
apply(layer: ILayer, { styleAttributeService }: L7Container): void;
|
|
15
11
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
var _dec, _class;
|
|
5
4
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
6
5
|
import { decodePickingColor, encodePickingColor, lodashUtil, rgb2arr } from '@antv/l7-utils';
|
|
7
|
-
import { injectable } from 'inversify';
|
|
8
|
-
import 'reflect-metadata';
|
|
9
6
|
import { ShaderLocation } from "../core/CommonStyleAttribute";
|
|
10
7
|
var isNumber = lodashUtil.isNumber;
|
|
11
8
|
var PickingStage = {
|
|
@@ -13,7 +10,7 @@ var PickingStage = {
|
|
|
13
10
|
ENCODE: 1.0,
|
|
14
11
|
HIGHLIGHT: 2.0
|
|
15
12
|
};
|
|
16
|
-
var PixelPickingPlugin =
|
|
13
|
+
var PixelPickingPlugin = /*#__PURE__*/function () {
|
|
17
14
|
function PixelPickingPlugin() {
|
|
18
15
|
_classCallCheck(this, PixelPickingPlugin);
|
|
19
16
|
}
|
|
@@ -27,7 +24,7 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
27
24
|
|
|
28
25
|
function pickOption2Array() {
|
|
29
26
|
var array = [];
|
|
30
|
-
this.pickingUniformMap.forEach(function (value
|
|
27
|
+
this.pickingUniformMap.forEach(function (value) {
|
|
31
28
|
if (isNumber(value)) {
|
|
32
29
|
array.push(value);
|
|
33
30
|
} else {
|
|
@@ -58,10 +55,8 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
58
55
|
key: "apply",
|
|
59
56
|
value: function apply(layer, _ref) {
|
|
60
57
|
var _this2 = this;
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
var uniformBuffer;
|
|
64
|
-
this.pickingUniformMap = new Map([['u_HighlightColor', [1, 0, 0, 1]], ['u_SelectColor', [1, 0, 0, 1]], ['u_PickingColor', [0, 0, 0]], ['u_PickingStage', 0], ['u_CurrentSelectedId', [0, 0, 0]], ['u_PickingThreshold', 10], ['u_PickingBuffer', 0], ['u_shaderPick', 0], ['u_EnableSelect', 0], ['u_activeMix', 0]]);
|
|
58
|
+
var styleAttributeService = _ref.styleAttributeService;
|
|
59
|
+
this.pickingUniformMap = new Map([['u_HighlightColor', [1, 0, 0, 1]], ['u_SelectColor', [1, 0, 0, 1]], ['u_PickingColor', [0, 0, 0]], ['u_PickingStage', 0], ['u_CurrentSelectedId', [0, 0, 0]], ['u_PickingThreshold', 10], ['u_PickingBuffer', 0], ['u_shaderPick', 0], ['u_activeMix', 0]]);
|
|
65
60
|
|
|
66
61
|
// TODO: 由于 Shader 目前无法根据是否开启拾取进行内容修改,因此即使不开启也需要生成 a_PickingColor
|
|
67
62
|
layer.hooks.init.tapPromise('PixelPickingPlugin', function () {
|
|
@@ -158,8 +153,7 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
158
153
|
u_CurrentSelectedId: pickedColor,
|
|
159
154
|
u_SelectColor: highlightColorInArray.map(function (c) {
|
|
160
155
|
return c * 255;
|
|
161
|
-
})
|
|
162
|
-
u_EnableSelect: 1
|
|
156
|
+
})
|
|
163
157
|
};
|
|
164
158
|
_this2.updatePickOption(option, layer);
|
|
165
159
|
layer.models.forEach(function (model) {
|
|
@@ -169,5 +163,5 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
|
|
|
169
163
|
}
|
|
170
164
|
}]);
|
|
171
165
|
return PixelPickingPlugin;
|
|
172
|
-
}()
|
|
166
|
+
}();
|
|
173
167
|
export { PixelPickingPlugin as default };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type { ILayer, ILayerPlugin,
|
|
2
|
-
import 'reflect-metadata';
|
|
1
|
+
import type { ILayer, ILayerPlugin, L7Container } from '@antv/l7-core';
|
|
3
2
|
/**
|
|
4
3
|
* 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
|
|
5
4
|
*/
|
|
6
5
|
export default class RegisterStyleAttributePlugin implements ILayerPlugin {
|
|
7
|
-
apply(layer: ILayer, { styleAttributeService
|
|
8
|
-
styleAttributeService: IStyleAttributeService;
|
|
9
|
-
}): void;
|
|
6
|
+
apply(layer: ILayer, { styleAttributeService }: L7Container): void;
|
|
10
7
|
private registerBuiltinAttributes;
|
|
11
8
|
private registerPositionAttribute;
|
|
12
9
|
private registerColorAttribute;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
var _dec, _class;
|
|
4
3
|
import { AttributeType, gl } from '@antv/l7-core';
|
|
5
|
-
import { injectable } from 'inversify';
|
|
6
|
-
import 'reflect-metadata';
|
|
7
4
|
import { ShaderLocation } from "../core/CommonStyleAttribute";
|
|
8
5
|
import { isTileGroup } from "../tile/utils/utils";
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
|
|
12
9
|
*/
|
|
13
|
-
var RegisterStyleAttributePlugin =
|
|
10
|
+
var RegisterStyleAttributePlugin = /*#__PURE__*/function () {
|
|
14
11
|
function RegisterStyleAttributePlugin() {
|
|
15
12
|
_classCallCheck(this, RegisterStyleAttributePlugin);
|
|
16
13
|
}
|
|
@@ -109,5 +106,5 @@ var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE
|
|
|
109
106
|
}
|
|
110
107
|
}]);
|
|
111
108
|
return RegisterStyleAttributePlugin;
|
|
112
|
-
}()
|
|
109
|
+
}();
|
|
113
110
|
export { RegisterStyleAttributePlugin as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ILayer, ILayerPlugin } from '@antv/l7-core';
|
|
2
|
-
import 'reflect-metadata';
|
|
1
|
+
import type { ILayer, ILayerPlugin, L7Container } from '@antv/l7-core';
|
|
3
2
|
/**
|
|
4
3
|
* 在渲染之前需要获取当前 Shader 所需 Uniform,例如:
|
|
5
4
|
* 1. 从相机服务中获取 View & ProjectionMatrix,当前缩放等级等等
|
|
@@ -8,12 +7,12 @@ import 'reflect-metadata';
|
|
|
8
7
|
* 3. 当前 Layer 本身的样式属性
|
|
9
8
|
*/
|
|
10
9
|
export default class ShaderUniformPlugin implements ILayerPlugin {
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
apply(layer: ILayer): void;
|
|
10
|
+
private cameraService;
|
|
11
|
+
private coordinateSystemService;
|
|
12
|
+
private rendererService;
|
|
13
|
+
private mapService;
|
|
14
|
+
private layerService;
|
|
15
|
+
apply(layer: ILayer, { rendererService, mapService, layerService, coordinateSystemService, cameraService, }: L7Container): void;
|
|
17
16
|
/**
|
|
18
17
|
* 对于每个 layer 都有不同的几何中心点,因此在绘制每个 layer 的时候都需要重新设置
|
|
19
18
|
* @param layer
|