Skip to content

Commit 35b2cda

Browse files
committed
fix md拖入图层列表后有多份图例
1 parent de2eb0b commit 35b2cda

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ export class WebMap extends mapboxgl.Evented {
378378
visible
379379
}
380380
} else {
381-
const appreciableLayers = this._generateLayers();
382-
const matchLayer = appreciableLayers.find(layer => layer.id === id);
381+
const matchLayer = this._appreciableLayers.find(layer => layer.id === id);
383382
formatItem = this._formatLayer({
384383
dataSource: matchLayer.dataSource,
385384
id,

test/mapboxgl/mapping/WebMapV3Spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ describe('mapboxgl-webmap3.0', () => {
117117
expect(webMapV3.getLayers().length).toBeLessThanOrEqual(mapInfo.layers.length);
118118
expect(webMapV3.getLegendInfo().length).not.toBe(0);
119119
expect(webMapV3.getLayerCatalog().length).not.toBe(0);
120+
expect(webMapV3.getLegendInfo().length).toBe(6);
120121
done();
121122
});
122123
});

0 commit comments

Comments
 (0)