Skip to content

Commit

Permalink
fix: support only spaces as separator in vendor-option graphic-margin
Browse files Browse the repository at this point in the history
  • Loading branch information
ger-benjamin committed Feb 25, 2025
1 parent 4c36a74 commit b01783d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 45 deletions.
2 changes: 1 addition & 1 deletion data/slds/geoserver/pattern_polygon.sld
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Name>Polygon with spaced purple circle symbols</Name>
<Abstract>Polygon with spaced purple circle symbols</Abstract>
<PolygonSymbolizer>
<VendorOption name="graphic-margin">4,6,2,3</VendorOption>
<VendorOption name="graphic-margin">4 6 2 3</VendorOption>
<Fill>
<GraphicFill>
<Graphic>
Expand Down
37 changes: 0 additions & 37 deletions data/slds/geoserver/pattern_polygon_alternative_margin.sld

This file was deleted.

6 changes: 0 additions & 6 deletions src/SldStyleParser.geoserver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,6 @@ describe('SldStyleParser implements StyleParser', () => {
expect(geoStylerStyle).toBeDefined();
expect(geoStylerStyle).toEqual(pattern_polygon);
});
it('can read the geoserver pattern_polygon_alternative_margin.sld', async () => {
const sld = fs.readFileSync('./data/slds/geoserver/pattern_polygon_alternative_margin.sld', 'utf8');
const { output: geoStylerStyle } = await styleParser.readStyle(sld);
expect(geoStylerStyle).toBeDefined();
expect(geoStylerStyle).toEqual(pattern_polygon);
});
});

describe('#writeStyle', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/SldStyleParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ export class SldStyleParser implements StyleParser<string> {
if (this.withGeoServerVendorOption) {
const graphicFillPadding = getVendorOptionValue(sldSymbolizer, 'graphic-margin');
if (!isNil(graphicFillPadding)) {
fillSymbolizer.graphicFillPadding = graphicFillPadding.split(/[,\s]/).map(numberExpression);
fillSymbolizer.graphicFillPadding = graphicFillPadding.split(/\s/).map(numberExpression);
}
}
if (!isNil(color)) {
Expand Down

0 comments on commit b01783d

Please sign in to comment.