@antv/l7-layers 2.9.27 → 2.9.28
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/index.js +2 -8
- package/es/canvas/index.js +2 -8
- package/es/citybuliding/building.js +2 -8
- package/es/core/BaseLayer.d.ts +2 -0
- package/es/core/BaseLayer.js +10 -0
- package/es/earth/index.js +1 -5
- package/es/heatmap/index.js +2 -8
- package/es/image/index.js +2 -8
- package/es/line/index.js +2 -8
- package/es/line/models/great_circle.js +4 -4
- package/es/mask/index.js +2 -6
- package/es/plugins/DataMappingPlugin.js +4 -0
- package/es/plugins/FeatureScalePlugin.js +4 -1
- package/es/plugins/LayerModelPlugin.js +2 -0
- package/es/plugins/UpdateStyleAttributePlugin.d.ts +1 -1
- package/es/plugins/UpdateStyleAttributePlugin.js +7 -4
- package/es/point/index.js +2 -10
- package/es/polygon/index.js +2 -8
- package/es/raster/index.js +2 -8
- package/es/raster/models/rasterTile.js +1 -1
- package/es/raster/shaders/raster_2d_frag.glsl +38 -0
- package/es/tile/interface.d.ts +1 -0
- package/es/tile/tileFactory/base.js +5 -2
- package/es/tile/tileFactory/index.js +2 -1
- package/es/tile/tileFactory/point.js +2 -1
- package/es/tile/tileFactory/rasterDataLayer.js +2 -8
- package/es/tile/tileFactory/test.js +4 -2
- package/es/tile/tileFactory/vectorLayer.d.ts +4 -1
- package/es/tile/tileFactory/vectorLayer.js +4 -8
- package/es/tile/tileLayer/baseMapTileLayer.js +1 -1
- package/es/tile/tileLayer/baseTileLayer.js +1 -1
- package/es/tile/tileTest.js +1 -3
- package/es/tile/tmsMapTileLayer.d.ts +0 -2
- package/es/tile/tmsMapTileLayer.js +2 -24
- package/es/tile/tmsTileLayer.d.ts +0 -2
- package/es/tile/tmsTileLayer.js +2 -24
- package/es/tile/utils.d.ts +2 -1
- package/es/tile/utils.js +35 -0
- package/es/wind/index.js +2 -8
- package/lib/Geometry/index.js +2 -8
- package/lib/canvas/index.js +2 -8
- package/lib/citybuliding/building.js +2 -8
- package/lib/core/BaseLayer.js +9 -0
- package/lib/earth/index.js +1 -5
- package/lib/heatmap/index.js +2 -8
- package/lib/image/index.js +2 -8
- package/lib/line/index.js +2 -8
- package/lib/line/models/great_circle.js +4 -4
- package/lib/mask/index.js +2 -6
- package/lib/plugins/DataMappingPlugin.js +4 -0
- package/lib/plugins/FeatureScalePlugin.js +4 -1
- package/lib/plugins/LayerModelPlugin.js +2 -0
- package/lib/plugins/UpdateStyleAttributePlugin.js +7 -4
- package/lib/point/index.js +2 -10
- package/lib/polygon/index.js +2 -8
- package/lib/raster/index.js +2 -8
- package/lib/raster/models/rasterTile.js +1 -1
- package/lib/raster/shaders/raster_2d_frag.glsl +38 -0
- package/lib/tile/tileFactory/base.js +5 -2
- package/lib/tile/tileFactory/index.js +3 -1
- package/lib/tile/tileFactory/point.js +2 -1
- package/lib/tile/tileFactory/rasterDataLayer.js +2 -8
- package/lib/tile/tileFactory/test.js +4 -2
- package/lib/tile/tileFactory/vectorLayer.js +3 -8
- package/lib/tile/tileLayer/baseMapTileLayer.js +1 -1
- package/lib/tile/tileLayer/baseTileLayer.js +1 -1
- package/lib/tile/tileTest.js +1 -3
- package/lib/tile/tmsMapTileLayer.js +1 -23
- package/lib/tile/tmsTileLayer.js +1 -23
- package/lib/tile/utils.js +36 -0
- package/lib/wind/index.js +2 -8
- package/package.json +6 -6
|
@@ -10,6 +10,8 @@ var _exportNames = {
|
|
|
10
10
|
};
|
|
11
11
|
exports.getTileFactory = getTileFactory;
|
|
12
12
|
|
|
13
|
+
var _l7Source = require("@antv/l7-source");
|
|
14
|
+
|
|
13
15
|
var _line = _interopRequireDefault(require("./line"));
|
|
14
16
|
|
|
15
17
|
var _point = _interopRequireDefault(require("./point"));
|
|
@@ -51,7 +53,7 @@ function getTileFactory(tileType, parser) {
|
|
|
51
53
|
return _test.default;
|
|
52
54
|
|
|
53
55
|
case 'RasterLayer':
|
|
54
|
-
if (parser.dataType
|
|
56
|
+
if (_l7Source.rasterDataTypes.includes(parser.dataType)) {
|
|
55
57
|
return _rasterData.default;
|
|
56
58
|
} else {
|
|
57
59
|
return _raster.default;
|
|
@@ -56,7 +56,8 @@ var VectorPolygonTile = /*#__PURE__*/function (_TileFactory) {
|
|
|
56
56
|
tile: tile,
|
|
57
57
|
initOptions: initOptions,
|
|
58
58
|
vectorTileLayer: vectorTileLayer,
|
|
59
|
-
source: source
|
|
59
|
+
source: source,
|
|
60
|
+
needListen: false
|
|
60
61
|
});
|
|
61
62
|
layer.once('modelLoaded', function () {
|
|
62
63
|
tile.layerLoad();
|
|
@@ -56,11 +56,7 @@ var RasterTiffLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
56
56
|
var model = this.getModelType();
|
|
57
57
|
this.layerModel = new model(this);
|
|
58
58
|
this.layerModel.initModels(function (models) {
|
|
59
|
-
_this2.models
|
|
60
|
-
|
|
61
|
-
_this2.emit('modelLoaded', null);
|
|
62
|
-
|
|
63
|
-
_this2.layerService.throttleRenderLayers();
|
|
59
|
+
_this2.dispatchModelLoad(models);
|
|
64
60
|
});
|
|
65
61
|
}
|
|
66
62
|
}, {
|
|
@@ -69,9 +65,7 @@ var RasterTiffLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
69
65
|
var _this3 = this;
|
|
70
66
|
|
|
71
67
|
this.layerModel.buildModels(function (models) {
|
|
72
|
-
_this3.models
|
|
73
|
-
|
|
74
|
-
_this3.emit('modelLoaded', null);
|
|
68
|
+
_this3.dispatchModelLoad(models);
|
|
75
69
|
});
|
|
76
70
|
}
|
|
77
71
|
}, {
|
|
@@ -66,7 +66,8 @@ var TestTile = /*#__PURE__*/function (_TileFactory) {
|
|
|
66
66
|
var properties = features[0].properties;
|
|
67
67
|
var text = new _vectorLayer.default({
|
|
68
68
|
layerType: 'PointLayer',
|
|
69
|
-
usage: 'basemap'
|
|
69
|
+
usage: 'basemap',
|
|
70
|
+
needListen: false
|
|
70
71
|
}).source([properties], {
|
|
71
72
|
parser: {
|
|
72
73
|
type: 'json',
|
|
@@ -82,7 +83,8 @@ var TestTile = /*#__PURE__*/function (_TileFactory) {
|
|
|
82
83
|
});
|
|
83
84
|
var line = new _vectorLayer.default({
|
|
84
85
|
layerType: 'LineLayer',
|
|
85
|
-
usage: 'basemap'
|
|
86
|
+
usage: 'basemap',
|
|
87
|
+
needListen: false
|
|
86
88
|
}).source({
|
|
87
89
|
type: 'FeatureCollection',
|
|
88
90
|
features: features
|
|
@@ -62,6 +62,7 @@ var VectorLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
65
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "needListen", true);
|
|
65
66
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isVector", true);
|
|
66
67
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", _this.layerType || 'vectorLayer');
|
|
67
68
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "pickedID", null);
|
|
@@ -176,11 +177,7 @@ var VectorLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
176
177
|
var model = this.getModelType();
|
|
177
178
|
this.layerModel = new model(this);
|
|
178
179
|
this.layerModel.initModels(function (models) {
|
|
179
|
-
_this4.models
|
|
180
|
-
|
|
181
|
-
_this4.emit('modelLoaded', null);
|
|
182
|
-
|
|
183
|
-
_this4.layerService.throttleRenderLayers();
|
|
180
|
+
_this4.dispatchModelLoad(models);
|
|
184
181
|
});
|
|
185
182
|
}
|
|
186
183
|
}, {
|
|
@@ -189,9 +186,7 @@ var VectorLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
189
186
|
var _this5 = this;
|
|
190
187
|
|
|
191
188
|
this.layerModel.buildModels(function (models) {
|
|
192
|
-
_this5.models
|
|
193
|
-
|
|
194
|
-
_this5.emit('modelLoaded', null);
|
|
189
|
+
_this5.dispatchModelLoad(models);
|
|
195
190
|
});
|
|
196
191
|
}
|
|
197
192
|
}, {
|
|
@@ -139,7 +139,7 @@ var BaseTileLayer = /*#__PURE__*/function () {
|
|
|
139
139
|
zoom: zoom,
|
|
140
140
|
latLonBounds: latLonBounds
|
|
141
141
|
};
|
|
142
|
-
(_this$tilesetManager2 = this.tilesetManager) === null || _this$tilesetManager2 === void 0 ? void 0 : _this$tilesetManager2.
|
|
142
|
+
(_this$tilesetManager2 = this.tilesetManager) === null || _this$tilesetManager2 === void 0 ? void 0 : _this$tilesetManager2.throttleUpdate(zoom, latLonBounds);
|
|
143
143
|
}
|
|
144
144
|
}, {
|
|
145
145
|
key: "bindTilesetEvent",
|
|
@@ -364,7 +364,7 @@ var BaseTileLayer = /*#__PURE__*/function () {
|
|
|
364
364
|
zoom: zoom,
|
|
365
365
|
latLonBounds: latLonBounds
|
|
366
366
|
};
|
|
367
|
-
(_this$tilesetManager2 = this.tilesetManager) === null || _this$tilesetManager2 === void 0 ? void 0 : _this$tilesetManager2.
|
|
367
|
+
(_this$tilesetManager2 = this.tilesetManager) === null || _this$tilesetManager2 === void 0 ? void 0 : _this$tilesetManager2.throttleUpdate(zoom, latLonBounds);
|
|
368
368
|
}
|
|
369
369
|
}, {
|
|
370
370
|
key: "bindTilesetEvent",
|
package/lib/tile/tileTest.js
CHANGED
|
@@ -64,9 +64,7 @@ var TileDebugLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
64
64
|
|
|
65
65
|
this.layerModel = new _tileModel.default(this);
|
|
66
66
|
this.layerModel.initModels(function (models) {
|
|
67
|
-
_this2.models
|
|
68
|
-
|
|
69
|
-
_this2.emit('modelLoaded', null);
|
|
67
|
+
_this2.dispatchModelLoad(models);
|
|
70
68
|
});
|
|
71
69
|
}
|
|
72
70
|
}]);
|
|
@@ -98,7 +98,7 @@ var TMSBaseMapTileLayer = /*#__PURE__*/function (_BaseTileLayer) {
|
|
|
98
98
|
|
|
99
99
|
var _layers = _this2.tileLayerManager.getChilds(tile.layerIDList);
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
(0, _utils.updateTileVisible)(tile, _layers, _this2.layerService);
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
|
|
@@ -107,28 +107,6 @@ var TMSBaseMapTileLayer = /*#__PURE__*/function (_BaseTileLayer) {
|
|
|
107
107
|
this.parent.emit('tiles-loaded', this.tilesetManager.currentTiles);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
}, {
|
|
111
|
-
key: "emitTileVisibleEvent",
|
|
112
|
-
value: function emitTileVisibleEvent(tile, callback) {
|
|
113
|
-
if (tile.isVisible) {
|
|
114
|
-
callback();
|
|
115
|
-
} else {
|
|
116
|
-
(0, _utils.tileAllLoad)(tile, function () {
|
|
117
|
-
callback();
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}, {
|
|
122
|
-
key: "updateTileVisible",
|
|
123
|
-
value: function updateTileVisible(tile, layers) {
|
|
124
|
-
var _this3 = this;
|
|
125
|
-
|
|
126
|
-
this.emitTileVisibleEvent(tile, function () {
|
|
127
|
-
(0, _utils.updateLayersConfig)(layers, 'visible', tile.isVisible);
|
|
128
|
-
|
|
129
|
-
_this3.layerService.reRender();
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
110
|
}]);
|
|
133
111
|
return TMSBaseMapTileLayer;
|
|
134
112
|
}(_baseMapTileLayer.default);
|
package/lib/tile/tmsTileLayer.js
CHANGED
|
@@ -100,7 +100,7 @@ var TMSTileLayer = /*#__PURE__*/function (_BaseTileLayer) {
|
|
|
100
100
|
|
|
101
101
|
var _layers = _this2.tileLayerManager.getChilds(tile.layerIDList);
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
(0, _utils.updateTileVisible)(tile, _layers, _this2.layerService);
|
|
104
104
|
|
|
105
105
|
_this2.setPickState(_layers);
|
|
106
106
|
}
|
|
@@ -111,28 +111,6 @@ var TMSTileLayer = /*#__PURE__*/function (_BaseTileLayer) {
|
|
|
111
111
|
this.parent.emit('tiles-loaded', this.tilesetManager.currentTiles);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
}, {
|
|
115
|
-
key: "emitTileVisibleEvent",
|
|
116
|
-
value: function emitTileVisibleEvent(tile, callback) {
|
|
117
|
-
if (tile.isVisible) {
|
|
118
|
-
callback();
|
|
119
|
-
} else {
|
|
120
|
-
(0, _utils.tileAllLoad)(tile, function () {
|
|
121
|
-
callback();
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}, {
|
|
126
|
-
key: "updateTileVisible",
|
|
127
|
-
value: function updateTileVisible(tile, layers) {
|
|
128
|
-
var _this3 = this;
|
|
129
|
-
|
|
130
|
-
this.emitTileVisibleEvent(tile, function () {
|
|
131
|
-
(0, _utils.updateLayersConfig)(layers, 'visible', tile.isVisible);
|
|
132
|
-
|
|
133
|
-
_this3.layerService.reRender();
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
114
|
}]);
|
|
137
115
|
return TMSTileLayer;
|
|
138
116
|
}(_baseTileLayer.default);
|
package/lib/tile/utils.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.registerLayers = registerLayers;
|
|
|
18
18
|
exports.tileAllLoad = tileAllLoad;
|
|
19
19
|
exports.tileVectorParser = void 0;
|
|
20
20
|
exports.updateLayersConfig = updateLayersConfig;
|
|
21
|
+
exports.updateTileVisible = updateTileVisible;
|
|
21
22
|
|
|
22
23
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
24
|
|
|
@@ -209,4 +210,39 @@ function updateLayersConfig(layers, key, value) {
|
|
|
209
210
|
layer.updateLayerConfig((0, _defineProperty2.default)({}, key, value));
|
|
210
211
|
}
|
|
211
212
|
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function dispatchTileVisibleChange(tile, callback) {
|
|
216
|
+
if (tile.isVisible) {
|
|
217
|
+
callback();
|
|
218
|
+
} else {
|
|
219
|
+
tileAllLoad(tile, function () {
|
|
220
|
+
callback();
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function updateImmediately(layers) {
|
|
226
|
+
var immediately = true;
|
|
227
|
+
layers.map(function (layer) {
|
|
228
|
+
if (layer.type !== 'PointLayer') {
|
|
229
|
+
immediately = false;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
return immediately;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function updateTileVisible(tile, layers, layerService) {
|
|
236
|
+
if (layers.length === 0) return;
|
|
237
|
+
|
|
238
|
+
if (updateImmediately(layers)) {
|
|
239
|
+
updateLayersConfig(layers, 'visible', tile.isVisible);
|
|
240
|
+
layerService.reRender();
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
dispatchTileVisibleChange(tile, function () {
|
|
245
|
+
updateLayersConfig(layers, 'visible', tile.isVisible);
|
|
246
|
+
layerService.reRender();
|
|
247
|
+
});
|
|
212
248
|
}
|
package/lib/wind/index.js
CHANGED
|
@@ -56,11 +56,7 @@ var WindLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
56
56
|
var modelType = this.getModelType();
|
|
57
57
|
this.layerModel = new _models.default[modelType](this);
|
|
58
58
|
this.layerModel.initModels(function (models) {
|
|
59
|
-
_this2.models
|
|
60
|
-
|
|
61
|
-
_this2.emit('modelLoaded', null);
|
|
62
|
-
|
|
63
|
-
_this2.layerService.throttleRenderLayers();
|
|
59
|
+
_this2.dispatchModelLoad(models);
|
|
64
60
|
});
|
|
65
61
|
}
|
|
66
62
|
}, {
|
|
@@ -69,9 +65,7 @@ var WindLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
69
65
|
var _this3 = this;
|
|
70
66
|
|
|
71
67
|
this.layerModel.buildModels(function (models) {
|
|
72
|
-
_this3.models
|
|
73
|
-
|
|
74
|
-
_this3.emit('modelLoaded', null);
|
|
68
|
+
_this3.dispatchModelLoad(models);
|
|
75
69
|
});
|
|
76
70
|
}
|
|
77
71
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.28",
|
|
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.2",
|
|
30
|
-
"@antv/l7-core": "2.9.
|
|
31
|
-
"@antv/l7-maps": "2.9.
|
|
32
|
-
"@antv/l7-source": "2.9.
|
|
33
|
-
"@antv/l7-utils": "2.9.
|
|
30
|
+
"@antv/l7-core": "2.9.28",
|
|
31
|
+
"@antv/l7-maps": "2.9.28",
|
|
32
|
+
"@antv/l7-source": "2.9.28",
|
|
33
|
+
"@antv/l7-utils": "2.9.28",
|
|
34
34
|
"@babel/runtime": "^7.7.7",
|
|
35
35
|
"@mapbox/martini": "^0.2.0",
|
|
36
36
|
"@turf/clone": "^6.5.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/gl-matrix": "^2.4.5",
|
|
62
62
|
"@types/lodash": "^4.14.138"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "bdf2c35d3b632882bf5a8fdd4bd58acfb14b2a97",
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
}
|