Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label anchor #825

Open
pelord opened this issue May 16, 2024 · 6 comments
Open

Label anchor #825

pelord opened this issue May 16, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@pelord
Copy link

pelord commented May 16, 2024

Description

When setting an anchor point for a text symbolizer, the geostyler style object property seem to have no effect on text placement.

Expected behaviour

Respect the anchor point of the text symbolizer.

How to reproduce

On https://geostyler.github.io/geostyler-demo/

Load a point example and add this geostyler object

{
  "name": "Basic Circle",
  "rules": [
    {
      "name": "Rule 1",
      "symbolizers": [
        {
          "kind": "Mark",
          "wellKnownName": "circle",
          "color": "#FF00AA"
        },
        {
          "kind": "Text",
          "label": "Your Label",
          "size": 12,
          "anchor": "bottom-left"
        }
      ]
    }
  ]
}

The text symbolizer stay a the same place.

Possible Solution

No response

Additional Context

No response

@pelord pelord added the bug Something isn't working label May 16, 2024
Copy link

This issue is stale because it has been open for 180 days with no activity. Feel free to unstale it at any time by adding a comment.

@pelord
Copy link
Author

pelord commented Nov 25, 2024

Am I alone to encounter this issue?

@KaiVolland
Copy link
Contributor

Hi @pelord , sorry that we did not yet react to this issue.
You're right the anchor property is not respected by the preview. As the preview is rendered via the openlayers parser this is porbably an issue of the openlayers-parser.

I'll transfer this issue.

@KaiVolland KaiVolland transferred this issue from geostyler/geostyler Nov 25, 2024
@KaiVolland
Copy link
Contributor

After further investigation i can say that there seems to be no equivalent in openlayers for this. So i guess we wont be able to support this. I added the "anchor" to the unsupported properties in #827 .

@pelord
Copy link
Author

pelord commented Nov 27, 2024

The is no ways to infer label placement?

image

@KaiVolland
Copy link
Contributor

The anchor in geostyler-style is described as:

The anchor position of the label referred to the center of the geometry.

After checking out the example the closest we get to this is openlayers textAlign.

This would at least have support for 'center' | 'left' | 'right'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Todo
Development

No branches or pull requests

3 participants