Skip to content

Commit 3ece97b

Browse files
committed
LegendList 新增一个layerTitle属性 review by xiongjj
1 parent ffd6c9f commit 3ece97b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/mapboxgl/mapping/webmap/v3/WebMap.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ export class WebMap extends mapboxgl.Evented {
452452
_createLayerLegendList(layer, styleSetting) {
453453
const layerType = layer.type;
454454
const layerId = layer.id;
455+
const layerTitle = layer.title;
455456
const layerType2LegendType = LAEYR_TYPE_LEGEND_TYPE[layerType];
456457
if (styleSetting.type === 'heat') {
457458
const colors = this._heatColorToGradient((layer.paint || {})['heatmap-color']);
@@ -468,7 +469,8 @@ export class WebMap extends mapboxgl.Evented {
468469
}
469470
}
470471
],
471-
layerId
472+
layerId,
473+
layerTitle
472474
}
473475
];
474476
}
@@ -492,7 +494,8 @@ export class WebMap extends mapboxgl.Evented {
492494
}
493495
}
494496
],
495-
layerId
497+
layerId,
498+
layerTitle
496499
}
497500
];
498501
}
@@ -516,7 +519,8 @@ export class WebMap extends mapboxgl.Evented {
516519
themeField: (subStyleSetting.field || [])[0],
517520
styleField: styleField,
518521
styleGroup,
519-
layerId
522+
layerId,
523+
layerTitle
520524
};
521525
return legendItem;
522526
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy