-
-
Notifications
You must be signed in to change notification settings - Fork 859
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
Overlay image layer performance issues (low-res background) #567
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
Did you ever solve this? I'm having the same issue but in my case the overlay PNG is only 200 kB. So far, it only seems to happen on the iOS Simulator, not on real devices. After activating a semi-transparent overlay layer from an AlertDialog, the app freezes for 20-30 seconds when popping the dialog. Usually (but not always) it also crashes without any error messages after being frozen for 20-30 seconds. |
If using a simulator, I assume its using debug mode, which has a lot of slowdowns I think on iOS simulator only. My crude understanding is that it needs to use software mode for rendering and there are other things unoptimised to allow hot-reload. So I suspect it's not a flutter_map issue, but a temporary combination of flutter and the simulator. I may well be wrong though, so it would probably good to test it on an actual device, and if it still has a problem put some minimal code highlighting the problem (also see if you can do similar without flutter_map itself to see if its more flutter or flutter_map, but appreciate that may well not be easily possible) |
Thanks for the reply, I will see if I can pinpoint it more precisely. At first I thought it was the popping of the AlertDialog that was causing it, but after some more testing it seems to occur under the following conditions:
It's as if there is a surge of memory usage when activating the layer if the map is zoomed in. If I activate the layer when the map is zoomed out so that the entire image overlay is visible, it's fine. Also, if I activate the layer when zoomed out, and then zoom in, it also seems to be fine. So it seems to be somewhat related to zoom level and initial display of the |
I'm having the same issue as you. My overlay image is PNG (1MB). |
Sorry, I missed some comments. We did solve it, but a bit differently. TLDR: avoid immense scaling of images in iOS, it will have serious performance issues. Options we tried with pros/cons:
I hope it helps! |
Hello!
In a project we use an overlay image layer to show a low-res JPEG image as a background, it is the size of a small country (the Netherlands). We do this because sometimes the loading of tiles take some time. The grey background makes it hard to navigate when they are still loading and it improves the perception of lower loading times. On top of this layer we add additional layers served from GeoServer and some markers/polygons.
Code of the static background layer:
The image itself is just a 3,6MB compressed JPEG, we also tried <1MB JPEG, but both create performance issues. Mostly on iOS, which has paint gaps of 30 seconds and sometimes crashes the app entirely. So probably the cropping is too heavy? Although Android doesn't seem to have much of a problem. An alternative would be to use local stored tiles but with all the zoom levels this would need a lot of storage.
Are there any alternative approaches to accomplish something this?
The text was updated successfully, but these errors were encountered: