Skip to content

Commit

Permalink
【feature】l7 getfilter 优化
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjiaojiao committed Jul 3, 2024
1 parent 7632929 commit 8f0d9a8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/mapboxgl/overlay/L7Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export class L7Layer extends CustomOverlayLayer {
constructor({ type, options = {} }) {
const id = options.layerID ? options.layerID : CommonUtil.createUniqueID('l7_layer_');
const events = [
'inited',
'add',
'remove',
'legend:color',
'legend:size',
'click',
'dblclick',
'mousemove',
Expand Down Expand Up @@ -149,8 +154,11 @@ export class L7Layer extends CustomOverlayLayer {
return;
}
const { filter } = this.l7layer.rawConfig;
const { field: filterFields, values } = getL7Filter(filter, this.id) || {};
const fields = filterFields || ['SmID', 'smpid'];
let { field: filterFields = [], values } = getL7Filter(filter, this.id) || {};
if (!filterFields.length && this.selectedDatas[0]) {
filterFields = Object.keys(this.selectedDatas[0].properties);
}
const fields = filterFields;
const transformFilterValuesFn = this._transformFilterValues.bind(this, { fields, values, selectedDatas: this.selectedDatas });
return {
field: fields,
Expand Down

0 comments on commit 8f0d9a8

Please sign in to comment.