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

missing icon-text-fit property #1175

Open
joostschouppe opened this issue Jul 17, 2024 · 2 comments
Open

missing icon-text-fit property #1175

joostschouppe opened this issue Jul 17, 2024 · 2 comments

Comments

@joostschouppe
Copy link

joostschouppe commented Jul 17, 2024

I used Maputnik to make labels where a white block is stretched to fit the label of some objects

"icon-image": "a_white_block",
"icon-text-fit": "both",
"icon-text-fit-padding"

If I understand #10 (comment) correctly, it's normal that this does not render properly in our OpenLayers project, since those two last properties are not supported.
Is there a workaround for this? Is there a plan to implement more properties? Would you welcome pull requests to fix this (and if so, can you point us in the right direction as to where to start with a fix)?

And the same questions for symbol-placement, which we use to put labels along a line

@ahocevar
Copy link
Member

First of all for the easy part of the answer: symbol-placement has been implemented in the meantime.

icon-text-fit and icon-text-fit-padding are still not implemented, but pull requests are welcome! A good approach would be to measure the text with the wrapText function provided in src/text.js (by adding an optional last argument and returning text and box measurements, if provided), and use that measurement to scale the icon.

@joostschouppe
Copy link
Author

Thanks for the info!
This is few skyscrapers above my own level, but I'll try to push for some time in our team, though it's likely it's not for this year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants