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

Fix text decluttering when segment length is zero #12774

Merged
merged 1 commit into from Sep 18, 2021

Conversation

MoonE
Copy link
Contributor

@MoonE MoonE commented Sep 17, 2021

Fixes #12752

When the segment length is zero there is a division by zero, which ultimately results in NaN values being inserted in the declutter tree. This causes all checks for overlapping labels to fail.

In the example in #12752 the second LineString of the first MultiLineString has the same start and end coordinates. At a low enough zoom level this gets simplified to just the start and end coordinates, thus resulting in a zero length LineString.

@tschaub
Copy link
Member

tschaub commented Sep 18, 2021

Nice work, @MoonE

@MoonE MoonE merged commit 964b1af into openlayers:main Sep 18, 2021
@MoonE MoonE deleted the fix-text-declutter branch September 18, 2021 09:09
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

Successfully merging this pull request may close these issues.

Decluttering is broken for specific Text style options
2 participants