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

Scale dependency being ignored on TextSymbolizer #321

Open
jnewmoyer opened this issue May 28, 2021 · 7 comments
Open

Scale dependency being ignored on TextSymbolizer #321

jnewmoyer opened this issue May 28, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@jnewmoyer
Copy link

Bug

Describe the bug
Converting from SLD to OpenLayers style, my labels are showing at all zoom levels, even though the SLD uses a max scale denominator.

To Reproduce
Steps to reproduce the behavior:

  1. Create an SLD with a label style and max scale denom
  2. Convert the style to geostyler and then to OpenLayers
  3. Style a vector layer with the OL style.

Expected behavior
the labels appear only at scales inside of 1:5M.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version: 91.x

Additional context

The geostyler rule after converted:

{
      "name": "Labels",
      "scaleDenominator": {
        "max": 5000000
      },
      "symbolizers": [
        {
          "kind": "Text",
          "label": "{{title}}",
          "color": "#ffffff",
          "haloWidth": 1,
          "haloColor": "#000000",
          "offset": [
            0,
            10
          ],
          "size": 19,
          "font": [
            "SansSerif.bold"
          ],
          "fontStyle": "normal",
          "fontWeight": "bold"
        }
      ]
    }
@jnewmoyer jnewmoyer added the bug Something isn't working label May 28, 2021
@jansule
Copy link
Contributor

jansule commented May 31, 2021

Thanks for the info @jnewmoyer.

Which projection are you using on your map client?

@jnewmoyer
Copy link
Author

EPSG:4326

@jansule
Copy link
Contributor

jansule commented Jun 1, 2021

Could you check if it works for you in EPSG:3857?

EPSG:4326 uses degrees as units. Currently, geostyler-openlayers-parser assumes metric units (https://github.com/geostyler/geostyler-openlayers-parser/blob/master/src/OlStyleParser.ts#L537). Adding a switch 'm' / 'degrees' for the second argument there might solve your problem.

Would you like to create a PR for that?

@jnewmoyer
Copy link
Author

Absolutely. Stand by...

@KaiVolland
Copy link
Contributor

Seems like you could fix the issue @jnewmoyer. If not please reply or reopen.

@jnewmoyer
Copy link
Author

Apologies for never getting to the PR. I don't believe this is fixed though. It seems like scale is always evaluated with Meters in mind:

const mpu = METERS_PER_UNIT.m;

@KaiVolland
Copy link
Contributor

Ok. Thanks for keeping this alive. I was just in tabula rasa mode. 😄

@KaiVolland KaiVolland moved this to Todo in CodeSprint 2024 Jun 14, 2024
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