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

Text-padding property does not work #242

Open
yiwenzhang666999 opened this issue Oct 23, 2019 · 5 comments
Open

Text-padding property does not work #242

yiwenzhang666999 opened this issue Oct 23, 2019 · 5 comments

Comments

@yiwenzhang666999
Copy link

Set the text-padding value in the style sheet. You can read this value in the stylefunction, but it doesn't work. I don't know if I use Chinese.

@ahocevar
Copy link
Member

What is the result you are expecting? The text-padding property is only used for setting the buffer around the text for decluttering. See https://docs.mapbox.com/mapbox-gl-js/style-spec/#layout-symbol-text-padding.

@yiwenzhang666999
Copy link
Author

Thank you for your reply, I want to use this property to control the intensity of annotations at different levels. When I set this up, I can read the value I set in level in functionstyle.js, but it doesn't work, mapbox is like this. Settings are ok
image

@ahocevar
Copy link
Member

The text-padding option is implemented. Please provide additional information on what does not work and what you'd expect.

@yiwenzhang666999
Copy link
Author

hi@ ahocevar Thanks for your work very much,I want to use this setting "text-padding": {"stops": [[13, 1], [14, 1], [15, 2], [16, 4], [17, 5], [18 , 5]]}, the text of the road is marked at different intervals at different levels,In vector map

@ahocevar
Copy link
Member

Ah I see, you are talking about labels along lines. That cannot be controlled in OpenLayers, so these paddings will only ensure a minimum distance between labels, but not influence the exact positioning.

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