geostyler / geostyler-openlayers-parser

GeoStyler Style Parser implementation for OpenLayers styles
BSD 2-Clause "Simplified" License
36 stars 26 forks source link

Offset property is being ignored on MarkSymbolizer #799

Open florentsuc opened 3 months ago

florentsuc commented 3 months ago

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:

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: https://github.com/geostyler/geostyler-openlayers-parser/blob/2d8a80444227e9f3523a744c9e842af0b98b9ee1/src/OlStyleParser.ts#L1046

Proposed solution

KaiVolland commented 3 months ago

Thanks for the detailed report.

As you always got so far with the research it would be nice if you could provide a PR with the adjustment and the corresponding tests. Otherwise this might need some time to be fixed.