Skip to content

Commit

Permalink
Merge pull request #4699 from adube/787-fix-print-layer-order
Browse files Browse the repository at this point in the history
Fix print layer order
  • Loading branch information
adube committed Feb 28, 2019
2 parents a0973b8 + ec17567 commit a5f196f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/print/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ PrintService.prototype.encodeMap_ = function(map, scale, object) {
let layers = this.ngeoLayerHelper_.getFlatLayers(mapLayerGroup);

// Sort the layer by ZIndex
olArray.stableSort(layers, (layer_a, layer_b) => layer_a.getZIndex() - layer_b.getZIndex());
olArray.stableSort(layers, (layer_a, layer_b) => (layer_a.getZIndex() || 0) - (layer_b.getZIndex() || 0));
layers = layers.slice().reverse();

layers.forEach((layer) => {
Expand Down

0 comments on commit a5f196f

Please sign in to comment.