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

FontSymbol cannot display different symbol (ol ext 4.0.24, work with OL 10.2.1, not 10.3.1) #1123

Closed
DavidHequet opened this issue Jan 24, 2025 · 8 comments
Labels

Comments

@DavidHequet
Copy link

Hi,

It seems OpenLayers changed theyr render method, using different FontSymbol doesn't work

In my examples i have two features and i use a getSyle method wich switch between two icons, depends ont feature "test" property

working example with ol10.2.1:
https://codesandbox.io/p/sandbox/ky98xz

Not working example with ol10.3.1:
https://codesandbox.io/p/sandbox/animated-gif-forked-npv8vy

I was looking in your commits since 4.0.24 release (especially 6ea333d) , maybe you already patch it? If so, do you plan to release au new version soon?

thank you,
David

@Viglino
Copy link
Owner

Viglino commented Jan 24, 2025

Just publish [email protected].
It should fix the issue withe ol>10.3.1

@DavidHequet
Copy link
Author

it seems to work in the codesandbox, il will try te update my code on next monday. thank you

https://codesandbox.io/p/sandbox/animated-gif-forked-396kwf?file=%2Findex.html&workspaceId=ws_HbYprUGYkcY6RLW53oE2R

@DavidHequet
Copy link
Author

DavidHequet commented Jan 27, 2025

I update my sandbow with a non-working example, two features with same fill color, same symbol but different stroke colors are shown with the same stroke color

https://codesandbox.io/p/sandbox/animated-gif-forked-396kwf?file=%2Findex.html&workspaceId=ws_HbYprUGYkcY6RLW53oE2R

Image

I think it from createRenderOptions witch doesnt provide the stroke color in the key, as they problably didn't need it, openlayers dev's didn't neither use it in the key and i think the provider canvas for both symbols is the same

Image

and before drawing, the context.strokeStyle is the same for both Symbol

Image

Maybe you can update the createRenderOptions with all your needed options

I tried to extend your class and it seems to work:

https://codesandbox.io/p/sandbox/animated-gif-forked-77qk6c?file=%2FFontSymbol2.js%3A12%2C23&workspaceId=ws_HbYprUGYkcY6RLW53oE2R

Ps: Sorry i don't have the time to contribute with a PR

@Viglino Viglino added bug and removed question labels Jan 27, 2025
Viglino added a commit that referenced this issue Jan 27, 2025
@Viglino
Copy link
Owner

Viglino commented Jan 27, 2025

I've added the line stroke keys to the render options

@DavidHequet
Copy link
Author

thank you, i will wait for the 4.0.26 :)

@DavidHequet
Copy link
Author

Hi, Sorry to bother you, but do you plan tu publish a new package soon? Thank you

@Viglino
Copy link
Owner

Viglino commented Jan 29, 2025

Just published v4.0.26

@DavidHequet
Copy link
Author

updated my example, seems to work :)
https://codesandbox.io/p/sandbox/animated-gif-forked-vdph33?file=%2Fmain.js&workspaceId=ws_HbYprUGYkcY6RLW53oE2R

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