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

Add caching in Map for loaded tiles in TileLayer to improve performance and reduce requests. #1931

Closed
wants to merge 1 commit into from

Commits on Jul 10, 2024

  1. Add caching for loaded tiles in TileLayer to improve performance and …

    …reduce redundant tile loading. The cached tiles are stored in a Map where the key is the tile coordinates (x:y:z) and the value is the tile image as a byte list. This allows for quick retrieval of already loaded tiles, avoiding unnecessary network requests. The caching logic is implemented in the `_TileLayerState` class using a `Map<String, Uint8List>` called `_cachedTiles`. Each time a tile is loaded, it is added to the cache using its coordinates as the key. When a tile is requested, the cache is checked first before initiating a new load. This change improves the efficiency of the TileLayer component and reducing requests.
    ReinisSprogis committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    aef5c45 View commit details
    Browse the repository at this point in the history