@antv/l7-layers 2.15.4 → 2.15.5

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.
@@ -1323,6 +1323,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
1323
1323
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1324
1324
  // TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
1325
1325
  if (this.encodeDataLength <= 0 && !this.forceRender) {
1326
+ // 数据为空销毁model
1327
+ this.clearModels();
1326
1328
  return this;
1327
1329
  }
1328
1330
  this.hooks.beforeRender.call();
@@ -120,7 +120,6 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
120
120
  width = _this$calDataFrame.width,
121
121
  height = _this$calDataFrame.height;
122
122
  this.rowCount = height; // 当前数据纹理有多少行
123
-
124
123
  this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
125
124
  flipY: true,
126
125
  data: data,
@@ -86,8 +86,12 @@ export var TileLayerService = /*#__PURE__*/function () {
86
86
  // tile?.updateVisible(false);
87
87
  // }
88
88
  // }
89
-
90
89
  tile === null || tile === void 0 ? void 0 : tile.updateVisible(sourceTile.isVisible);
90
+ // if (sourceTile.isVisible) {
91
+ // tile?.updateVisible(sourceTile.isVisible);
92
+ // } else {
93
+ // this.removeTile(sourceTile.key);
94
+ // }
91
95
  }
92
96
  }, {
93
97
  key: "isParentLoaded",
@@ -143,8 +147,9 @@ export var TileLayerService = /*#__PURE__*/function () {
143
147
  return _ref2.apply(this, arguments);
144
148
  };
145
149
  }());
146
- Promise.all(renders);
147
- case 3:
150
+ _context2.next = 4;
151
+ return Promise.all(renders);
152
+ case 4:
148
153
  case "end":
149
154
  return _context2.stop();
150
155
  }
@@ -30,12 +30,13 @@ var DebugTile = /*#__PURE__*/function (_Tile) {
30
30
  lineLayer = new LineLayer().source(sourceOptions.data, sourceOptions.options).size(1).shape('line').color('red');
31
31
  pointLayer = new PointLayer({
32
32
  minZoom: this.z - 1,
33
- maxZoom: this.z + 1
33
+ maxZoom: this.z + 1,
34
+ textAllowOverlap: true
34
35
  }).source([pointData], {
35
36
  parser: {
36
37
  type: 'json',
37
- x: 'textLng',
38
- y: 'textLat'
38
+ x: 'x',
39
+ y: 'y'
39
40
  }
40
41
  }).size(20).color('red').shape(this.key).style({
41
42
  stroke: '#fff',
@@ -18,6 +18,7 @@ export default abstract class Tile implements ITile {
18
18
  abstract initTileLayer(): Promise<void>;
19
19
  lnglatInBounds(lnglat: ILngLat): boolean;
20
20
  protected getLayerOptions(): {
21
+ textAllowOverlap: boolean;
21
22
  autoFit: boolean;
22
23
  maskLayers: ILayer[];
23
24
  tileMask: boolean;
@@ -52,6 +52,8 @@ var Tile = /*#__PURE__*/function () {
52
52
  var _options$maskLayers;
53
53
  var options = this.parent.getLayerConfig();
54
54
  return _objectSpread(_objectSpread({}, options), {}, {
55
+ textAllowOverlap: true,
56
+ // 文本允许重叠
55
57
  autoFit: false,
56
58
  maskLayers: this.getMaskLayer(),
57
59
  tileMask: isNeedMask(this.parent.type),
@@ -1329,6 +1329,8 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1329
1329
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1330
1330
  // TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
1331
1331
  if (this.encodeDataLength <= 0 && !this.forceRender) {
1332
+ // 数据为空销毁model
1333
+ this.clearModels();
1332
1334
  return this;
1333
1335
  }
1334
1336
  this.hooks.beforeRender.call();
@@ -128,7 +128,6 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
128
128
  width = _this$calDataFrame.width,
129
129
  height = _this$calDataFrame.height;
130
130
  this.rowCount = height; // 当前数据纹理有多少行
131
-
132
131
  this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
133
132
  flipY: true,
134
133
  data: data,
@@ -93,8 +93,12 @@ var TileLayerService = /*#__PURE__*/function () {
93
93
  // tile?.updateVisible(false);
94
94
  // }
95
95
  // }
96
-
97
96
  tile === null || tile === void 0 ? void 0 : tile.updateVisible(sourceTile.isVisible);
97
+ // if (sourceTile.isVisible) {
98
+ // tile?.updateVisible(sourceTile.isVisible);
99
+ // } else {
100
+ // this.removeTile(sourceTile.key);
101
+ // }
98
102
  }
99
103
  }, {
100
104
  key: "isParentLoaded",
@@ -150,8 +154,9 @@ var TileLayerService = /*#__PURE__*/function () {
150
154
  return _ref2.apply(this, arguments);
151
155
  };
152
156
  }());
153
- Promise.all(renders);
154
- case 3:
157
+ _context2.next = 4;
158
+ return Promise.all(renders);
159
+ case 4:
155
160
  case "end":
156
161
  return _context2.stop();
157
162
  }
@@ -37,12 +37,13 @@ var DebugTile = /*#__PURE__*/function (_Tile) {
37
37
  lineLayer = new _line.default().source(sourceOptions.data, sourceOptions.options).size(1).shape('line').color('red');
38
38
  pointLayer = new _point.default({
39
39
  minZoom: this.z - 1,
40
- maxZoom: this.z + 1
40
+ maxZoom: this.z + 1,
41
+ textAllowOverlap: true
41
42
  }).source([pointData], {
42
43
  parser: {
43
44
  type: 'json',
44
- x: 'textLng',
45
- y: 'textLat'
45
+ x: 'x',
46
+ y: 'y'
46
47
  }
47
48
  }).size(20).color('red').shape(this.key).style({
48
49
  stroke: '#fff',
@@ -59,6 +59,8 @@ var Tile = /*#__PURE__*/function () {
59
59
  var _options$maskLayers;
60
60
  var options = this.parent.getLayerConfig();
61
61
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, options), {}, {
62
+ textAllowOverlap: true,
63
+ // 文本允许重叠
62
64
  autoFit: false,
63
65
  maskLayers: this.getMaskLayer(),
64
66
  tileMask: (0, _util.isNeedMask)(this.parent.type),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-layers",
3
- "version": "2.15.4",
3
+ "version": "2.15.5",
4
4
  "description": "L7's collection of built-in layers",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -27,10 +27,10 @@
27
27
  "license": "ISC",
28
28
  "dependencies": {
29
29
  "@antv/async-hook": "^2.2.9",
30
- "@antv/l7-core": "2.15.4",
31
- "@antv/l7-maps": "2.15.4",
32
- "@antv/l7-source": "2.15.4",
33
- "@antv/l7-utils": "2.15.4",
30
+ "@antv/l7-core": "2.15.5",
31
+ "@antv/l7-maps": "2.15.5",
32
+ "@antv/l7-source": "2.15.5",
33
+ "@antv/l7-utils": "2.15.5",
34
34
  "@babel/runtime": "^7.7.7",
35
35
  "@mapbox/martini": "^0.2.0",
36
36
  "@turf/clone": "^6.5.0",
@@ -53,7 +53,7 @@
53
53
  "reflect-metadata": "^0.1.13"
54
54
  },
55
55
  "devDependencies": {
56
- "@antv/l7-test-utils": "2.15.4",
56
+ "@antv/l7-test-utils": "2.15.5",
57
57
  "@types/d3-array": "^2.0.0",
58
58
  "@types/d3-color": "^1.2.2",
59
59
  "@types/d3-interpolate": "1.1.6",
@@ -62,7 +62,7 @@
62
62
  "@types/gl-matrix": "^2.4.5",
63
63
  "@types/lodash": "^4.14.138"
64
64
  },
65
- "gitHead": "ab8429be57c8950a65493e33eb2fa9b38b2a125f",
65
+ "gitHead": "34b1d7f086f6df375fc8c9c03253b864974a66df",
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  }