Skip to content

Commit

Permalink
Merge branch 'develop' into hstd-main
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwod committed Aug 16, 2023
2 parents c18085e + 6d388b2 commit 4e0eaed
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class LayerGroupItem extends Component {
const { layer } = props;
const layerInfo = props.layer.get("layerInfo");
this.state = {
subLayers: props.layer.subLayers,
caption: layerInfo.caption,
visible: props.layer.get("visible"),
// If layer is to be shown, check if there are some specified sublayers (if yes, we'll
Expand Down Expand Up @@ -575,6 +576,12 @@ class LayerGroupItem extends Component {
);
} else {
visibleSubLayers.push(subLayer);
// Restore order to its former glory. Sort using original sublayer array.
visibleSubLayers.sort((a, b) => {
return (
this.state.subLayers.indexOf(a) - this.state.subLayers.indexOf(b)
);
});
isNewSubLayer = true;
}

Expand Down

0 comments on commit 4e0eaed

Please sign in to comment.