Skip to content

[BUG] TileLayer updateInterval is not working #1468

@rorystephenson

Description

@rorystephenson

What is the bug?

TileLayer's updateInterval option has on affect. This causes fetching and loading a lot of tiles when flinging or animating the map a long way.

What is the expected behaviour?

Presumably the documented behavior of updateInterval:

/// Tiles will not update more than once every `updateInterval` (default 200
/// milliseconds) when panning. It can be null (but it will calculating for
/// loading tiles every frame when panning / zooming, flutter is fast) This
/// can save some fps and even bandwidth (ie. when fast panning / animating
/// between long distances in short time)

How can we reproduce this issue?

This is easiest to notice when animating the map a long way and watching network requests for tiles. I will probably add a recording to demonstrate this at some point.

Do you have a potential solution?

Re-instate the throttling logic so that updateInterval works again.

Can you provide any other information?

I wanted to determine why so many tiles were being loaded when I animated the map position across a large distance and after a quick look at the TileLayer code it is apparent that updateInterval has no affect. Similarly the throttleUpdate StreamController is being initialized and disposed but it is not hooked up to anything.

It seems that as part of #1333 this commit commented out throttling code with a // TODO fix note but it's not clear whether the throttling code was broken already or if it was broken during that PR and the author forgot to fix it before the PR was merged. I intend to re-instate the throttling logic and if it was already broken that would be helpful to know in order to avoid recreating any bugs.

Platforms Affected

Android, iOS, Web, Windows, MacOS, Linux

Severity

Obtrusive: Prevents normal functioning but causes no errors in the console

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue reports broken functionality or another error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions