Skip to content

Commit bca3b07

Browse files
committed
#3972: fixed print of vector layers for solid dash stroke
1 parent 3e22a33 commit bca3b07

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

web/client/utils/AnnotationsUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const getDashArrayFromStyle = dashArray => {
103103
const annStyleToOlStyle = (type, tempStyle, label = "") => {
104104
let style = tempStyle && tempStyle[type] ? tempStyle[type] : tempStyle;
105105
const s = style;
106-
const dashArray = s.dashArray ? getDashArrayFromStyle(s.dashArray) : "";
106+
const dashArray = s.dashArray ? getDashArrayFromStyle(s.dashArray) : "solid";
107107
switch (type) {
108108
case "MultiPolygon":
109109
case "Polygon":

web/client/utils/__tests__/AnnotationsUtils-test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,4 +763,24 @@ describe('Test the AnnotationsUtils', () => {
763763
expect(getDashArrayFromStyle("3 4 5")).toEqual("3 4 5");
764764
expect(getDashArrayFromStyle(["3", "4", "5"])).toEqual("3 4 5");
765765
});
766+
it('test annotationsToPrint strokeDashstyle defaults to solid', () => {
767+
const f = {
768+
type: "FeatureCollection",
769+
features: [{
770+
type: "Feature",
771+
geometry: {
772+
type: "LineString",
773+
coordinates: [[0, 0], [1, 1], [3, 3], [5, 5]]
774+
},
775+
style: [{
776+
color: "#FF0000"
777+
}].concat(getStartEndPointsForLinestring())
778+
}]
779+
};
780+
let fts = annotationsToPrint([f]);
781+
expect(fts).toExist();
782+
expect(fts.length).toBe(1);
783+
expect(fts[0].properties.ms_style).toExist();
784+
expect(fts[0].properties.ms_style.strokeDashstyle).toBe('solid');
785+
});
766786
});

0 commit comments

Comments
 (0)