Skip to content

Commit

Permalink
Merge pull request #9510 from camptocamp/backport/9509-to-master
Browse files Browse the repository at this point in the history
[Backport master] Fix printing KML with Polygon fill to null
  • Loading branch information
sbrunner authored Oct 16, 2024
2 parents 2c17b03 + 9930da8 commit 9454ba8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/print/VectorEncoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,7 @@ VectorEncoder.prototype.encodeVectorStyle_ = function (
const fillStyle = style.getFill();
const strokeStyle = style.getStroke();
if (styleType === PrintStyleType.POLYGON) {
if (fillStyle !== null) {
symbolizers.push(this.encodeVectorStylePolygon_(fillStyle, strokeStyle));
}
symbolizers.push(this.encodeVectorStylePolygon_(fillStyle, strokeStyle));
} else if (styleType === PrintStyleType.LINE_STRING) {
if (strokeStyle !== null) {
symbolizers.push(this.encodeVectorStyleLine_(strokeStyle));
Expand Down Expand Up @@ -377,7 +375,11 @@ VectorEncoder.prototype.encodeVectorStylePolygon_ = function (fillStyle, strokeS
const symbolizer = /** @type {import('ngeo/print/mapfish-print-v3').MapFishPrintSymbolizerPolygon} */ ({
type: 'polygon',
});
this.encodeVectorStyleFill_(symbolizer, fillStyle);
if (fillStyle !== null) {
this.encodeVectorStyleFill_(symbolizer, fillStyle);
} else {
symbolizer.fillOpacity = 0;
}
if (strokeStyle !== null) {
this.encodeVectorStyleStroke_(symbolizer, strokeStyle);
}
Expand Down

0 comments on commit 9454ba8

Please sign in to comment.