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 tile requests delay apis #960

Merged
merged 2 commits into from
Dec 9, 2021
Merged

Add tile requests delay apis #960

merged 2 commits into from
Dec 9, 2021

Conversation

ank27
Copy link
Contributor

@ank27 ank27 commented Dec 7, 2021

Summary of changes

Introduce tile-requests-delay and tile-network-requests-delay APIs to set delay in tile requests for vector, raster and raster-dem sources.

The tile-requests-delay property:

    /**
     * For vector, raster and raster-dem sources, this property sets the tile requests delay.
     *
     * The given delay comes in action only during an ongoing animation or gestures.
     * It helps to avoid loading, parsing and rendering of the "transient" tiles and
     * thus to improve the rendering performance, especially on low-end devices.
     *
     * The delay is represented by a Double value in milliseconds.
     */

The tile-network-requests-delay property:

    /**
     * For vector, raster and raster-dem sources, this property sets the tile network requests delay.
     *
     * The given delay comes in action only during an ongoing animation or gestures.
     * It helps to avoid loading the "transient" tiles from the network and
     * thus to avoid redundant network requests.
     *
     * The delay is represented by a Double value in milliseconds.
     * 
     * Note that "tile-network-requests-delay" value is superseded with "tile-requests-delay" 
     * property value, if both are provided.
     */
Before After
tile_request_no_delay.mp4
tile_request_delay_5sec.mp4

User impact (optional)

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Optimize code for java consumption (@JvmOverloads, @file:JvmName, etc).
  • Add example if relevant.
  • Document any changes to public APIs.
  • Apply changelog label ('breaking change', 'bug 🪲', 'build', 'docs', 'feature 🍏', 'performance ⚡', 'testing 💯') or use the label 'skip changelog'
  • Add an entry inside this element for inclusion in the mapbox-maps-android changelog: <changelog>Added "tile-requests-delay" and "tile-network-requests-delay" source properties for tile requests delay.</changelog>.
  • If this PR is a v10.3 release branch fix / enhancement, merge it to main firstly and then port to v10.3 release branch.

Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

PRs must be submitted under the terms of our Contributor License Agreement CLA.

@ank27 ank27 requested a review from a team as a code owner December 7, 2021 10:25
@ank27 ank27 self-assigned this Dec 7, 2021
@ank27 ank27 marked this pull request as draft December 7, 2021 10:26
@ank27 ank27 requested a review from pengdev December 8, 2021 09:50
@mapbox mapbox deleted a comment from heangpov16 Dec 8, 2021
@ank27 ank27 changed the title add tile delay api Add tile requests delay apis Dec 8, 2021
@ank27 ank27 marked this pull request as ready for review December 8, 2021 14:32
@ank27 ank27 requested review from pengdev and a team December 8, 2021 14:32
Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very small nit on the test code, looks good otherwise.
Thank you for adding the visual comparison to the PR!

@ank27 ank27 merged commit eadf0f5 into main Dec 9, 2021
@ank27 ank27 deleted the ak-tile-delay-api branch December 9, 2021 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants