geostyler / geostyler-style

Style declaration files for the GeoStyler project
https://geostyler.github.io/geostyler-style/docs/master/
BSD 2-Clause "Simplified" License
16 stars 15 forks source link

TextSymbolizer label placement #582

Open jansule opened 1 year ago

jansule commented 1 year ago

Feature Request

Is your feature request related to a problem? Please describe.

The TextSymbolizer does currently not support a property for setting the label placement. Due to this, we are currently not able to make the labels of a line (e.g. a street) follow the line.

Describe the solution you'd like

We should add a property (e.g. labelPlacement) that handles this.

In mapbox this property is called symbol-placement (see https://docs.mapbox.com/style-spec/reference/layers/#layout-symbol-symbol-placement).

In OpenLayer this property is called placement (see https://openlayers.org/en/v7.5.2/apidoc/module-ol_style_Text.html#~TextPlacement).

Describe alternatives you've considered

None

Additional context

Style using different placements due to lack of support:

image

KaiVolland commented 1 year ago

It currently also extends the BasePointSymbolizer which is incorrect as it won't fit the needs for line string labeling. The TextSymbolizer already contains line based properties like maxAngle so i guess its no problem to move the matching properties from the BasePointSymbolizer to the TextSymbolizer and add the placement property.

jansule commented 10 months ago

Partially solved by https://github.com/geostyler/geostyler-style/pull/584

KaiVolland commented 4 months ago

The TextSymbolizer still extends BasePointSymbolizer which is not correct. This should be fixed as described here:

It currently also extends the BasePointSymbolizer which is incorrect as it won't fit the needs for line string labeling. The TextSymbolizer already contains line based properties like maxAngle so i guess its no problem to move the matching properties from the BasePointSymbolizer to the TextSymbolizer and add the placement property.