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

ol.ext FontSymbol offset X & Y not working #724

Closed
jeromeBor opened this issue Jan 7, 2022 · 1 comment
Closed

ol.ext FontSymbol offset X & Y not working #724

jeromeBor opened this issue Jan 7, 2022 · 1 comment
Labels

Comments

@jeromeBor
Copy link

I'm trying to make an offset icon on my regular icon, like a status bullet on my style of my feature.

  this.iconStyle = [
      new ol.style.Style({
        image: new ol.style.FontSymbol({
          form: 'marker',
          radius: 25,
          fill: new ol.style.Fill({
            color: 'white'
          })
        }),
        text: new ol.style.Text({
          text: '\uF0D1',
          font: '900 22px "Font Awesome 5 Free"',
          offsetY: -2,
          fill: new ol.style.Fill({
            color: '#06305c'
          })
        })
      }),
     
      new ol.style.Style({
        image: new ol.style.FontSymbol({
          form: 'circle',
          radius: 10,
          offsetX: 17,
          offsetY: -20,
          fill: new ol.style.Fill({
            color: 'green'
          })
        }),
        text: new ol.style.Text({
          text: '30m',
          offsetY: -20,
          offsetX: 17,
          fill: new ol.style.Fill({
            color: 'white'
          })
        })
      })
    ]

Here is result of what my app show

As you can see, the text of openlayer Style is correctly displayed with the good offest, but the fontSymbol circle doesnt seems to get the offset I wrote.

Here is the API for fontSymbol of ol.ext : https://viglino.github.io/ol-ext/doc/doc-pages/ol.style.FontSymbol.html

What am I doing wrong ?

NB : https://viglino.github.io/ol-ext/examples/style/map.style.font.html the "offset" tickbox also seems not to work.

@Viglino Viglino added the bug label Jan 8, 2022
Viglino added a commit that referenced this issue Jan 8, 2022
@Viglino
Copy link
Owner

Viglino commented Jan 8, 2022

It seems something has change in the and ol@v6 use a displacement.
The last commit should fix the bug.
Now FontSymbol offset use the displacement with ol>v6.

@Viglino Viglino closed this as completed Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants