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

Optimise view reuse cache with Marker Views #5076

Closed
tobrun opened this issue May 20, 2016 · 3 comments
Closed

Optimise view reuse cache with Marker Views #5076

tobrun opened this issue May 20, 2016 · 3 comments
Labels
Android Mapbox Maps SDK for Android annotations Annotations on iOS and macOS or markers on Android

Comments

@tobrun
Copy link
Member

tobrun commented May 20, 2016

Marker view integration on Android landed with #3276.

This integration is backed up by an adapter approach that uses view recycling. Currently there is no limit on the amount of Views in the cache (child views of MapView) and there is a behaviour when panning in and out the viewport that results in growing the cache while it should be reusing the items in the cache.

Example:
We show 100 view marker but panning quickly a couple of times results in a cache with 147 views.

device-2016-05-20-132241

@tobrun tobrun added Android Mapbox Maps SDK for Android annotations Annotations on iOS and macOS or markers on Android labels May 20, 2016
@tobrun tobrun added this to the android-v4.1.0 milestone May 20, 2016
@bleege
Copy link
Contributor

bleege commented Jun 4, 2016

@tobrun Do we want to impose a limit on the number of items in the cache or is this issue simply stating that the current implementing isn't re-using items already in the cache and that needs to be changed to do so?

tobrun added a commit that referenced this issue Jun 6, 2016
tobrun added a commit that referenced this issue Jun 6, 2016
tobrun added a commit that referenced this issue Jun 6, 2016
@tobrun
Copy link
Member Author

tobrun commented Jun 6, 2016

@bleege

Below you see the problem in action, you can see our viewcache size increasing to values above 100 while there are only 100 MarkerViews.

ezgif com-video-to-gif 31

this is now resolved eb5ff35 with an increased cache size as seen here, where the size doesn't go over the 100 markers.

ezgif com-video-to-gif 30

@tobrun
Copy link
Member Author

tobrun commented Jun 6, 2016

Merged in #5250 onto release-v4.1.0 branch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android annotations Annotations on iOS and macOS or markers on Android
Projects
None yet
Development

No branches or pull requests

2 participants