@antv/l7-layers 2.9.23 → 2.9.25
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/models/plane.d.ts +1 -0
- package/es/citybuliding/building.js +1 -1
- package/es/core/BaseLayer.js +10 -3
- package/es/core/interface.d.ts +26 -48
- package/es/core/interface.js +3 -0
- package/es/core/schema.d.ts +3 -3
- package/es/core/triangulation.d.ts +4 -3
- package/es/core/triangulation.js +54 -39
- package/es/heatmap/models/heatmap.js +1 -1
- package/es/image/models/image.js +7 -1
- package/es/line/index.js +4 -1
- package/es/line/models/arc.js +1 -1
- package/es/line/models/simpleLine.js +1 -1
- package/es/line/shaders/line_arc_vert.glsl +5 -3
- package/es/line/shaders/simple/simpleline_vert.glsl +1 -0
- package/es/plugins/FeatureScalePlugin.js +0 -1
- package/es/point/index.js +3 -1
- package/es/point/models/fill.js +5 -2
- package/es/point/models/fillmage.js +9 -3
- package/es/point/models/image.js +8 -2
- package/es/point/models/radar.js +2 -3
- package/es/point/models/tile.js +1 -1
- package/es/point/shaders/fill_vert.glsl +13 -6
- package/es/point/shaders/image/fillImage_vert.glsl +13 -5
- package/es/point/shaders/image_vert.glsl +17 -8
- package/es/polygon/index.js +4 -1
- package/es/raster/index.js +3 -1
- package/es/tile/manager/tileLayerManager.d.ts +3 -2
- package/es/tile/manager/tileLayerManager.js +5 -2
- package/es/tile/models/tileModel.js +4 -3
- package/es/tile/tileFactory/base.d.ts +1 -1
- package/es/tile/tileFactory/base.js +32 -5
- package/es/tile/tileFactory/vectorLayer.d.ts +3 -1
- package/es/tile/tileFactory/vectorLayer.js +22 -1
- package/es/tile/tileLayer/baseTileLayer.d.ts +1 -1
- package/es/tile/tileLayer/baseTileLayer.js +3 -2
- package/es/tile/utils.d.ts +2 -0
- package/es/tile/utils.js +5 -1
- package/lib/Geometry/index.js +114 -77
- package/lib/Geometry/models/billboard.js +232 -181
- package/lib/Geometry/models/index.js +18 -34
- package/lib/Geometry/models/plane.js +407 -278
- package/lib/Geometry/models/sprite.js +291 -189
- package/lib/canvas/index.js +101 -66
- package/lib/canvas/models/canvas.js +207 -140
- package/lib/canvas/models/index.js +12 -30
- package/lib/citybuliding/building.js +98 -63
- package/lib/citybuliding/models/build.js +192 -146
- package/lib/core/BaseLayer.js +1331 -809
- package/lib/core/BaseModel.js +457 -279
- package/lib/core/interface.js +40 -53
- package/lib/core/schema.js +21 -39
- package/lib/core/shape/Path.js +67 -79
- package/lib/core/shape/extrude.js +132 -91
- package/lib/core/triangulation.js +412 -213
- package/lib/earth/index.js +100 -62
- package/lib/earth/models/atmosphere.js +146 -112
- package/lib/earth/models/base.js +210 -150
- package/lib/earth/models/bloomsphere.js +146 -112
- package/lib/earth/utils.js +111 -91
- package/lib/heatmap/index.js +149 -92
- package/lib/heatmap/models/grid.js +118 -91
- package/lib/heatmap/models/grid3d.js +155 -123
- package/lib/heatmap/models/heatmap.js +475 -338
- package/lib/heatmap/models/hexagon.js +121 -92
- package/lib/heatmap/models/index.js +22 -37
- package/lib/heatmap/triangulation.js +31 -47
- package/lib/image/index.js +111 -74
- package/lib/image/models/dataImage.js +232 -174
- package/lib/image/models/image.js +175 -123
- package/lib/image/models/index.js +15 -32
- package/lib/index.js +263 -97
- package/lib/line/index.js +131 -83
- package/lib/line/models/arc.js +352 -237
- package/lib/line/models/arc_3d.js +334 -228
- package/lib/line/models/earthArc_3d.js +336 -228
- package/lib/line/models/great_circle.js +291 -200
- package/lib/line/models/half.js +286 -201
- package/lib/line/models/index.js +42 -50
- package/lib/line/models/line.js +428 -299
- package/lib/line/models/linearline.js +277 -203
- package/lib/line/models/simpleLine.js +239 -175
- package/lib/line/models/tile.js +348 -237
- package/lib/line/models/wall.js +327 -235
- package/lib/line/shaders/line_arc_vert.glsl +5 -3
- package/lib/line/shaders/simple/simpleline_vert.glsl +1 -0
- package/lib/mask/index.js +92 -59
- package/lib/mask/models/fill.js +134 -82
- package/lib/mask/models/index.js +12 -30
- package/lib/plugins/DataMappingPlugin.js +342 -224
- package/lib/plugins/DataSourcePlugin.js +102 -87
- package/lib/plugins/FeatureScalePlugin.js +330 -241
- package/lib/plugins/LayerAnimateStylePlugin.js +61 -55
- package/lib/plugins/LayerModelPlugin.js +80 -73
- package/lib/plugins/LayerStylePlugin.js +48 -51
- package/lib/plugins/LightingPlugin.js +80 -68
- package/lib/plugins/MultiPassRendererPlugin.js +91 -65
- package/lib/plugins/PixelPickingPlugin.js +150 -109
- package/lib/plugins/RegisterStyleAttributePlugin.js +110 -110
- package/lib/plugins/ShaderUniformPlugin.js +118 -99
- package/lib/plugins/UpdateModelPlugin.js +40 -47
- package/lib/plugins/UpdateStyleAttributePlugin.js +93 -75
- package/lib/point/index.js +226 -148
- package/lib/point/models/earthExtrude.js +279 -201
- package/lib/point/models/earthFill.js +287 -202
- package/lib/point/models/extrude.js +299 -203
- package/lib/point/models/fill.js +406 -273
- package/lib/point/models/fillmage.js +365 -252
- package/lib/point/models/image.js +241 -164
- package/lib/point/models/index.js +46 -52
- package/lib/point/models/normal.js +183 -134
- package/lib/point/models/radar.js +304 -212
- package/lib/point/models/simplePoint.js +194 -142
- package/lib/point/models/text.js +608 -385
- package/lib/point/models/tile.js +314 -223
- package/lib/point/shaders/fill_vert.glsl +13 -6
- package/lib/point/shaders/image/fillImage_vert.glsl +13 -5
- package/lib/point/shaders/image_vert.glsl +17 -8
- package/lib/point/shape/extrude.js +56 -52
- package/lib/polygon/index.js +154 -100
- package/lib/polygon/models/extrude.js +311 -223
- package/lib/polygon/models/fill.js +215 -153
- package/lib/polygon/models/index.js +46 -52
- package/lib/polygon/models/ocean.js +244 -173
- package/lib/polygon/models/tile.js +144 -100
- package/lib/polygon/models/water.js +222 -153
- package/lib/raster/buffers/triangulation.js +27 -40
- package/lib/raster/index.js +115 -74
- package/lib/raster/models/index.js +16 -33
- package/lib/raster/models/raster.js +178 -135
- package/lib/raster/raster.js +187 -132
- package/lib/tile/interface.js +4 -16
- package/lib/tile/manager/tileConfigManager.js +125 -86
- package/lib/tile/manager/tileLayerManager.js +314 -227
- package/lib/tile/manager/tilePickerManager.js +192 -123
- package/lib/tile/models/tileModel.js +71 -51
- package/lib/tile/tileFactory/base.js +433 -292
- package/lib/tile/tileFactory/index.js +51 -49
- package/lib/tile/tileFactory/line.js +65 -50
- package/lib/tile/tileFactory/point.js +65 -50
- package/lib/tile/tileFactory/polygon.js +65 -50
- package/lib/tile/tileFactory/raster.js +66 -54
- package/lib/tile/tileFactory/rasterData.js +88 -76
- package/lib/tile/tileFactory/rasterDataLayer.js +97 -62
- package/lib/tile/tileFactory/vectorLayer.js +169 -95
- package/lib/tile/tileLayer/baseTileLayer.js +420 -220
- package/lib/tile/tmsTileLayer.js +110 -67
- package/lib/tile/utils.js +113 -87
- package/lib/utils/blend.js +59 -79
- package/lib/utils/collision-index.js +107 -64
- package/lib/utils/dataMappingStyle.js +105 -60
- package/lib/utils/extrude_polyline.js +600 -398
- package/lib/utils/grid-index.js +163 -111
- package/lib/utils/layerData.js +130 -99
- package/lib/utils/multiPassRender.js +49 -41
- package/lib/utils/polylineNormal.js +148 -96
- package/lib/utils/simpleLine.js +100 -85
- package/lib/utils/symbol-layout.js +219 -116
- package/lib/utils/updateShape.js +15 -41
- package/lib/wind/index.js +109 -71
- package/lib/wind/models/index.js +12 -30
- package/lib/wind/models/utils.js +144 -105
- package/lib/wind/models/wind.js +333 -224
- package/lib/wind/models/windRender.js +329 -218
- package/lib/wind/models/windShader.js +23 -181
- package/package.json +7 -6
|
@@ -1,93 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
22
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
23
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
24
|
-
if (decorator = decorators[i])
|
|
25
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
26
|
-
if (kind && result)
|
|
27
|
-
__defProp(target, key, result);
|
|
28
|
-
return result;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// src/plugins/DataSourcePlugin.ts
|
|
32
|
-
var DataSourcePlugin_exports = {};
|
|
33
|
-
__export(DataSourcePlugin_exports, {
|
|
34
|
-
default: () => DataSourcePlugin
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
35
9
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.updateClusterData(layer);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
layer.hooks.beforeRenderData.tap("DataSourcePlugin", () => {
|
|
64
|
-
const neeUpdateCluster = this.updateClusterData(layer);
|
|
65
|
-
const dataSourceNeedUpdate = layer.dataState.dataSourceNeedUpdate;
|
|
66
|
-
layer.dataState.dataSourceNeedUpdate = false;
|
|
67
|
-
return neeUpdateCluster || dataSourceNeedUpdate;
|
|
68
|
-
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _l7Core = require("@antv/l7-core");
|
|
17
|
+
|
|
18
|
+
var _l7Source = _interopRequireWildcard(require("@antv/l7-source"));
|
|
19
|
+
|
|
20
|
+
var _inversify = require("inversify");
|
|
21
|
+
|
|
22
|
+
require("reflect-metadata");
|
|
23
|
+
|
|
24
|
+
var _dec, _class;
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
var DataSourcePlugin = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE__*/function () {
|
|
31
|
+
function DataSourcePlugin() {
|
|
32
|
+
(0, _classCallCheck2.default)(this, DataSourcePlugin);
|
|
69
33
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
34
|
+
|
|
35
|
+
(0, _createClass2.default)(DataSourcePlugin, [{
|
|
36
|
+
key: "apply",
|
|
37
|
+
value: function apply(layer) {
|
|
38
|
+
var _this = this;
|
|
39
|
+
|
|
40
|
+
this.mapService = layer.getContainer().get(_l7Core.TYPES.IMapService);
|
|
41
|
+
layer.hooks.init.tap('DataSourcePlugin', function () {
|
|
42
|
+
var source = layer.getSource();
|
|
43
|
+
|
|
44
|
+
if (!source) {
|
|
45
|
+
// TODO: 允许用户不使用 layer 的 source 方法,在这里传入一个默认的替换的默认数据
|
|
46
|
+
var defaultSourceConfig = _l7Source.DEFAULT_SOURCE[layer.type] || {
|
|
47
|
+
data: _l7Source.DEFAULT_DATA,
|
|
48
|
+
options: _l7Source.DEFAULT_PARSER
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var _ref = layer.sourceOption || defaultSourceConfig,
|
|
52
|
+
data = _ref.data,
|
|
53
|
+
options = _ref.options;
|
|
54
|
+
|
|
55
|
+
source = new _l7Source.default(data, options);
|
|
56
|
+
layer.setSource(source);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (source.inited) {
|
|
60
|
+
_this.updateClusterData(layer);
|
|
61
|
+
} else {
|
|
62
|
+
source.once('sourceUpdate', function () {
|
|
63
|
+
_this.updateClusterData(layer); // TODO: layer.hooks.init.call();
|
|
64
|
+
|
|
65
|
+
});
|
|
66
|
+
} // this.updateClusterData(layer);
|
|
67
|
+
|
|
68
|
+
}); // 检测数据是否需要更新
|
|
69
|
+
|
|
70
|
+
layer.hooks.beforeRenderData.tap('DataSourcePlugin', function () {
|
|
71
|
+
var neeUpdateCluster = _this.updateClusterData(layer);
|
|
72
|
+
|
|
73
|
+
var dataSourceNeedUpdate = layer.dataState.dataSourceNeedUpdate;
|
|
74
|
+
layer.dataState.dataSourceNeedUpdate = false;
|
|
75
|
+
return neeUpdateCluster || dataSourceNeedUpdate;
|
|
76
|
+
});
|
|
78
77
|
}
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
}, {
|
|
79
|
+
key: "updateClusterData",
|
|
80
|
+
value: function updateClusterData(layer) {
|
|
81
|
+
var source = layer.getSource();
|
|
82
|
+
var cluster = source.cluster;
|
|
83
|
+
var _source$clusterOption = source.clusterOptions.zoom,
|
|
84
|
+
zoom = _source$clusterOption === void 0 ? 0 : _source$clusterOption;
|
|
85
|
+
var newZoom = this.mapService.getZoom() - 1;
|
|
86
|
+
var dataSourceNeedUpdate = layer.dataState.dataSourceNeedUpdate;
|
|
87
|
+
|
|
88
|
+
if (cluster && dataSourceNeedUpdate) {
|
|
89
|
+
// 数据发生更新
|
|
81
90
|
source.updateClusterData(Math.floor(newZoom));
|
|
91
|
+
} // 如果 dataSource 有更新,跳过 zoom 的判断,直接更新一次
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
if (cluster && Math.abs(layer.clusterZoom - newZoom) >= 1) {
|
|
95
|
+
if (zoom !== Math.floor(newZoom)) {
|
|
96
|
+
source.updateClusterData(Math.floor(newZoom));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
layer.clusterZoom = newZoom;
|
|
100
|
+
return true;
|
|
82
101
|
}
|
|
83
|
-
|
|
84
|
-
return
|
|
102
|
+
|
|
103
|
+
return false;
|
|
85
104
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
(0, import_inversify.injectable)()
|
|
91
|
-
], DataSourcePlugin);
|
|
92
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
93
|
-
0 && (module.exports = {});
|
|
105
|
+
}]);
|
|
106
|
+
return DataSourcePlugin;
|
|
107
|
+
}()) || _class);
|
|
108
|
+
exports.default = DataSourcePlugin;
|