Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[ios] Displaying tiles on map is blocked by offline pack operations #8756

Closed

Description

@wibge

Platform: ios
Mapbox SDK version: 3.5

Steps to trigger behavior

  1. Install test app on an older device (ipad mini 2)
  2. Initiate large offline pack download, ie Colorado
  3. Pan and zoom around the map while the download is initiating

Expected behavior

Tiles will fetch and load

Actual behavior

No tiles are loaded until the download has started. If you pause the debugger, the DefaultFileSource runloop is busy in OfflineDownload::queueTiles for minutes

Even after the download has initiated, the map performance is poor. Fetching predownloaded tiles because requests to retrieve the tile from the database are queued behind offline download requests. I tried to add a priority queue to the runloop to address that issue, which helps some, but doesn't mitigate that long running operations such as queue tiles, and OfflineDatabase::getRegionCompletedStatus block the whole runloop.

You can view my attempt at the priority queue here - trailbehind#14

I am considering trying to split the DefaultFileSource runloop into two runloops, one loop would be solely responsible for fetching tiles for immediate display on the map. The other loop would do all operations for offline regions and evictions. It possibly could also save tiles to the database that were fetched for immediate display.

I'd appreciate any feedback on that approach, or other ideas!

Activity

  1. wibge commented on Apr 18, 2017

    @wibge
    Author

    I worked on this today, and have a proof of concept pull request that seems to work well, though is obviously not polished code. Any feedback on this would also be appreciated. Especially on handling the mutex in canceling the request in WorkTask. The mutex blocks the main thread often with the dual threads for DefaultFileSource.

    https://github.com/trailbehind/mapbox-gl-native/pull/15/files

  2. lilykaiser commented on Sep 10, 2018

    @lilykaiser

    This is now being tracked in #12655. Closing this ticket as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    iOSneeds discussionofflinesupport

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions