-
-
Notifications
You must be signed in to change notification settings - Fork 866
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] AssetTileProvider
loading slowly after Flutter 3.7 & FM v3.1.0
#1436
Comments
I've tested the offline example with Flutter v3.7.5 and the tile provider seems to load the tiles correctly without lag. Could you confirm that this issue remains after upgrading Flutter to its latest version ? flutter doctor -v$>flutter doctor -v
[√] Flutter (Channel stable, 3.7.5, on Microsoft Windows [version 10.0.22621.1265], locale fr-FR)
• Flutter version 3.7.5 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c07f788888 (21 hours ago), 2023-02-22 17:52:33 -0600
• Engine revision 0f359063c4
• Dart version 2.19.2
• DevTools version 2.20.1
[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Guillaume\AppData\Local\Android\sdk
• Platform android-33, build-tools 30.0.3
• Java binary at: D:\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[!] Visual Studio - develop for Windows (Visual Studio Build Tools 2017 15.9.35)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
• Visual Studio Build Tools 2017 version 15.9.28307.1500
• Windows 10 SDK version 10.0.17763.0
X Visual Studio 2019 or later is required.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.3)
• Android Studio at D:\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [version 10.0.22621.1265]
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.105
• Edge (web) • edge • web-javascript • Microsoft Edge 107.0.1418.52
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 2 categories. |
@TesteurManiak Yes I can. |
I have the same exact issue here. I'm using flutter_map: ^3.1.0
|
Minor improvement: this version still works fast and also supports the 'tms' option and probably other functionality. A minor issue which might is probably unrelated:
|
Hey there, apologies for the long delay. Just having a look at the code and timeline, this may be because of changes we made to add fallback URL support to asset providers - we implemented a custom flutter_map/lib/src/layer/tile_layer/tile_provider/asset_tile_provider.dart Lines 22 to 48 in a56b2b3
@TesteurManiak Do you think this could be a potential reason for this? If @WorldpixelSoftware or @mchlsndrn are still interested, can you try updating to the 'master' branch with Flutter 3.10 and Dart 3 support? Things may have changed in the meantime. Again, apologies for the extreme delay, this one just didn't jump out at me when scrolling the issue tracker. |
AssetTileProvider
loading slowly after Flutter 3.7 & FM v3.1.0
It might be, I'll have to do some benchmark to confirm this 🤔 |
I've done some first benchmarks and the |
@TesteurManiak Thanks, that's interesting. I think that solution is acceptable, and I'll implement it into #1532. |
Improved performance of `AssetTileProvider` when `TileLayer.fallbackUrl` not specified (resolves #1436) Improved documentation about performance pitfalls of `TileLayer.fallbackUrl`
Will be resolved in v5 by #1532. |
* Multiple changes, see PR body * Updated CHANGELOG * Added `offset` option to `FlutterMapState.move` and related methods (resolves #1460, #777, #952) Major refactoring and re-organization to improve understandibility * Updated CHANGELOG * Ensure `id` of `MapController.move` is passed through to the emitted `MapEventMove` Originally from #1534 (3eca34e) - thanks @rorystephenson! Co-Authored-By: Rory Stephenson <3683599+rorystephenson@users.noreply.github.com> * Fixed regression in commit 2764747 where internal `MapController` state was not continuous * Added `rotateAroundPoint` - resolves #1460 Co-Authored-By: 6y <tlserver@yahoo.com> * Updated CHANGELOG * Added `TileLayer.fallbackUrl` support to `FileTileProvider` Improved performance of `AssetTileProvider` when `TileLayer.fallbackUrl` not specified (resolves #1436) Improved documentation about performance pitfalls of `TileLayer.fallbackUrl` * Updated CHANGELOG * Updated pubspec.yaml Updated CHANGELOG * Removed `saveLayers` property from `PolylineLayer` * Updated CHANGELOG * Updated MacOS configuration Removed unnecessary Java installation from Windows GitHub Actions builder * Added more position options to `AnchorAlign` Deprecated `AnchorAlign.none` in favour of `AnchorAlign.center` or `null` Improved response/emission time of `onTap`/`MapEventTap` when `InteractiveFlag.doubleTapZoom` is disabled Improved `MarkerLayer`/`Layer` interoperability Improved/reorganized example application Updated CHANGELOG * Simplified `Anchor` Improved documentation of marker anchor methods Improved CHANGELOG * Updated version numbers * Fixed bug in example application * Added automated publishing action for tags in format 'v_._._' * Updated CHANGELOG * Added credit to CHANGELOG --------- Co-authored-by: Rory Stephenson <3683599+rorystephenson@users.noreply.github.com> Co-authored-by: 6y <tlserver@yahoo.com>
What is the bug?
After upgrading to latest stable version of Flutter (3.7.0) as of today 25.1.2023 I noticed a massive lag within the loading of offline-maps. It is literally so slow, you can even see it in the example app.
The Windows version error is a known error in the latest flutter stable, please disregard.
What is the expected behaviour?
Load offline image assets wihtin reasonable time.
How can we reproduce this issue?
Do you have a potential solution?
Must have something to do with the AssetImage that gets created in AssetTileProvider. There seems to be a change on the Flutter side, that makes Asset Image teribly slow.
I constructed the following workaround class to use as a TileProvider that seems to improve performance, although I cannot find out how and why exactly, since Image.asset uses AssetImage under the hood aswell.
Also I'm using the path here directly, which is originally not intended but the easiest solution for my purpose here.
Can you provide any other information?
No response
Platforms Affected
Android, iOS, Web, Windows, MacOS
Severity
Obtrusive: Prevents normal functioning but causes no errors in the console
Frequency
Consistently: Always occurs at the same time and location
Requirements
flutter doctor
finds no relevant issuesThe text was updated successfully, but these errors were encountered: