Skip to content

widthUnit and radiusUnit not working during conversion to OpenLayers style #824

@AlenKelemen

Description

@AlenKelemen

Description

I am trying to use widthUnit and radiusUnit properties set to 'm' when converting Geostyler styles to OpenLayers styles. However, it seems that these properties are not working as expected, and the resulting OpenLayers style does not reflect the intended units.

Expected behaviour

The converted style in OpenLayers should apply the correct units (e.g., meters) for width and radius properties, when widthUnit ,radiusUnit set to 'm'

How to reproduce

const geostylerStyle = {
  name: 'example',
  rules: [
    {
      name: 'rule 1',
      symbolizers: [
        {
          kind: 'Circle',
          radius: 10,
          radiusUnit: 'm',
          color: '#FF0000'
        }
      ]
    }
  ]
};

const olParser = new GeoStylerOpenlayersParser();
 return olParser.writeStyle(geoStylerStyle)
    .then(({ output: olStyle }) => olStyle)

### Possible Solution

Is there a known limitation regarding widthUnit or radiusUnit properties in the conversion process? If this feature is not implemented, are there any suggested workarounds?

### Additional Context

 versions:

"geostyler-openlayers-parser": "^5.0.0",
 "ol": "^10.1.0",

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions