@antv/l7-layers 2.9.25-alpha.0 → 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.
Files changed (125) hide show
  1. package/es/heatmap/models/heatmap.js +1 -1
  2. package/es/tile/utils.js +1 -1
  3. package/lib/Geometry/index.js +114 -77
  4. package/lib/Geometry/models/billboard.js +232 -181
  5. package/lib/Geometry/models/index.js +18 -34
  6. package/lib/Geometry/models/plane.js +407 -278
  7. package/lib/Geometry/models/sprite.js +291 -189
  8. package/lib/canvas/index.js +101 -66
  9. package/lib/canvas/models/canvas.js +207 -140
  10. package/lib/canvas/models/index.js +12 -30
  11. package/lib/citybuliding/building.js +98 -63
  12. package/lib/citybuliding/models/build.js +192 -146
  13. package/lib/core/BaseLayer.js +1331 -814
  14. package/lib/core/BaseModel.js +457 -279
  15. package/lib/core/interface.js +40 -53
  16. package/lib/core/schema.js +21 -39
  17. package/lib/core/shape/Path.js +67 -79
  18. package/lib/core/shape/extrude.js +132 -91
  19. package/lib/core/triangulation.js +378 -196
  20. package/lib/earth/index.js +100 -62
  21. package/lib/earth/models/atmosphere.js +146 -112
  22. package/lib/earth/models/base.js +210 -150
  23. package/lib/earth/models/bloomsphere.js +146 -112
  24. package/lib/earth/utils.js +111 -91
  25. package/lib/heatmap/index.js +149 -92
  26. package/lib/heatmap/models/grid.js +118 -91
  27. package/lib/heatmap/models/grid3d.js +155 -123
  28. package/lib/heatmap/models/heatmap.js +475 -338
  29. package/lib/heatmap/models/hexagon.js +121 -92
  30. package/lib/heatmap/models/index.js +22 -37
  31. package/lib/heatmap/triangulation.js +31 -47
  32. package/lib/image/index.js +111 -74
  33. package/lib/image/models/dataImage.js +232 -174
  34. package/lib/image/models/image.js +175 -128
  35. package/lib/image/models/index.js +15 -32
  36. package/lib/index.js +263 -97
  37. package/lib/line/index.js +131 -85
  38. package/lib/line/models/arc.js +352 -237
  39. package/lib/line/models/arc_3d.js +334 -228
  40. package/lib/line/models/earthArc_3d.js +336 -228
  41. package/lib/line/models/great_circle.js +291 -200
  42. package/lib/line/models/half.js +286 -201
  43. package/lib/line/models/index.js +42 -50
  44. package/lib/line/models/line.js +428 -299
  45. package/lib/line/models/linearline.js +277 -203
  46. package/lib/line/models/simpleLine.js +239 -175
  47. package/lib/line/models/tile.js +348 -237
  48. package/lib/line/models/wall.js +327 -235
  49. package/lib/mask/index.js +92 -59
  50. package/lib/mask/models/fill.js +134 -82
  51. package/lib/mask/models/index.js +12 -30
  52. package/lib/plugins/DataMappingPlugin.js +342 -224
  53. package/lib/plugins/DataSourcePlugin.js +102 -87
  54. package/lib/plugins/FeatureScalePlugin.js +330 -240
  55. package/lib/plugins/LayerAnimateStylePlugin.js +61 -55
  56. package/lib/plugins/LayerModelPlugin.js +80 -73
  57. package/lib/plugins/LayerStylePlugin.js +48 -51
  58. package/lib/plugins/LightingPlugin.js +80 -68
  59. package/lib/plugins/MultiPassRendererPlugin.js +91 -65
  60. package/lib/plugins/PixelPickingPlugin.js +150 -109
  61. package/lib/plugins/RegisterStyleAttributePlugin.js +110 -110
  62. package/lib/plugins/ShaderUniformPlugin.js +118 -99
  63. package/lib/plugins/UpdateModelPlugin.js +40 -47
  64. package/lib/plugins/UpdateStyleAttributePlugin.js +93 -75
  65. package/lib/point/index.js +226 -150
  66. package/lib/point/models/earthExtrude.js +279 -201
  67. package/lib/point/models/earthFill.js +287 -202
  68. package/lib/point/models/extrude.js +299 -203
  69. package/lib/point/models/fill.js +406 -275
  70. package/lib/point/models/fillmage.js +365 -256
  71. package/lib/point/models/image.js +241 -168
  72. package/lib/point/models/index.js +46 -52
  73. package/lib/point/models/normal.js +183 -134
  74. package/lib/point/models/radar.js +304 -211
  75. package/lib/point/models/simplePoint.js +194 -142
  76. package/lib/point/models/text.js +608 -385
  77. package/lib/point/models/tile.js +314 -223
  78. package/lib/point/shape/extrude.js +56 -52
  79. package/lib/polygon/index.js +154 -102
  80. package/lib/polygon/models/extrude.js +311 -223
  81. package/lib/polygon/models/fill.js +215 -153
  82. package/lib/polygon/models/index.js +46 -52
  83. package/lib/polygon/models/ocean.js +244 -173
  84. package/lib/polygon/models/tile.js +144 -100
  85. package/lib/polygon/models/water.js +222 -153
  86. package/lib/raster/buffers/triangulation.js +27 -40
  87. package/lib/raster/index.js +115 -75
  88. package/lib/raster/models/index.js +16 -33
  89. package/lib/raster/models/raster.js +178 -135
  90. package/lib/raster/raster.js +187 -132
  91. package/lib/tile/interface.js +4 -16
  92. package/lib/tile/manager/tileConfigManager.js +125 -86
  93. package/lib/tile/manager/tileLayerManager.js +313 -229
  94. package/lib/tile/manager/tilePickerManager.js +192 -123
  95. package/lib/tile/models/tileModel.js +71 -52
  96. package/lib/tile/tileFactory/base.js +432 -309
  97. package/lib/tile/tileFactory/index.js +51 -49
  98. package/lib/tile/tileFactory/line.js +65 -50
  99. package/lib/tile/tileFactory/point.js +65 -50
  100. package/lib/tile/tileFactory/polygon.js +65 -50
  101. package/lib/tile/tileFactory/raster.js +66 -54
  102. package/lib/tile/tileFactory/rasterData.js +88 -76
  103. package/lib/tile/tileFactory/rasterDataLayer.js +97 -62
  104. package/lib/tile/tileFactory/vectorLayer.js +168 -109
  105. package/lib/tile/tileLayer/baseTileLayer.js +420 -221
  106. package/lib/tile/tmsTileLayer.js +110 -67
  107. package/lib/tile/utils.js +110 -92
  108. package/lib/utils/blend.js +59 -79
  109. package/lib/utils/collision-index.js +107 -64
  110. package/lib/utils/dataMappingStyle.js +105 -60
  111. package/lib/utils/extrude_polyline.js +600 -398
  112. package/lib/utils/grid-index.js +163 -111
  113. package/lib/utils/layerData.js +130 -99
  114. package/lib/utils/multiPassRender.js +49 -41
  115. package/lib/utils/polylineNormal.js +148 -96
  116. package/lib/utils/simpleLine.js +100 -85
  117. package/lib/utils/symbol-layout.js +219 -116
  118. package/lib/utils/updateShape.js +15 -41
  119. package/lib/wind/index.js +109 -71
  120. package/lib/wind/models/index.js +12 -30
  121. package/lib/wind/models/utils.js +144 -105
  122. package/lib/wind/models/wind.js +333 -224
  123. package/lib/wind/models/windRender.js +329 -218
  124. package/lib/wind/models/windShader.js +23 -181
  125. package/package.json +6 -6
@@ -1,93 +1,108 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
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
- module.exports = __toCommonJS(DataSourcePlugin_exports);
37
- var import_l7_core = require("@antv/l7-core");
38
- var import_l7_source = __toESM(require("@antv/l7-source"));
39
- var import_inversify = require("inversify");
40
- var import_reflect_metadata = require("reflect-metadata");
41
- var DataSourcePlugin = class {
42
- apply(layer) {
43
- this.mapService = layer.getContainer().get(import_l7_core.TYPES.IMapService);
44
- layer.hooks.init.tap("DataSourcePlugin", () => {
45
- let source = layer.getSource();
46
- if (!source) {
47
- const defaultSourceConfig = import_l7_source.DEFAULT_SOURCE[layer.type] || {
48
- data: import_l7_source.DEFAULT_DATA,
49
- options: import_l7_source.DEFAULT_PARSER
50
- };
51
- const { data, options } = layer.sourceOption || defaultSourceConfig;
52
- source = new import_l7_source.default(data, options);
53
- layer.setSource(source);
54
- }
55
- if (source.inited) {
56
- this.updateClusterData(layer);
57
- } else {
58
- source.once("sourceUpdate", () => {
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
- updateClusterData(layer) {
71
- const source = layer.getSource();
72
- const cluster = source.cluster;
73
- const { zoom = 0 } = source.clusterOptions;
74
- const newZoom = this.mapService.getZoom() - 1;
75
- const dataSourceNeedUpdate = layer.dataState.dataSourceNeedUpdate;
76
- if (cluster && dataSourceNeedUpdate) {
77
- source.updateClusterData(Math.floor(newZoom));
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
- if (cluster && Math.abs(layer.clusterZoom - newZoom) >= 1) {
80
- if (zoom !== Math.floor(newZoom)) {
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
- layer.clusterZoom = newZoom;
84
- return true;
102
+
103
+ return false;
85
104
  }
86
- return false;
87
- }
88
- };
89
- DataSourcePlugin = __decorateClass([
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;