@antv/l7-layers 2.9.25-alpha.0 → 2.9.26-alpha.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.
Files changed (126) hide show
  1. package/es/heatmap/models/heatmap.js +1 -1
  2. package/es/tile/tileFactory/base.d.ts +1 -1
  3. package/es/tile/utils.js +1 -1
  4. package/lib/Geometry/index.js +114 -77
  5. package/lib/Geometry/models/billboard.js +232 -181
  6. package/lib/Geometry/models/index.js +18 -34
  7. package/lib/Geometry/models/plane.js +407 -278
  8. package/lib/Geometry/models/sprite.js +291 -189
  9. package/lib/canvas/index.js +101 -66
  10. package/lib/canvas/models/canvas.js +207 -140
  11. package/lib/canvas/models/index.js +12 -30
  12. package/lib/citybuliding/building.js +98 -63
  13. package/lib/citybuliding/models/build.js +192 -146
  14. package/lib/core/BaseLayer.js +1331 -814
  15. package/lib/core/BaseModel.js +457 -279
  16. package/lib/core/interface.js +40 -53
  17. package/lib/core/schema.js +21 -39
  18. package/lib/core/shape/Path.js +67 -79
  19. package/lib/core/shape/extrude.js +132 -91
  20. package/lib/core/triangulation.js +378 -196
  21. package/lib/earth/index.js +100 -62
  22. package/lib/earth/models/atmosphere.js +146 -112
  23. package/lib/earth/models/base.js +210 -150
  24. package/lib/earth/models/bloomsphere.js +146 -112
  25. package/lib/earth/utils.js +111 -91
  26. package/lib/heatmap/index.js +149 -92
  27. package/lib/heatmap/models/grid.js +118 -91
  28. package/lib/heatmap/models/grid3d.js +155 -123
  29. package/lib/heatmap/models/heatmap.js +475 -338
  30. package/lib/heatmap/models/hexagon.js +121 -92
  31. package/lib/heatmap/models/index.js +22 -37
  32. package/lib/heatmap/triangulation.js +31 -47
  33. package/lib/image/index.js +111 -74
  34. package/lib/image/models/dataImage.js +232 -174
  35. package/lib/image/models/image.js +175 -128
  36. package/lib/image/models/index.js +15 -32
  37. package/lib/index.js +263 -97
  38. package/lib/line/index.js +131 -85
  39. package/lib/line/models/arc.js +352 -237
  40. package/lib/line/models/arc_3d.js +334 -228
  41. package/lib/line/models/earthArc_3d.js +336 -228
  42. package/lib/line/models/great_circle.js +291 -200
  43. package/lib/line/models/half.js +286 -201
  44. package/lib/line/models/index.js +42 -50
  45. package/lib/line/models/line.js +428 -299
  46. package/lib/line/models/linearline.js +277 -203
  47. package/lib/line/models/simpleLine.js +239 -175
  48. package/lib/line/models/tile.js +348 -237
  49. package/lib/line/models/wall.js +327 -235
  50. package/lib/mask/index.js +92 -59
  51. package/lib/mask/models/fill.js +134 -82
  52. package/lib/mask/models/index.js +12 -30
  53. package/lib/plugins/DataMappingPlugin.js +342 -224
  54. package/lib/plugins/DataSourcePlugin.js +102 -87
  55. package/lib/plugins/FeatureScalePlugin.js +330 -240
  56. package/lib/plugins/LayerAnimateStylePlugin.js +61 -55
  57. package/lib/plugins/LayerModelPlugin.js +80 -73
  58. package/lib/plugins/LayerStylePlugin.js +48 -51
  59. package/lib/plugins/LightingPlugin.js +80 -68
  60. package/lib/plugins/MultiPassRendererPlugin.js +91 -65
  61. package/lib/plugins/PixelPickingPlugin.js +150 -109
  62. package/lib/plugins/RegisterStyleAttributePlugin.js +110 -110
  63. package/lib/plugins/ShaderUniformPlugin.js +118 -99
  64. package/lib/plugins/UpdateModelPlugin.js +40 -47
  65. package/lib/plugins/UpdateStyleAttributePlugin.js +93 -75
  66. package/lib/point/index.js +226 -150
  67. package/lib/point/models/earthExtrude.js +279 -201
  68. package/lib/point/models/earthFill.js +287 -202
  69. package/lib/point/models/extrude.js +299 -203
  70. package/lib/point/models/fill.js +406 -275
  71. package/lib/point/models/fillmage.js +365 -256
  72. package/lib/point/models/image.js +241 -168
  73. package/lib/point/models/index.js +46 -52
  74. package/lib/point/models/normal.js +183 -134
  75. package/lib/point/models/radar.js +304 -211
  76. package/lib/point/models/simplePoint.js +194 -142
  77. package/lib/point/models/text.js +608 -385
  78. package/lib/point/models/tile.js +314 -223
  79. package/lib/point/shape/extrude.js +56 -52
  80. package/lib/polygon/index.js +154 -102
  81. package/lib/polygon/models/extrude.js +311 -223
  82. package/lib/polygon/models/fill.js +215 -153
  83. package/lib/polygon/models/index.js +46 -52
  84. package/lib/polygon/models/ocean.js +244 -173
  85. package/lib/polygon/models/tile.js +144 -100
  86. package/lib/polygon/models/water.js +222 -153
  87. package/lib/raster/buffers/triangulation.js +27 -40
  88. package/lib/raster/index.js +115 -75
  89. package/lib/raster/models/index.js +16 -33
  90. package/lib/raster/models/raster.js +178 -135
  91. package/lib/raster/raster.js +187 -132
  92. package/lib/tile/interface.js +4 -16
  93. package/lib/tile/manager/tileConfigManager.js +125 -86
  94. package/lib/tile/manager/tileLayerManager.js +313 -229
  95. package/lib/tile/manager/tilePickerManager.js +192 -123
  96. package/lib/tile/models/tileModel.js +71 -52
  97. package/lib/tile/tileFactory/base.js +432 -309
  98. package/lib/tile/tileFactory/index.js +51 -49
  99. package/lib/tile/tileFactory/line.js +65 -50
  100. package/lib/tile/tileFactory/point.js +65 -50
  101. package/lib/tile/tileFactory/polygon.js +65 -50
  102. package/lib/tile/tileFactory/raster.js +66 -54
  103. package/lib/tile/tileFactory/rasterData.js +88 -76
  104. package/lib/tile/tileFactory/rasterDataLayer.js +97 -62
  105. package/lib/tile/tileFactory/vectorLayer.js +168 -109
  106. package/lib/tile/tileLayer/baseTileLayer.js +420 -221
  107. package/lib/tile/tmsTileLayer.js +110 -67
  108. package/lib/tile/utils.js +110 -92
  109. package/lib/utils/blend.js +59 -79
  110. package/lib/utils/collision-index.js +107 -64
  111. package/lib/utils/dataMappingStyle.js +105 -60
  112. package/lib/utils/extrude_polyline.js +600 -398
  113. package/lib/utils/grid-index.js +163 -111
  114. package/lib/utils/layerData.js +130 -99
  115. package/lib/utils/multiPassRender.js +49 -41
  116. package/lib/utils/polylineNormal.js +148 -96
  117. package/lib/utils/simpleLine.js +100 -85
  118. package/lib/utils/symbol-layout.js +219 -116
  119. package/lib/utils/updateShape.js +15 -41
  120. package/lib/wind/index.js +109 -71
  121. package/lib/wind/models/index.js +12 -30
  122. package/lib/wind/models/utils.js +144 -105
  123. package/lib/wind/models/wind.js +333 -224
  124. package/lib/wind/models/windRender.js +329 -218
  125. package/lib/wind/models/windShader.js +23 -181
  126. package/package.json +6 -6
@@ -1,162 +1,238 @@
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
-
22
- // src/point/index.ts
23
- var point_exports = {};
24
- __export(point_exports, {
25
- default: () => PointLayer
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
26
7
  });
27
- module.exports = __toCommonJS(point_exports);
28
- var import_BaseLayer = __toESM(require("../core/BaseLayer"));
29
- var import_models = __toESM(require("./models/index"));
30
- var import_utils = require("../tile/utils");
31
- var PointLayer = class extends import_BaseLayer.default {
32
- constructor() {
33
- super(...arguments);
34
- this.type = "PointLayer";
35
- }
36
- buildModels() {
37
- const modelType = this.getModelType();
38
- this.layerModel = new import_models.default[modelType](this);
39
- this.layerModel.initModels((models) => {
40
- this.models = models;
41
- this.layerService.updateLayerRenderList();
42
- this.renderLayers();
43
- });
44
- }
45
- rebuildModels() {
46
- this.layerModel.buildModels((models) => this.models = models);
8
+ exports.default = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
+
16
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
+
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
+
20
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
+
22
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
+
24
+ var _BaseLayer2 = _interopRequireDefault(require("../core/BaseLayer"));
25
+
26
+ var _index = _interopRequireDefault(require("./models/index"));
27
+
28
+ var _utils = require("../tile/utils");
29
+
30
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
31
+
32
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
33
+
34
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
35
+
36
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
37
+
38
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
+
40
+ var PointLayer = /*#__PURE__*/function (_BaseLayer) {
41
+ (0, _inherits2.default)(PointLayer, _BaseLayer);
42
+
43
+ var _super = _createSuper(PointLayer);
44
+
45
+ function PointLayer() {
46
+ var _this;
47
+
48
+ (0, _classCallCheck2.default)(this, PointLayer);
49
+
50
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
51
+ args[_key] = arguments[_key];
52
+ }
53
+
54
+ _this = _super.call.apply(_super, [this].concat(args));
55
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", 'PointLayer');
56
+ return _this;
47
57
  }
48
- getModelTypeWillEmptyData() {
49
- if (this.shapeOption) {
50
- const { field, values } = this.shapeOption;
51
- const { shape2d, shape3d } = this.getLayerConfig();
52
- const iconMap = this.iconService.getIconMap();
53
- if (field && (shape2d == null ? void 0 : shape2d.indexOf(field)) !== -1) {
54
- return "fill";
55
- }
56
- if (values && values instanceof Array) {
57
- for (const v of values) {
58
- if (typeof v === "string" && iconMap.hasOwnProperty(v)) {
59
- return "image";
58
+
59
+ (0, _createClass2.default)(PointLayer, [{
60
+ key: "buildModels",
61
+ value: function buildModels() {
62
+ var _this2 = this;
63
+
64
+ var modelType = this.getModelType();
65
+ this.layerModel = new _index.default[modelType](this);
66
+ this.layerModel.initModels(function (models) {
67
+ _this2.models = models;
68
+
69
+ _this2.layerService.updateLayerRenderList();
70
+
71
+ _this2.renderLayers();
72
+ });
73
+ }
74
+ }, {
75
+ key: "rebuildModels",
76
+ value: function rebuildModels() {
77
+ var _this3 = this;
78
+
79
+ this.layerModel.buildModels(function (models) {
80
+ return _this3.models = models;
81
+ });
82
+ }
83
+ /**
84
+ * 在未传入数据的时候判断点图层的 shape 类型
85
+ * @returns
86
+ */
87
+
88
+ }, {
89
+ key: "getModelTypeWillEmptyData",
90
+ value: function getModelTypeWillEmptyData() {
91
+ if (this.shapeOption) {
92
+ var _this$shapeOption = this.shapeOption,
93
+ field = _this$shapeOption.field,
94
+ values = _this$shapeOption.values;
95
+
96
+ var _this$getLayerConfig = this.getLayerConfig(),
97
+ shape2d = _this$getLayerConfig.shape2d,
98
+ shape3d = _this$getLayerConfig.shape3d;
99
+
100
+ var iconMap = this.iconService.getIconMap();
101
+
102
+ if (field && (shape2d === null || shape2d === void 0 ? void 0 : shape2d.indexOf(field)) !== -1) {
103
+ return 'fill';
104
+ }
105
+
106
+ if (values && values instanceof Array) {
107
+ var _iterator = _createForOfIteratorHelper(values),
108
+ _step;
109
+
110
+ try {
111
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
112
+ var v = _step.value;
113
+
114
+ if (typeof v === 'string' && iconMap.hasOwnProperty(v)) {
115
+ return 'image';
116
+ }
117
+ }
118
+ } catch (err) {
119
+ _iterator.e(err);
120
+ } finally {
121
+ _iterator.f();
60
122
  }
61
123
  }
62
124
  }
125
+
126
+ return 'normal';
63
127
  }
64
- return "normal";
65
- }
66
- getConfigSchema() {
67
- return {
68
- properties: {
69
- opacity: {
70
- type: "number",
71
- minimum: 0,
72
- maximum: 1
128
+ }, {
129
+ key: "getConfigSchema",
130
+ value: function getConfigSchema() {
131
+ return {
132
+ properties: {
133
+ opacity: {
134
+ type: 'number',
135
+ minimum: 0,
136
+ maximum: 1
137
+ }
73
138
  }
74
- }
75
- };
76
- }
77
- getDefaultConfig() {
78
- const type = this.getModelType();
79
- const defaultConfig = {
80
- fillImage: {},
81
- normal: {
82
- blend: "additive"
83
- },
84
- radar: {},
85
- simplePoint: {},
86
- fill: { blend: "normal" },
87
- extrude: {},
88
- image: {},
89
- text: {
90
- blend: "normal"
91
- },
92
- vectorpoint: {},
93
- tile: {},
94
- earthFill: {},
95
- earthExtrude: {}
96
- };
97
- return defaultConfig[type];
98
- }
99
- getModelType() {
100
- const PointTypes = [
101
- "fillImage",
102
- "fill",
103
- "radar",
104
- "image",
105
- "normal",
106
- "simplePoint",
107
- "extrude",
108
- "text",
109
- "vectorpoint",
110
- "tile",
111
- "earthFill",
112
- "earthExtrude"
113
- ];
114
- const parserType = this.layerSource.getParserType();
115
- if ((0, import_utils.isVectorTile)(parserType)) {
116
- return "vectorpoint";
139
+ };
117
140
  }
118
- const layerData = this.getEncodedData();
119
- const { shape2d, shape3d } = this.getLayerConfig();
120
- const iconMap = this.iconService.getIconMap();
121
- const item = layerData.find((fe) => {
122
- return fe.hasOwnProperty("shape");
123
- });
124
- if (!item) {
125
- return this.getModelTypeWillEmptyData();
126
- } else {
127
- const shape = item.shape;
128
- if (shape === "dot") {
129
- return "normal";
130
- }
131
- if (shape === "simple") {
132
- return "simplePoint";
133
- }
134
- if (shape === "radar") {
135
- return "radar";
136
- }
137
- if (this.layerType === "fillImage") {
138
- return "fillImage";
139
- }
140
- if ((shape2d == null ? void 0 : shape2d.indexOf(shape)) !== -1) {
141
- if (this.mapService.version === "GLOBEL") {
142
- return "earthFill";
143
- } else {
144
- return "fill";
141
+ }, {
142
+ key: "getDefaultConfig",
143
+ value: function getDefaultConfig() {
144
+ var type = this.getModelType();
145
+ var defaultConfig = {
146
+ fillImage: {},
147
+ normal: {
148
+ blend: 'additive'
149
+ },
150
+ radar: {},
151
+ simplePoint: {},
152
+ fill: {
153
+ blend: 'normal'
154
+ },
155
+ extrude: {},
156
+ image: {},
157
+ text: {
158
+ blend: 'normal'
159
+ },
160
+ vectorpoint: {},
161
+ tile: {},
162
+ earthFill: {},
163
+ earthExtrude: {}
164
+ };
165
+ return defaultConfig[type];
166
+ }
167
+ }, {
168
+ key: "getModelType",
169
+ value: function getModelType() {
170
+ var PointTypes = ['fillImage', 'fill', 'radar', 'image', 'normal', 'simplePoint', 'extrude', 'text', 'vectorpoint', 'tile', 'earthFill', 'earthExtrude'];
171
+ var parserType = this.layerSource.getParserType();
172
+
173
+ if ((0, _utils.isVectorTile)(parserType)) {
174
+ return 'vectorpoint';
175
+ } // pointlayer
176
+ // 2D、 3d、 shape、image、text、normal、
177
+
178
+
179
+ var layerData = this.getEncodedData();
180
+
181
+ var _this$getLayerConfig2 = this.getLayerConfig(),
182
+ shape2d = _this$getLayerConfig2.shape2d,
183
+ shape3d = _this$getLayerConfig2.shape3d;
184
+
185
+ var iconMap = this.iconService.getIconMap();
186
+ var item = layerData.find(function (fe) {
187
+ return fe.hasOwnProperty('shape');
188
+ });
189
+
190
+ if (!item) {
191
+ return this.getModelTypeWillEmptyData();
192
+ } else {
193
+ var shape = item.shape;
194
+
195
+ if (shape === 'dot') {
196
+ return 'normal';
145
197
  }
146
- }
147
- if ((shape3d == null ? void 0 : shape3d.indexOf(shape)) !== -1) {
148
- if (this.mapService.version === "GLOBEL") {
149
- return "earthExtrude";
150
- } else {
151
- return "extrude";
198
+
199
+ if (shape === 'simple') {
200
+ return 'simplePoint';
152
201
  }
202
+
203
+ if (shape === 'radar') {
204
+ return 'radar';
205
+ }
206
+
207
+ if (this.layerType === 'fillImage') {
208
+ return 'fillImage';
209
+ }
210
+
211
+ if ((shape2d === null || shape2d === void 0 ? void 0 : shape2d.indexOf(shape)) !== -1) {
212
+ if (this.mapService.version === 'GLOBEL') {
213
+ return 'earthFill';
214
+ } else {
215
+ return 'fill';
216
+ }
217
+ }
218
+
219
+ if ((shape3d === null || shape3d === void 0 ? void 0 : shape3d.indexOf(shape)) !== -1) {
220
+ if (this.mapService.version === 'GLOBEL') {
221
+ return 'earthExtrude';
222
+ } else {
223
+ return 'extrude';
224
+ }
225
+ }
226
+
227
+ if (iconMap.hasOwnProperty(shape)) {
228
+ return 'image';
229
+ }
230
+
231
+ return 'text';
153
232
  }
154
- if (iconMap.hasOwnProperty(shape)) {
155
- return "image";
156
- }
157
- return "text";
158
233
  }
159
- }
160
- };
161
- // Annotate the CommonJS export names for ESM import in node:
162
- 0 && (module.exports = {});
234
+ }]);
235
+ return PointLayer;
236
+ }(_BaseLayer2.default);
237
+
238
+ exports.default = PointLayer;