Skip to content

Commit

Permalink
#3972: fixed print of vector layers for solid dash stroke (#3978)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarto authored and Tobia Di Pisa committed Jul 18, 2019
1 parent bd8ea7d commit 30f84ae
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/client/utils/AnnotationsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const getDashArrayFromStyle = dashArray => {
const annStyleToOlStyle = (type, tempStyle, label = "") => {
let style = tempStyle && tempStyle[type] ? tempStyle[type] : tempStyle;
const s = style;
const dashArray = s.dashArray ? getDashArrayFromStyle(s.dashArray) : "";
const dashArray = s.dashArray ? getDashArrayFromStyle(s.dashArray) : "solid";
switch (type) {
case "MultiPolygon":
case "Polygon":
Expand Down
20 changes: 20 additions & 0 deletions web/client/utils/__tests__/AnnotationsUtils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,4 +763,24 @@ describe('Test the AnnotationsUtils', () => {
expect(getDashArrayFromStyle("3 4 5")).toEqual("3 4 5");
expect(getDashArrayFromStyle(["3", "4", "5"])).toEqual("3 4 5");
});
it('test annotationsToPrint strokeDashstyle defaults to solid', () => {
const f = {
type: "FeatureCollection",
features: [{
type: "Feature",
geometry: {
type: "LineString",
coordinates: [[0, 0], [1, 1], [3, 3], [5, 5]]
},
style: [{
color: "#FF0000"
}].concat(getStartEndPointsForLinestring())
}]
};
let fts = annotationsToPrint([f]);
expect(fts).toExist();
expect(fts.length).toBe(1);
expect(fts[0].properties.ms_style).toExist();
expect(fts[0].properties.ms_style.strokeDashstyle).toBe('solid');
});
});

0 comments on commit 30f84ae

Please sign in to comment.