-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Bug
Describe the bug
Converting from SLD to OpenLayers style, offsets on MarkSymbolizer are no longer handled, even though the SLD uses displacement. Displacement is transformed to undefined.
To Reproduce
Steps to reproduce the behavior:
- Create an SLD with a Mark style and Displacement.
- Convert the style to geostyler and then to OpenLayers
- Style a vector layer with the OL style.
Example:
<Rule>
<Name>selected property</Name>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
</Fill>
</Mark>
<Size>45.0</Size>
<Displacement>
<DisplacementX>1</DisplacementX>
<DisplacementY>1</DisplacementY>
</Displacement>
</Graphic>
</PointSymbolizer>
</Rule>Expected behavior
offset property should not be undefined
Desktop (please complete the following information):
OS: Mac OS
Browser: Chrome
Version: 122.0
Additional context
The bug has been introduced here:
geostyler-openlayers-parser/src/OlStyleParser.ts
Line 1046 in 2d8a804
| displacement: typeof(markSymbolizer.offset) === 'number' ? markSymbolizer.offset : undefined |
Proposed solution
offsetis not anumber, it is anarray, so we could checkArray.isArray(offset)- we should update the unit tests and introduce an offset + displacement into the mocked data
AlexGacon
Metadata
Metadata
Assignees
Labels
No labels