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

boundsFromPath doesn't support relative (lowercase) commands and segments with length over 3 #18972

Open
KacperMadej opened this issue May 10, 2023 · 1 comment

Comments

@KacperMadej
Copy link

Behaviour

In MapUtilities, boundsFromPath function is not calculating the bounds correctly for segments based on a relative SVG commands (e.g. l, s, c, etc.). This creates wrong dataLabel placement, and wrong map view calculation that could not contain the map point path.
https://jsfiddle.net/BlackLabel/dygpu1sz/3/

The segments parsing doesn't handle arcs and curves well. The feature is clipped and not fully visible.
Demo: https://jsfiddle.net/BlackLabel/dygpu1sz/4/

Product version

v11+

Related issue

#18949

@KacperMadej
Copy link
Author

KacperMadej commented May 12, 2023

A partial workaround could be here: https://jsfiddle.net/BlackLabel/xdhgr7jn/1/

It requires manual setting of the bounds but gives usable results. Details in comments in JS & HTML code sections of the demo. If anything is unclear please let me know and I can elaborate.

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

No branches or pull requests

1 participant