mirror of https://gitee.com/antv-l7/antv-l7
fix: 修复 MaskTile 失效 (#1471)
Co-authored-by: shihui <yiqianyao.yqy@alibaba-inc.com>
This commit is contained in:
parent
acef404204
commit
b54f14f0b5
|
@ -20,12 +20,19 @@ export default class MaskTile extends Tile {
|
||||||
await this.addLayer(layer);
|
await this.addLayer(layer);
|
||||||
this.isLoaded = true;
|
this.isLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getFeatures(sourceLayer: string | undefined){
|
||||||
|
if(!sourceLayer) return [];
|
||||||
|
const source = this.sourceTile.data;
|
||||||
|
return source.getTileData(sourceLayer);
|
||||||
|
}
|
||||||
|
|
||||||
protected getSourceOption() {
|
protected getSourceOption() {
|
||||||
const rawSource = this.parent.getSource();
|
const rawSource = this.parent.getSource();
|
||||||
const { sourceLayer, featureId } = this.parent.getLayerConfig<{
|
const { sourceLayer, featureId } = this.parent.getLayerConfig<{
|
||||||
featureId: string;
|
featureId: string;
|
||||||
}>();
|
}>();
|
||||||
const features = this.getFeatures(sourceLayer)
|
const features = this.getFeatures(sourceLayer);
|
||||||
return {
|
return {
|
||||||
data: {
|
data: {
|
||||||
type: 'FeatureCollection',
|
type: 'FeatureCollection',
|
||||||
|
|
Loading…
Reference in New Issue