flutter_map icon indicating copy to clipboard operation
flutter_map copied to clipboard

[BUG] High zoom results in increasing frame times when using `Polygon`s

Open JaffaKetchup opened this issue 2 years ago • 1 comments

What is the bug?

Originally reported by @josxha in #1828.

Zooming in on a polygon (a lot) causes a gradual decrease in performance, and can result in a crash when the device can no longer handle it. It appears to be unrelated to the recent addition of interactivity to polygons.

https://github.com/fleaflet/flutter_map/assets/34318751/e909d301-abce-4e16-9dd8-d953a130f3d9

image

image

How can we reproduce it?

Use the "Polygon Layer" page in the example page, and zoom into a polygon a long way. Frame rate will progressively drop.

Do you have a potential solution?

No response

Platforms

All

Severity

Fatal: Causes the application to crash

JaffaKetchup avatar Feb 14 '24 15:02 JaffaKetchup

i have test it now, while i am zooming in/out i have noticed a memory leak, the memory usage keep increasing that's lead to crash

mziad-dev avatar Feb 14 '24 15:02 mziad-dev

https://github.com/fleaflet/flutter_map/assets/69913791/fd3ef650-4d19-40c8-afe0-02e0f953ae79

https://github.com/fleaflet/flutter_map/assets/69913791/9748f8cb-1928-4040-b220-b79bf593ee3b

Problem was that as zooming in lines was getting very long and many dots was calculated eventually getting into millions of dots.

ReinisSprogis avatar Mar 14 '24 23:03 ReinisSprogis