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

[BUG] Should polygon bounding box cache never be reset ? #1932

Open
ibrierley opened this issue Jul 13, 2024 · 0 comments
Open

[BUG] Should polygon bounding box cache never be reset ? #1932

ibrierley opened this issue Jul 13, 2024 · 0 comments
Labels
bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing

Comments

@ibrierley
Copy link
Collaborator

What is the bug?

When investigating a problem updating flutter_map_line_editor I noted that polygons no longer display ibrierley/flutter_map_line_editor#47

I'm fairly sure the issue is this line...

LatLngBounds get boundingBox =>
      _boundingBox ??= LatLngBounds.fromPoints(points);

Where a poly bounding box is cached, which makes perfect sense. In the line_editors case, typically points are added/modified, rather than created anew (which is a possible workaround I've noted in the other issue).

So the bounding box needs to be updated in this case one way or another. Like I said, this can be forced by creating a new poly each time (which I keep fluctuating between it making perfect sense and other times not). However, it also made me think if this is quite correct on flutter_maps side.

If the poly has checks for equality for example (not sure where this is used), or needs a repaint as the points are changed, if it's not equal, then should the bbox cache be updated...or in general should the bbox ever be updated ?

It won't be an issue in flutter_map for most cases as the points rarely change, but wanted to double check for any further thoughts.

How can we reproduce it?

Run flutter_map_line_editor, but code has been highlighted in question.

Do you have a potential solution?

There is a possible workaround to recreate the polygon rather than amend it's points.

Platforms

All

Severity

Minimum: Allows normal functioning

@ibrierley ibrierley added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing
Projects
Status: To do
Development

No branches or pull requests

1 participant