Skip to content

Commit

Permalink
fix: 复合图层 API 支持单选
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Jun 12, 2024
1 parent be2e4d5 commit 001dcce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export class BubbleLayer extends CompositeLayer<BubbleLayerOptions> {
this.selectData.length === selectData.length &&
isEqual(
this.selectData.map(({ featureId }) => featureId),
selectData.map(({ featureId }) => featureId)
selectData.map(({ featureId }) => featureId),
)
) {
return;
Expand Down Expand Up @@ -535,7 +535,8 @@ export class BubbleLayer extends CompositeLayer<BubbleLayerOptions> {
}

const feature = source.getFeatureById(featureId);
this.handleSelectData(featureId, feature, true);
const { enabledMultiSelect } = this.options;
this.handleSelectData(featureId, feature, enabledMultiSelect);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export class ChoroplethLayer extends CompositeLayer<ChoroplethLayerOptions> {
this.selectData.length === selectData.length &&
isEqual(
this.selectData.map(({ featureId }) => featureId),
selectData.map(({ featureId }) => featureId)
selectData.map(({ featureId }) => featureId),
)
) {
return;
Expand Down Expand Up @@ -529,7 +529,8 @@ export class ChoroplethLayer extends CompositeLayer<ChoroplethLayerOptions> {
}

const feature = source.getFeatureById(featureId);
this.handleSelectData(featureId, feature, true);
const { enabledMultiSelect } = this.options;
this.handleSelectData(featureId, feature, enabledMultiSelect);
// TODO: L7 method pickFeature(id|{x,y})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ export abstract class IconLayer<T extends IconLayerOptions> extends CompositeLay
}

const feature = source.getFeatureById(featureId);
this.handleSelectData(featureId, feature, true);
const { enabledMultiSelect } = this.options;
this.handleSelectData(featureId, feature, enabledMultiSelect);
// TODO: L7 method pickFeature(id|{x,y})
}

Expand Down

0 comments on commit 001dcce

Please sign in to comment.