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] Unstable PolygonLayer & PolylineLayer #1921

Closed
IAmHereAtGithub opened this issue Jun 24, 2024 · 3 comments · Fixed by #1925
Closed

[BUG] Unstable PolygonLayer & PolylineLayer #1921

IAmHereAtGithub opened this issue Jun 24, 2024 · 3 comments · Fixed by #1925
Assignees
Labels
bug This issue reports broken functionality or another error P: 1 (important) S: core Scoped to the core flutter_map functionality

Comments

@IAmHereAtGithub
Copy link

IAmHereAtGithub commented Jun 24, 2024

What is the bug?

The users clicks min. 4 points on the map to draw an area.
The polygon will not be drawn at all zoom levels and cannot be deleted.
(This worked fine on flutter map version 6.0.1, but no more on 7.0.0/7.0.1 .

How can we reproduce it?

I have uploaded the code for reproduction Link to github.
I recorded the behavior in this video:

bug.mp4

Manual reproduction:

  1. Run the project on an android emulator.
  2. Click on the pen icon to get in the edit mode.
  3. Draw an area by clicking min. 4 times in the map.
  4. Click on the pen icon to get out of the edit mode.
  5. You will see no polygon between the circles (bug).
  6. Zoom out and/or zoom in, the polygon will be shown.
  7. Click on the X on the right bottom button, this should clear the circle and polygon lists.
  8. The polygon (depending on the zoom level) will not be cleared and will stay forever.

Do you have a potential solution?

I tried to debug flutter map. It looks like that in the state.dart , the _cachedSimplifiedElements don´t recognized that a new polygon is created in the zoom level.
And general the _cachedProjectedElements will not getting updated if the user cleared the polygon.

Platforms

e.g. Android emulator Pixel 7

Severity

Obtrusive: Prevents normal functioning but causes no errors in the console

@IAmHereAtGithub IAmHereAtGithub added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels Jun 24, 2024
@IAmHereAtGithub
Copy link
Author

IAmHereAtGithub commented Jun 24, 2024

Hi!

I know that this is not the solution, but if I comment out line 74 in the \lib\src\layer\shared\layer_projection_simplification\state.dart:
if (getElements(oldWidget) == elements) return;

Everything works.

@rhogro
Copy link

rhogro commented Jun 24, 2024

I noticed the exact same behavior on my app too. I use a PolylineLayer to display a geojson track and on some specific zoom level the polylines disappear, but on other levels they show up.
image
image

@JaffaKetchup
Copy link
Member

Hi all,
We're aware we're having some issues with these layers right now, I've added a notice to the documentation front page and will try to remember to pin an issue.
For the time being, please downgrade to v7.0.0 or v6.2.1.
We're working to fix the issue, please have patience as the maintainers are quite busy at the moment!
You may also be able to avoid the issue by setting useDynamicUpdate false and potentially assigning a UniqueKey - but this could have no effect or make things worse.

@JaffaKetchup JaffaKetchup pinned this issue Jun 27, 2024
@JaffaKetchup JaffaKetchup changed the title Polygon layer seems to be broken (Android). [BUG] Unstable PolygonLayer & PolylineLayer Jun 27, 2024
@JaffaKetchup JaffaKetchup added P: 1 (important) S: core Scoped to the core flutter_map functionality and removed needs triage This new bug report needs reproducing and prioritizing labels Jun 27, 2024
@JaffaKetchup JaffaKetchup self-assigned this Jun 27, 2024
@JaffaKetchup JaffaKetchup unpinned this issue Jul 2, 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 P: 1 (important) S: core Scoped to the core flutter_map functionality
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants