@antv/l7-layers 2.9.36 → 2.9.37
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.d.ts +0 -9
- package/es/Geometry/index.js +0 -13
- package/es/Geometry/models/billboard.d.ts +0 -9
- package/es/Geometry/models/billboard.js +0 -13
- package/es/Geometry/models/plane.d.ts +0 -9
- package/es/Geometry/models/plane.js +0 -13
- package/es/Geometry/models/sprite.d.ts +0 -9
- package/es/Geometry/models/sprite.js +0 -13
- package/es/canvas/index.d.ts +0 -9
- package/es/canvas/index.js +0 -13
- package/es/citybuliding/building.d.ts +0 -9
- package/es/citybuliding/building.js +0 -13
- package/es/core/BaseLayer.d.ts +2 -2
- package/es/core/BaseLayer.js +20 -13
- package/es/core/BaseModel.js +1 -0
- package/es/core/triangulation.d.ts +2 -0
- package/es/core/triangulation.js +2 -3
- package/es/heatmap/index.d.ts +0 -9
- package/es/heatmap/index.js +0 -13
- package/es/heatmap/models/heatmap.js +1 -3
- package/es/image/index.d.ts +0 -9
- package/es/image/index.js +0 -13
- package/es/image/models/dataImage.d.ts +0 -9
- package/es/image/models/dataImage.js +1 -15
- package/es/image/models/image.d.ts +0 -9
- package/es/image/models/image.js +1 -15
- package/es/image/models/tileDataImage.d.ts +0 -9
- package/es/image/models/tileDataImage.js +1 -15
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/line/index.d.ts +0 -9
- package/es/line/index.js +0 -13
- package/es/line/models/great_circle.js +3 -3
- package/es/mask/index.d.ts +0 -9
- package/es/mask/index.js +0 -13
- package/es/plugins/DataMappingPlugin.js +2 -2
- package/es/plugins/DataSourcePlugin.js +1 -1
- package/es/plugins/FeatureScalePlugin.js +5 -3
- package/es/plugins/LayerModelPlugin.js +1 -1
- package/es/plugins/LightingPlugin.js +1 -1
- package/es/plugins/RegisterStyleAttributePlugin.js +8 -13
- package/es/plugins/UpdateStyleAttributePlugin.js +1 -1
- package/es/point/index.d.ts +0 -9
- package/es/point/index.js +0 -13
- package/es/point/models/earthFill.js +2 -2
- package/es/point/models/image.js +1 -1
- package/es/polygon/index.d.ts +0 -9
- package/es/polygon/index.js +0 -13
- package/es/polygon/models/ocean.js +1 -2
- package/es/polygon/models/water.js +1 -2
- package/es/raster/index.d.ts +0 -9
- package/es/raster/index.js +0 -13
- package/es/raster/models/raster.js +1 -2
- package/es/raster/models/rasterRgb.js +1 -2
- package/es/raster/models/rasterTile.js +1 -2
- package/es/raster/raster.d.ts +0 -9
- package/es/raster/raster.js +0 -13
- package/es/tile/interaction/TilePickService.d.ts +16 -0
- package/es/tile/{manager/tilePickerManager.js → interaction/TilePickService.js} +19 -84
- package/es/tile/interaction/getFeatureData.d.ts +0 -0
- package/es/tile/interaction/getFeatureData.js +0 -0
- package/es/tile/interaction/getRasterData.d.ts +4 -0
- package/es/tile/interaction/getRasterData.js +70 -0
- package/es/tile/interaction/utils.d.ts +11 -0
- package/es/tile/interaction/utils.js +97 -0
- package/es/tile/interface.d.ts +1 -2
- package/es/tile/manager/{baseTileManager.d.ts → base.d.ts} +8 -5
- package/es/tile/manager/{baseTileManager.js → base.js} +53 -14
- package/es/tile/manager/layerManager.d.ts +19 -0
- package/es/tile/manager/{tileLayerManager.js → layerManager.js} +75 -76
- package/es/tile/manager/{baseMapTileLayerManager.d.ts → mapLayerManager.d.ts} +2 -2
- package/es/tile/manager/{baseMapTileLayerManager.js → mapLayerManager.js} +4 -4
- package/es/tile/models/tileModel.js +4 -4
- package/es/tile/render/TileRenderService.d.ts +10 -0
- package/es/tile/render/TileRenderService.js +68 -0
- package/es/tile/{manager/tileConfigManager.d.ts → style/TileStyleService.d.ts} +2 -2
- package/es/tile/{manager/tileConfigManager.js → style/TileStyleService.js} +8 -11
- package/es/tile/style/constants.d.ts +13 -0
- package/es/tile/style/constants.js +17 -0
- package/es/tile/style/utils.d.ts +9 -0
- package/es/tile/style/utils.js +139 -0
- package/es/tile/tileFactory/base.d.ts +8 -7
- package/es/tile/tileFactory/base.js +116 -187
- package/es/tile/tileFactory/layers/rasterDataLayer.d.ts +11 -0
- package/es/tile/tileFactory/{rasterDataLayer.js → layers/rasterDataLayer.js} +3 -16
- package/es/tile/{tileTest.d.ts → tileFactory/layers/tileTest.d.ts} +2 -2
- package/es/tile/{tileTest.js → tileFactory/layers/tileTest.js} +2 -2
- package/es/tile/tileFactory/{vectorLayer.d.ts → layers/vectorLayer.d.ts} +9 -17
- package/es/tile/tileFactory/{vectorLayer.js → layers/vectorLayer.js} +9 -20
- package/es/tile/tileFactory/line.js +0 -3
- package/es/tile/tileFactory/mask.js +0 -3
- package/es/tile/tileFactory/point.js +0 -3
- package/es/tile/tileFactory/polygon.js +0 -3
- package/es/tile/tileFactory/raster.js +0 -3
- package/es/tile/tileFactory/rasterData.js +2 -7
- package/es/tile/tileFactory/test.js +1 -12
- package/es/tile/tileLayer/MapTileLayer.d.ts +6 -0
- package/es/tile/tileLayer/MapTileLayer.js +48 -0
- package/es/tile/tileLayer/TileLayer.d.ts +22 -0
- package/es/tile/tileLayer/TileLayer.js +198 -0
- package/es/tile/tileLayer/{baseMapTileLayer.d.ts → base.d.ts} +19 -16
- package/es/tile/tileLayer/{baseMapTileLayer.js → base.js} +118 -101
- package/es/tile/utils.d.ts +7 -4
- package/es/tile/utils.js +14 -74
- package/es/utils/dataMappingStyle.js +0 -3
- package/es/utils/extrude_polyline.d.ts +1 -0
- package/es/utils/extrude_polyline.js +5 -3
- package/es/utils/multiPassRender.js +0 -1
- package/es/wind/index.d.ts +0 -9
- package/es/wind/index.js +0 -13
- package/es/wind/models/wind.d.ts +0 -9
- package/es/wind/models/wind.js +1 -15
- package/lib/Geometry/index.js +0 -13
- package/lib/Geometry/models/billboard.js +0 -13
- package/lib/Geometry/models/plane.js +0 -13
- package/lib/Geometry/models/sprite.js +0 -13
- package/lib/canvas/index.js +0 -13
- package/lib/citybuliding/building.js +0 -13
- package/lib/core/BaseLayer.js +20 -13
- package/lib/core/BaseModel.js +1 -0
- package/lib/core/triangulation.js +2 -1
- package/lib/heatmap/index.js +0 -13
- package/lib/heatmap/models/heatmap.js +1 -3
- package/lib/image/index.js +0 -13
- package/lib/image/models/dataImage.js +1 -15
- package/lib/image/models/image.js +1 -15
- package/lib/image/models/tileDataImage.js +1 -15
- package/lib/index.js +1 -1
- package/lib/line/index.js +0 -13
- package/lib/line/models/great_circle.js +3 -3
- package/lib/mask/index.js +0 -13
- package/lib/plugins/DataMappingPlugin.js +2 -2
- package/lib/plugins/DataSourcePlugin.js +1 -1
- package/lib/plugins/FeatureScalePlugin.js +5 -3
- package/lib/plugins/LayerModelPlugin.js +1 -1
- package/lib/plugins/LightingPlugin.js +1 -1
- package/lib/plugins/RegisterStyleAttributePlugin.js +9 -13
- package/lib/plugins/UpdateStyleAttributePlugin.js +1 -1
- package/lib/point/index.js +0 -13
- package/lib/point/models/earthFill.js +2 -2
- package/lib/point/models/image.js +1 -1
- package/lib/polygon/index.js +0 -13
- package/lib/polygon/models/ocean.js +1 -2
- package/lib/polygon/models/water.js +1 -2
- package/lib/raster/index.js +0 -13
- package/lib/raster/models/raster.js +1 -2
- package/lib/raster/models/rasterRgb.js +1 -2
- package/lib/raster/models/rasterTile.js +1 -2
- package/lib/raster/raster.js +0 -13
- package/lib/tile/{manager/tilePickerManager.js → interaction/TilePickService.js} +20 -82
- package/lib/tile/interaction/getFeatureData.js +1 -0
- package/lib/tile/interaction/getRasterData.js +83 -0
- package/lib/tile/interaction/utils.js +120 -0
- package/lib/tile/manager/{baseTileManager.js → base.js} +56 -16
- package/lib/tile/manager/{tileLayerManager.js → layerManager.js} +77 -75
- package/lib/tile/manager/{baseMapTileLayerManager.js → mapLayerManager.js} +4 -4
- package/lib/tile/models/tileModel.js +4 -4
- package/lib/tile/render/TileRenderService.js +78 -0
- package/lib/tile/{manager/tileConfigManager.js → style/TileStyleService.js} +9 -9
- package/lib/tile/style/constants.js +26 -0
- package/lib/tile/style/utils.js +163 -0
- package/lib/tile/tileFactory/base.js +117 -187
- package/lib/tile/tileFactory/{rasterDataLayer.js → layers/rasterDataLayer.js} +3 -16
- package/lib/tile/{tileTest.js → tileFactory/layers/tileTest.js} +2 -2
- package/lib/tile/tileFactory/{vectorLayer.js → layers/vectorLayer.js} +8 -20
- package/lib/tile/tileFactory/line.js +0 -3
- package/lib/tile/tileFactory/mask.js +0 -3
- package/lib/tile/tileFactory/point.js +0 -3
- package/lib/tile/tileFactory/polygon.js +0 -3
- package/lib/tile/tileFactory/raster.js +0 -3
- package/lib/tile/tileFactory/rasterData.js +2 -8
- package/lib/tile/tileFactory/test.js +1 -13
- package/lib/tile/tileLayer/MapTileLayer.js +63 -0
- package/lib/tile/tileLayer/TileLayer.js +215 -0
- package/lib/tile/tileLayer/{baseMapTileLayer.js → base.js} +119 -96
- package/lib/tile/utils.js +19 -86
- package/lib/utils/dataMappingStyle.js +0 -3
- package/lib/utils/extrude_polyline.js +5 -2
- package/lib/utils/multiPassRender.js +0 -1
- package/lib/wind/index.js +0 -13
- package/lib/wind/models/wind.js +1 -15
- package/package.json +6 -6
- package/es/tile/manager/tileLayerManager.d.ts +0 -15
- package/es/tile/manager/tilePickerManager.d.ts +0 -21
- package/es/tile/tileFactory/rasterDataLayer.d.ts +0 -20
- package/es/tile/tileLayer/baseTileLayer.d.ts +0 -48
- package/es/tile/tileLayer/baseTileLayer.js +0 -420
- package/es/tile/tmsMapTileLayer.d.ts +0 -7
- package/es/tile/tmsMapTileLayer.js +0 -97
- package/es/tile/tmsTileLayer.d.ts +0 -7
- package/es/tile/tmsTileLayer.js +0 -101
- package/lib/tile/tileLayer/baseTileLayer.js +0 -429
- package/lib/tile/tmsMapTileLayer.js +0 -114
- package/lib/tile/tmsTileLayer.js +0 -118
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { DOM } from '@antv/l7-utils';
|
|
3
|
+
export function readRasterValue(tile, mapService, x, y) {
|
|
4
|
+
var _tile$bboxPolygon, _tile$data, _tile$data2, _tile$data3;
|
|
5
|
+
|
|
6
|
+
var bbox = (tile === null || tile === void 0 ? void 0 : (_tile$bboxPolygon = tile.bboxPolygon) === null || _tile$bboxPolygon === void 0 ? void 0 : _tile$bboxPolygon.bbox) || [0, 0, 10, -10];
|
|
7
|
+
|
|
8
|
+
var _bbox = _slicedToArray(bbox, 4),
|
|
9
|
+
_bbox$ = _bbox[0],
|
|
10
|
+
minLng = _bbox$ === void 0 ? 0 : _bbox$,
|
|
11
|
+
_bbox$2 = _bbox[1],
|
|
12
|
+
minLat = _bbox$2 === void 0 ? 0 : _bbox$2,
|
|
13
|
+
_bbox$3 = _bbox[2],
|
|
14
|
+
maxLng = _bbox$3 === void 0 ? 10 : _bbox$3,
|
|
15
|
+
_bbox$4 = _bbox[3],
|
|
16
|
+
maxLat = _bbox$4 === void 0 ? -10 : _bbox$4;
|
|
17
|
+
|
|
18
|
+
var tileXY = mapService.lngLatToContainer([minLng, minLat]);
|
|
19
|
+
var tileMaxXY = mapService.lngLatToContainer([maxLng, maxLat]);
|
|
20
|
+
var tilePixelWidth = tileMaxXY.x - tileXY.x;
|
|
21
|
+
var tilePixelHeight = tileXY.y - tileMaxXY.y;
|
|
22
|
+
var pos = [(x - tileXY.x) / tilePixelWidth, // x
|
|
23
|
+
(y - tileMaxXY.y) / tilePixelHeight // y
|
|
24
|
+
];
|
|
25
|
+
var tileWidth = (tile === null || tile === void 0 ? void 0 : (_tile$data = tile.data) === null || _tile$data === void 0 ? void 0 : _tile$data.width) || 1;
|
|
26
|
+
var tileHeight = (tile === null || tile === void 0 ? void 0 : (_tile$data2 = tile.data) === null || _tile$data2 === void 0 ? void 0 : _tile$data2.height) || 1;
|
|
27
|
+
var indexX = Math.floor(pos[0] * tileWidth);
|
|
28
|
+
var indexY = Math.floor(pos[1] * tileHeight);
|
|
29
|
+
var index = Math.max(0, indexY - 1) * tileWidth + indexX;
|
|
30
|
+
var data = tile === null || tile === void 0 ? void 0 : (_tile$data3 = tile.data) === null || _tile$data3 === void 0 ? void 0 : _tile$data3.data[index];
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
export function readPixel(x, y, rendererService) {
|
|
34
|
+
var readPixels = rendererService.readPixels,
|
|
35
|
+
getContainer = rendererService.getContainer;
|
|
36
|
+
var xInDevicePixel = x * DOM.DPR;
|
|
37
|
+
var yInDevicePixel = y * DOM.DPR;
|
|
38
|
+
|
|
39
|
+
var _getContainerSize = getContainerSize(getContainer()),
|
|
40
|
+
width = _getContainerSize.width,
|
|
41
|
+
height = _getContainerSize.height;
|
|
42
|
+
|
|
43
|
+
width *= DOM.DPR;
|
|
44
|
+
height *= DOM.DPR;
|
|
45
|
+
|
|
46
|
+
if (xInDevicePixel > width - 1 * DOM.DPR || xInDevicePixel < 0 || yInDevicePixel > height - 1 * DOM.DPR || yInDevicePixel < 0) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var pickedColors = readPixels({
|
|
51
|
+
x: Math.floor(xInDevicePixel),
|
|
52
|
+
// 视口坐标系原点在左上,而 WebGL 在左下,需要翻转 Y 轴
|
|
53
|
+
y: Math.floor(height - (y + 1) * DOM.DPR),
|
|
54
|
+
width: 1,
|
|
55
|
+
height: 1,
|
|
56
|
+
data: new Uint8Array(1 * 1 * 4)
|
|
57
|
+
});
|
|
58
|
+
return pickedColors;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function getContainerSize(container) {
|
|
62
|
+
if (container.getContext) {
|
|
63
|
+
return {
|
|
64
|
+
width: container.width / DOM.DPR,
|
|
65
|
+
height: container.height / DOM.DPR
|
|
66
|
+
};
|
|
67
|
+
} else {
|
|
68
|
+
return container.getBoundingClientRect();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ILayer } from '@antv/l7-core';
|
|
2
|
+
export declare function clearPickState(layers: ILayer[]): void;
|
|
3
|
+
export declare function setSelect(layers: ILayer[], pickedColors: any, renderList: ILayer[]): undefined;
|
|
4
|
+
export declare function setHighlight(layers: ILayer[], pickedColors: any): void;
|
|
5
|
+
export declare function setPickState(layers: ILayer[], pickColors: {
|
|
6
|
+
select: any;
|
|
7
|
+
active: any;
|
|
8
|
+
}): void;
|
|
9
|
+
export declare function selectFeature(layer: ILayer, pickedColors: Uint8Array | undefined): void;
|
|
10
|
+
export declare function setFeatureSelect(color: any, layers: ILayer[]): void;
|
|
11
|
+
export declare function setFeatureActive(color: any, layers: ILayer[]): void;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { decodePickingColor } from '@antv/l7-utils';
|
|
3
|
+
export function clearPickState(layers) {
|
|
4
|
+
layers.filter(function (layer) {
|
|
5
|
+
return layer.inited && layer.isVisible();
|
|
6
|
+
}).filter(function (layer) {
|
|
7
|
+
return layer.getCurrentSelectedId() !== null;
|
|
8
|
+
}).map(function (layer) {
|
|
9
|
+
selectFeature(layer, new Uint8Array([0, 0, 0, 0]));
|
|
10
|
+
layer.setCurrentSelectedId(null);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export function setSelect(layers, pickedColors, renderList) {
|
|
14
|
+
var selectedId = decodePickingColor(pickedColors);
|
|
15
|
+
var pickColor;
|
|
16
|
+
layers.map(function (layer) {
|
|
17
|
+
if (layer.getCurrentSelectedId() === null || selectedId !== layer.getCurrentSelectedId()) {
|
|
18
|
+
selectFeature(layer, pickedColors);
|
|
19
|
+
layer.setCurrentSelectedId(selectedId);
|
|
20
|
+
pickColor = pickedColors;
|
|
21
|
+
} else {
|
|
22
|
+
selectFeature(layer, new Uint8Array([0, 0, 0, 0])); // toggle select
|
|
23
|
+
|
|
24
|
+
layer.setCurrentSelectedId(null);
|
|
25
|
+
pickColor = null;
|
|
26
|
+
}
|
|
27
|
+
}); // unselect normal layer
|
|
28
|
+
|
|
29
|
+
renderList.filter(function (layer) {
|
|
30
|
+
return layer.inited && !layer.isVector && layer.isVisible() && layer.needPick('click');
|
|
31
|
+
}).filter(function (layer) {
|
|
32
|
+
return layer.getCurrentSelectedId() !== null;
|
|
33
|
+
}).map(function (layer) {
|
|
34
|
+
selectFeature(layer, new Uint8Array([0, 0, 0, 0]));
|
|
35
|
+
layer.setCurrentSelectedId(null);
|
|
36
|
+
});
|
|
37
|
+
return pickColor;
|
|
38
|
+
}
|
|
39
|
+
export function setHighlight(layers, pickedColors) {
|
|
40
|
+
var pickId = decodePickingColor(pickedColors);
|
|
41
|
+
layers.filter(function (layer) {
|
|
42
|
+
return layer.inited && layer.isVisible() && layer.isVector;
|
|
43
|
+
}) // Tip: 使用 vectorLayer 上的 pickID 优化高亮操作(过滤重复操作)
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
.filter(function (layer) {
|
|
46
|
+
return layer.getPickID() !== pickId;
|
|
47
|
+
}).map(function (layer) {
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
layer.setPickID(pickId);
|
|
50
|
+
layer.hooks.beforeHighlight.call(pickedColors);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export function setPickState(layers, pickColors) {
|
|
54
|
+
if (pickColors.select) {
|
|
55
|
+
layers.map(function (layer) {
|
|
56
|
+
// if(layer.modelLoaded) {
|
|
57
|
+
// selectFeature(layer, this.pickColors.select);
|
|
58
|
+
// } else {
|
|
59
|
+
// layer.once('modelLoaded', () => {
|
|
60
|
+
// selectFeature(layer, this.pickColors.select);
|
|
61
|
+
// })
|
|
62
|
+
// }
|
|
63
|
+
selectFeature(layer, pickColors.select);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (pickColors.active) {
|
|
68
|
+
layers.filter(function (layer) {
|
|
69
|
+
return layer.inited && layer.isVisible();
|
|
70
|
+
}).map(function (layer) {
|
|
71
|
+
layer.hooks.beforeHighlight.call(pickColors.active);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function selectFeature(layer, pickedColors) {
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
var _pickedColors = _slicedToArray(pickedColors, 3),
|
|
78
|
+
r = _pickedColors[0],
|
|
79
|
+
g = _pickedColors[1],
|
|
80
|
+
b = _pickedColors[2];
|
|
81
|
+
|
|
82
|
+
layer.hooks.beforeSelect.call([r, g, b]);
|
|
83
|
+
}
|
|
84
|
+
export function setFeatureSelect(color, layers) {
|
|
85
|
+
var id = decodePickingColor(color);
|
|
86
|
+
layers.map(function (layer) {
|
|
87
|
+
selectFeature(layer, color);
|
|
88
|
+
layer.setCurrentSelectedId(id);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
export function setFeatureActive(color, layers) {
|
|
92
|
+
var id = decodePickingColor(color);
|
|
93
|
+
layers.map(function (layer) {
|
|
94
|
+
layer.hooks.beforeHighlight.call(color);
|
|
95
|
+
layer.setCurrentPickId(id);
|
|
96
|
+
});
|
|
97
|
+
}
|
package/es/tile/interface.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILayer, IMapService, IRendererService,
|
|
1
|
+
import { ILayer, IMapService, IRendererService, ISource, ISubLayerInitOptions } from '@antv/l7-core';
|
|
2
2
|
import { Tile } from '@antv/l7-utils';
|
|
3
3
|
export declare type Timeout = any;
|
|
4
4
|
export declare type CacheEvent = 'click' | 'mousemove' | 'mouseup' | 'mousedown' | 'contextmenu';
|
|
@@ -25,5 +25,4 @@ export interface ITileFactory {
|
|
|
25
25
|
};
|
|
26
26
|
createLayer(option: ILayerTileConfig): ILayer;
|
|
27
27
|
updateStyle(styles: ITileStyles): string;
|
|
28
|
-
setStyleAttributeField(layer: ILayer, type: ScaleAttributeType, value: IScaleValue): void;
|
|
29
28
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ILayer, IRendererService, IMapService, ISubLayerInitOptions } from '@antv/l7-core';
|
|
2
2
|
import { Tile } from '@antv/l7-utils';
|
|
3
3
|
import { ITileFactory } from '../tileFactory';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class Base {
|
|
5
5
|
sourceLayer: string;
|
|
6
6
|
parent: ILayer;
|
|
7
7
|
children: ILayer[];
|
|
@@ -9,15 +9,18 @@ export declare class TileManager {
|
|
|
9
9
|
rendererService: IRendererService;
|
|
10
10
|
protected tileFactory: ITileFactory;
|
|
11
11
|
protected initOptions: ISubLayerInitOptions;
|
|
12
|
-
|
|
12
|
+
private tileCache;
|
|
13
|
+
hasTile(tile: Tile): boolean;
|
|
14
|
+
addTile(tile: Tile): {
|
|
13
15
|
layers: ILayer[];
|
|
14
16
|
layerIDList: string[];
|
|
15
17
|
};
|
|
18
|
+
removeTile(tile: Tile): void;
|
|
16
19
|
addChild(layer: ILayer): void;
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
addChildren(layers: ILayer[]): void;
|
|
21
|
+
removeChildren(layerIDList: string[], refresh?: boolean): void;
|
|
19
22
|
removeChild(layer: ILayer): void;
|
|
20
|
-
|
|
23
|
+
getChildren(layerIDList: string[]): ILayer[];
|
|
21
24
|
getChild(layerID: string): ILayer;
|
|
22
25
|
clearChild(): void;
|
|
23
26
|
hasChild(layer: ILayer): boolean;
|
|
@@ -1,16 +1,55 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
5
|
import { getTileFactory } from "../tileFactory";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { registerLayers } from "../utils";
|
|
7
|
+
export var Base = /*#__PURE__*/function () {
|
|
8
|
+
function Base() {
|
|
9
|
+
_classCallCheck(this, Base);
|
|
10
|
+
|
|
11
|
+
_defineProperty(this, "tileCache", new Map());
|
|
8
12
|
}
|
|
9
13
|
|
|
10
|
-
_createClass(
|
|
11
|
-
key: "
|
|
12
|
-
value: function
|
|
13
|
-
return this.
|
|
14
|
+
_createClass(Base, [{
|
|
15
|
+
key: "hasTile",
|
|
16
|
+
value: function hasTile(tile) {
|
|
17
|
+
return !!this.tileCache.has(tile.key);
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
key: "addTile",
|
|
21
|
+
value: function addTile(tile) {
|
|
22
|
+
var _tile$layerIDList;
|
|
23
|
+
|
|
24
|
+
// oldTile 存在的时候暂时直接结束
|
|
25
|
+
// TODO:合并不存在的时候
|
|
26
|
+
if (this.hasTile(tile)) return {
|
|
27
|
+
layers: [],
|
|
28
|
+
layerIDList: []
|
|
29
|
+
}; // 存储当前 tile
|
|
30
|
+
|
|
31
|
+
this.tileCache.set(tile.key, tile); // 创建 tile 对应的 layers
|
|
32
|
+
|
|
33
|
+
var layerCollections = this.tileFactory.createTile(tile, this.initOptions); // regist layer 将创建出来的 layer 进行注册初始化操作
|
|
34
|
+
|
|
35
|
+
registerLayers(this.parent, layerCollections.layers);
|
|
36
|
+
|
|
37
|
+
(_tile$layerIDList = tile.layerIDList).push.apply(_tile$layerIDList, _toConsumableArray(layerCollections.layerIDList)); // add layer into layerGroup
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
this.addChildren(layerCollections.layers);
|
|
41
|
+
layerCollections.layers.map(function (layer) {
|
|
42
|
+
layer.once('modelLoaded', function () {
|
|
43
|
+
tile.layerLoad();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
return layerCollections;
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "removeTile",
|
|
50
|
+
value: function removeTile(tile) {
|
|
51
|
+
this.tileCache.delete(tile.key);
|
|
52
|
+
this.removeChildren(tile.layerIDList, false);
|
|
14
53
|
}
|
|
15
54
|
}, {
|
|
16
55
|
key: "addChild",
|
|
@@ -18,15 +57,15 @@ export var TileManager = /*#__PURE__*/function () {
|
|
|
18
57
|
this.children.push(layer);
|
|
19
58
|
}
|
|
20
59
|
}, {
|
|
21
|
-
key: "
|
|
22
|
-
value: function
|
|
60
|
+
key: "addChildren",
|
|
61
|
+
value: function addChildren(layers) {
|
|
23
62
|
var _this$children;
|
|
24
63
|
|
|
25
64
|
(_this$children = this.children).push.apply(_this$children, _toConsumableArray(layers));
|
|
26
65
|
}
|
|
27
66
|
}, {
|
|
28
|
-
key: "
|
|
29
|
-
value: function
|
|
67
|
+
key: "removeChildren",
|
|
68
|
+
value: function removeChildren(layerIDList) {
|
|
30
69
|
var refresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
31
70
|
var remveLayerList = [];
|
|
32
71
|
var cacheLayerList = [];
|
|
@@ -50,8 +89,8 @@ export var TileManager = /*#__PURE__*/function () {
|
|
|
50
89
|
layer.destroy();
|
|
51
90
|
}
|
|
52
91
|
}, {
|
|
53
|
-
key: "
|
|
54
|
-
value: function
|
|
92
|
+
key: "getChildren",
|
|
93
|
+
value: function getChildren(layerIDList) {
|
|
55
94
|
return this.children.filter(function (child) {
|
|
56
95
|
return layerIDList.includes(child.id);
|
|
57
96
|
});
|
|
@@ -103,5 +142,5 @@ export var TileManager = /*#__PURE__*/function () {
|
|
|
103
142
|
value: function destroy() {}
|
|
104
143
|
}]);
|
|
105
144
|
|
|
106
|
-
return
|
|
145
|
+
return Base;
|
|
107
146
|
}();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IInteractionTarget, ILayer, IMapService, IPickingService, IRendererService, ITileLayerManager, ITilePickService, ITileRenderService, ITransform } from '@antv/l7-core';
|
|
2
|
+
import { Base } from './base';
|
|
3
|
+
import { ITileStyleService } from '../style/TileStyleService';
|
|
4
|
+
export declare class TileLayerManager extends Base implements ITileLayerManager {
|
|
5
|
+
tilePickService: ITilePickService;
|
|
6
|
+
tileStyleService: ITileStyleService;
|
|
7
|
+
tileRenderService: ITileRenderService;
|
|
8
|
+
private transforms;
|
|
9
|
+
constructor(parent: ILayer, mapService: IMapService, rendererService: IRendererService, pickingService: IPickingService, transforms: ITransform[]);
|
|
10
|
+
render(): void;
|
|
11
|
+
pickLayers(target: IInteractionTarget): boolean;
|
|
12
|
+
private setSubLayerInitOption;
|
|
13
|
+
private getInitOptionValue;
|
|
14
|
+
private setInitOptionValue;
|
|
15
|
+
private setConfigListener;
|
|
16
|
+
private updateAttribute;
|
|
17
|
+
private updateStyle;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
@@ -8,13 +8,16 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
8
8
|
|
|
9
9
|
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; } }
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { Base } from "./base";
|
|
12
12
|
import { generateColorRamp } from '@antv/l7-utils';
|
|
13
|
-
import { getLayerShape, getMaskValue
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import { getLayerShape, getMaskValue } from "../utils";
|
|
14
|
+
import { TileStyleService } from "../style/TileStyleService";
|
|
15
|
+
import { TilePickService } from "../interaction/TilePickService";
|
|
16
|
+
import { TileRenderService } from "../render/TileRenderService";
|
|
17
|
+
import { styles, Attributes } from "../style/constants";
|
|
18
|
+
import { updateTexture, updateLayersConfig, setStyleAttributeField } from "../style/utils";
|
|
19
|
+
export var TileLayerManager = /*#__PURE__*/function (_Base) {
|
|
20
|
+
_inherits(TileLayerManager, _Base);
|
|
18
21
|
|
|
19
22
|
var _super = _createSuper(TileLayerManager);
|
|
20
23
|
|
|
@@ -29,8 +32,9 @@ export var TileLayerManager = /*#__PURE__*/function (_TileManager) {
|
|
|
29
32
|
_this.mapService = mapService;
|
|
30
33
|
_this.rendererService = rendererService;
|
|
31
34
|
_this.transforms = transforms;
|
|
32
|
-
_this.
|
|
33
|
-
_this.
|
|
35
|
+
_this.tileRenderService = new TileRenderService(rendererService);
|
|
36
|
+
_this.tilePickService = new TilePickService(parent, rendererService, pickingService, _this.children, _this.tileRenderService);
|
|
37
|
+
_this.tileStyleService = new TileStyleService();
|
|
34
38
|
|
|
35
39
|
_this.setSubLayerInitOption();
|
|
36
40
|
|
|
@@ -44,17 +48,13 @@ export var TileLayerManager = /*#__PURE__*/function (_TileManager) {
|
|
|
44
48
|
_createClass(TileLayerManager, [{
|
|
45
49
|
key: "render",
|
|
46
50
|
value: function render() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(_this$tileConfigManag = this.tileConfigManager) === null || _this$tileConfigManag === void 0 ? void 0 : _this$tileConfigManag.checkConfig(this.parent);
|
|
50
|
-
(_this$tilePickManager = this.tilePickManager) === null || _this$tilePickManager === void 0 ? void 0 : _this$tilePickManager.normalRender(this.children);
|
|
51
|
+
this.tileStyleService.checkConfig(this.parent);
|
|
52
|
+
this.tileRenderService.render(this.children);
|
|
51
53
|
}
|
|
52
54
|
}, {
|
|
53
55
|
key: "pickLayers",
|
|
54
56
|
value: function pickLayers(target) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return (_this$tilePickManager2 = this.tilePickManager) === null || _this$tilePickManager2 === void 0 ? void 0 : _this$tilePickManager2.pickRender(this.children, target);
|
|
57
|
+
return this.tilePickService.pick(this.children, target);
|
|
58
58
|
}
|
|
59
59
|
}, {
|
|
60
60
|
key: "setSubLayerInitOption",
|
|
@@ -101,8 +101,8 @@ export var TileLayerManager = /*#__PURE__*/function (_TileManager) {
|
|
|
101
101
|
_ref$pixelConstantRGB = _ref.pixelConstantRGB,
|
|
102
102
|
pixelConstantRGB = _ref$pixelConstantRGB === void 0 ? 0.1 : _ref$pixelConstantRGB;
|
|
103
103
|
|
|
104
|
-
var colorValue = this.
|
|
105
|
-
var sizeValue = this.
|
|
104
|
+
var colorValue = this.tileStyleService.getAttributeScale(this.parent, 'color');
|
|
105
|
+
var sizeValue = this.tileStyleService.getAttributeScale(this.parent, 'size');
|
|
106
106
|
var source = this.parent.getSource();
|
|
107
107
|
|
|
108
108
|
var _ref2 = (source === null || source === void 0 ? void 0 : (_source$data = source.data) === null || _source$data === void 0 ? void 0 : _source$data.tilesetOptions) || {},
|
|
@@ -152,56 +152,53 @@ export var TileLayerManager = /*#__PURE__*/function (_TileManager) {
|
|
|
152
152
|
this.initOptions.colorTexture = colorTexture;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
+
}, {
|
|
156
|
+
key: "getInitOptionValue",
|
|
157
|
+
value: function getInitOptionValue(field) {
|
|
158
|
+
var _this$parent$getAttri, _this$parent$getAttri2, _this$parent$getAttri3;
|
|
159
|
+
|
|
160
|
+
switch (field) {
|
|
161
|
+
case 'color':
|
|
162
|
+
return (_this$parent$getAttri = this.parent.getAttribute('color')) === null || _this$parent$getAttri === void 0 ? void 0 : _this$parent$getAttri.scale;
|
|
163
|
+
|
|
164
|
+
case 'shape':
|
|
165
|
+
return (_this$parent$getAttri2 = this.parent.getAttribute('shape')) === null || _this$parent$getAttri2 === void 0 ? void 0 : _this$parent$getAttri2.scale;
|
|
166
|
+
|
|
167
|
+
case 'size':
|
|
168
|
+
return (_this$parent$getAttri3 = this.parent.getAttribute('size')) === null || _this$parent$getAttri3 === void 0 ? void 0 : _this$parent$getAttri3.scale;
|
|
169
|
+
// @ts-ignore
|
|
170
|
+
|
|
171
|
+
default:
|
|
172
|
+
return this.initOptions[field];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}, {
|
|
176
|
+
key: "setInitOptionValue",
|
|
177
|
+
value: function setInitOptionValue(field, value) {
|
|
178
|
+
// @ts-ignore
|
|
179
|
+
this.initOptions[field] = value;
|
|
180
|
+
}
|
|
155
181
|
}, {
|
|
156
182
|
key: "setConfigListener",
|
|
157
183
|
value: function setConfigListener() {
|
|
158
184
|
var _this2 = this;
|
|
159
185
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
this.
|
|
165
|
-
|
|
166
|
-
if (this.parent.type === 'RasterLayer') {
|
|
167
|
-
// Raster Tile Layer Need Listen
|
|
168
|
-
this.tileConfigManager.setConfig('rampColors', this.initOptions.rampColors);
|
|
169
|
-
this.tileConfigManager.setConfig('domain', this.initOptions.domain);
|
|
170
|
-
this.tileConfigManager.setConfig('clampHigh', this.initOptions.clampHigh);
|
|
171
|
-
this.tileConfigManager.setConfig('clampLow', this.initOptions.clampLow);
|
|
172
|
-
this.tileConfigManager.setConfig('pixelConstant', this.initOptions.pixelConstant);
|
|
173
|
-
this.tileConfigManager.setConfig('pixelConstantR', this.initOptions.pixelConstantR);
|
|
174
|
-
this.tileConfigManager.setConfig('pixelConstantG', this.initOptions.pixelConstantG);
|
|
175
|
-
this.tileConfigManager.setConfig('pixelConstantB', this.initOptions.pixelConstantB);
|
|
176
|
-
this.tileConfigManager.setConfig('pixelConstantRGB', this.initOptions.pixelConstantRGB);
|
|
177
|
-
} else {
|
|
178
|
-
var _this$parent$getAttri, _this$parent$getAttri2, _this$parent$getAttri3;
|
|
179
|
-
|
|
180
|
-
// Vector Tile Layer Need Listen
|
|
181
|
-
this.tileConfigManager.setConfig('stroke', this.initOptions.stroke);
|
|
182
|
-
this.tileConfigManager.setConfig('strokeWidth', this.initOptions.strokeWidth);
|
|
183
|
-
this.tileConfigManager.setConfig('strokeOpacity', this.initOptions.strokeOpacity);
|
|
184
|
-
this.tileConfigManager.setConfig('color', (_this$parent$getAttri = this.parent.getAttribute('color')) === null || _this$parent$getAttri === void 0 ? void 0 : _this$parent$getAttri.scale);
|
|
185
|
-
this.tileConfigManager.setConfig('shape', (_this$parent$getAttri2 = this.parent.getAttribute('shape')) === null || _this$parent$getAttri2 === void 0 ? void 0 : _this$parent$getAttri2.scale);
|
|
186
|
-
this.tileConfigManager.setConfig('size', (_this$parent$getAttri3 = this.parent.getAttribute('size')) === null || _this$parent$getAttri3 === void 0 ? void 0 : _this$parent$getAttri3.scale);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
this.tileConfigManager.on('updateConfig', function (updateConfigs) {
|
|
186
|
+
var styleConfigs = styles[this.parent.type] || [];
|
|
187
|
+
styleConfigs.map(function (style) {
|
|
188
|
+
_this2.tileStyleService.setConfig(style, _this2.getInitOptionValue(style));
|
|
189
|
+
});
|
|
190
|
+
this.tileStyleService.on('updateConfig', function (updateConfigs) {
|
|
190
191
|
updateConfigs.map(function (key) {
|
|
191
|
-
_this2.updateStyle(key);
|
|
192
|
-
|
|
193
|
-
return '';
|
|
192
|
+
return _this2.updateStyle(key);
|
|
194
193
|
});
|
|
195
194
|
});
|
|
196
195
|
}
|
|
197
196
|
}, {
|
|
198
|
-
key: "
|
|
199
|
-
value: function
|
|
197
|
+
key: "updateAttribute",
|
|
198
|
+
value: function updateAttribute(style) {
|
|
200
199
|
var _this3 = this;
|
|
201
200
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (['size', 'color', 'shape'].includes(style)) {
|
|
201
|
+
if (Attributes.includes(style)) {
|
|
205
202
|
var _this$parent$getAttri4;
|
|
206
203
|
|
|
207
204
|
var scaleValue = (_this$parent$getAttri4 = this.parent.getAttribute(style)) === null || _this$parent$getAttri4 === void 0 ? void 0 : _this$parent$getAttri4.scale;
|
|
@@ -210,12 +207,18 @@ export var TileLayerManager = /*#__PURE__*/function (_TileManager) {
|
|
|
210
207
|
return;
|
|
211
208
|
}
|
|
212
209
|
|
|
213
|
-
updateValue = scaleValue;
|
|
214
210
|
this.children.map(function (child) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return '';
|
|
211
|
+
return setStyleAttributeField(child, _this3.parent, style, scaleValue);
|
|
218
212
|
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}, {
|
|
216
|
+
key: "updateStyle",
|
|
217
|
+
value: function updateStyle(style) {
|
|
218
|
+
var updateValue = null;
|
|
219
|
+
|
|
220
|
+
if (Attributes.includes(style)) {
|
|
221
|
+
this.updateAttribute(style);
|
|
219
222
|
} else {
|
|
220
223
|
var layerConfig = this.parent.getLayerConfig();
|
|
221
224
|
|
|
@@ -226,30 +229,26 @@ export var TileLayerManager = /*#__PURE__*/function (_TileManager) {
|
|
|
226
229
|
|
|
227
230
|
var config = layerConfig[style];
|
|
228
231
|
updateValue = config;
|
|
229
|
-
updateLayersConfig(this.children, style, config);
|
|
230
|
-
|
|
231
|
-
if (style === 'rampColors' && config) {
|
|
232
|
-
var createTexture2D = this.rendererService.createTexture2D;
|
|
233
|
-
var imageData = generateColorRamp(config);
|
|
234
|
-
this.initOptions.colorTexture = createTexture2D({
|
|
235
|
-
data: imageData.data,
|
|
236
|
-
width: imageData.width,
|
|
237
|
-
height: imageData.height,
|
|
238
|
-
flipY: false
|
|
239
|
-
});
|
|
240
|
-
updateLayersConfig(this.children, 'colorTexture', this.initOptions.colorTexture);
|
|
241
|
-
}
|
|
242
|
-
} // @ts-ignore
|
|
243
232
|
|
|
233
|
+
switch (style) {
|
|
234
|
+
case 'rampColors':
|
|
235
|
+
var texture = updateTexture(config, this.children, this.rendererService);
|
|
236
|
+
this.initOptions.colorTexture = texture;
|
|
237
|
+
break;
|
|
238
|
+
|
|
239
|
+
default:
|
|
240
|
+
updateLayersConfig(this.children, style, config);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
244
243
|
|
|
245
|
-
this.
|
|
244
|
+
this.setInitOptionValue(style, updateValue);
|
|
246
245
|
}
|
|
247
246
|
}, {
|
|
248
247
|
key: "destroy",
|
|
249
248
|
value: function destroy() {
|
|
250
|
-
this.
|
|
249
|
+
this.tilePickService.destroy();
|
|
251
250
|
}
|
|
252
251
|
}]);
|
|
253
252
|
|
|
254
253
|
return TileLayerManager;
|
|
255
|
-
}(
|
|
254
|
+
}(Base);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ILayer, IMapService, IRendererService, IBaseTileLayerManager } from '@antv/l7-core';
|
|
2
|
-
import {
|
|
3
|
-
export declare class BaseMapTileLayerManager extends
|
|
2
|
+
import { Base } from './base';
|
|
3
|
+
export declare class BaseMapTileLayerManager extends Base implements IBaseTileLayerManager {
|
|
4
4
|
constructor(parent: ILayer, mapService: IMapService, rendererService: IRendererService);
|
|
5
5
|
render(): void;
|
|
6
6
|
private setSubLayerInitOption;
|
|
@@ -8,10 +8,10 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
8
8
|
|
|
9
9
|
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; } }
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { Base } from "./base";
|
|
12
12
|
import { getLayerShape, getMaskValue } from "../utils";
|
|
13
|
-
export var BaseMapTileLayerManager = /*#__PURE__*/function (
|
|
14
|
-
_inherits(BaseMapTileLayerManager,
|
|
13
|
+
export var BaseMapTileLayerManager = /*#__PURE__*/function (_Base) {
|
|
14
|
+
_inherits(BaseMapTileLayerManager, _Base);
|
|
15
15
|
|
|
16
16
|
var _super = _createSuper(BaseMapTileLayerManager);
|
|
17
17
|
|
|
@@ -116,4 +116,4 @@ export var BaseMapTileLayerManager = /*#__PURE__*/function (_TileManager) {
|
|
|
116
116
|
}]);
|
|
117
117
|
|
|
118
118
|
return BaseMapTileLayerManager;
|
|
119
|
-
}(
|
|
119
|
+
}(Base);
|
|
@@ -9,8 +9,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
9
9
|
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; } }
|
|
10
10
|
|
|
11
11
|
import BaseModel from "../../core/BaseModel";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { TileLayer } from "../tileLayer/TileLayer";
|
|
13
|
+
import { MapTileLayer } from "../tileLayer/MapTileLayer";
|
|
14
14
|
|
|
15
15
|
var TileModel = /*#__PURE__*/function (_BaseModel) {
|
|
16
16
|
_inherits(TileModel, _BaseModel);
|
|
@@ -33,10 +33,10 @@ var TileModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
33
33
|
value: function getTileLayer(usage) {
|
|
34
34
|
switch (usage) {
|
|
35
35
|
case 'basemap':
|
|
36
|
-
return
|
|
36
|
+
return MapTileLayer;
|
|
37
37
|
|
|
38
38
|
default:
|
|
39
|
-
return
|
|
39
|
+
return TileLayer;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}, {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ILayer, IRendererService, ITileRenderService } from '@antv/l7-core';
|
|
2
|
+
/**
|
|
3
|
+
* 主要用于瓦片图层队列的渲染
|
|
4
|
+
*/
|
|
5
|
+
export declare class TileRenderService implements ITileRenderService {
|
|
6
|
+
private rendererService;
|
|
7
|
+
constructor(rendererService: IRendererService);
|
|
8
|
+
render(layers: ILayer[]): void;
|
|
9
|
+
renderMask(layer: ILayer): void;
|
|
10
|
+
}
|