Skip to content

Commit

Permalink
fix: make print legend layer order match legend layer order
Browse files Browse the repository at this point in the history
  • Loading branch information
Grammostola committed Oct 21, 2024
1 parent 12cf2a9 commit a44468f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/controls/print/print-legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,9 @@ const LayerRows = function LayerRows(options) {
});
const layerListCmp = Component({
async render() {
const content = await overlayEls.reduce(async (acc, item) => await acc + await item.render(), '');
return `<ul id="${this.getId()}" class="list">${content}</ul>`;
const rowPromises = overlayEls.map((item) => item.render());
const rows = await Promise.all(rowPromises);
return `<ul id="${this.getId()}" class="list">${rows.reverse()}</ul>`;
}
});
return `
Expand Down

0 comments on commit a44468f

Please sign in to comment.