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

Limited number of tile requests #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

anatolimacarovclimate
Copy link
Contributor

@anatolimacarovclimate anatolimacarovclimate commented Jan 14, 2020

Added a set to keep current downloading tiles.
Synchronized loading/reading tile data.
Avoided duplicate requests.
Fixed fetch tile func to check for bad requests.
Update constraints for the iPad storyboard.

Via Charles proxy app, I can see that number of requests was reduced from 2000 to 144 for one zone level = 4.

The Mapbox had a similar problem back in 2015 mapbox/mbxmapkit#167

…eading tile data. Avoided duplicate requests. Fixed fetch tile func to check for bad requests. Update constraints for iPad storyboard.
@@ -46,6 +46,6 @@
- (nullable id)initWithFrame:(MKMapRect)frame x:(NSInteger)x y:(NSInteger)y z:(NSInteger)z;
- (nullable id)initWithFrame:(MKMapRect)frame configuringURLSession: (NSURLSessionConfiguration* _Nonnull)configuration x:(NSInteger)x y:(NSInteger)y z:(NSInteger)z;

- (void)fetchTileForFrameIndex:(NSInteger)frameIndex session:(NSURLSession *)session completionHandler:(void (^)(NSData * date, NSURLResponse * response, NSError * error))completionBlock;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we removing the response object from this block?

Pod/Public/TCCAnimationTileOverlayRenderer.m Outdated Show resolved Hide resolved
Pod/Public/TCCAnimationTileOverlayRenderer.m Outdated Show resolved Hide resolved
}
if (tileData) {
//The setNeedsDisplayInMapRect is called once for each downloaded sub-tile of the mapRect (4-6 sub-tiles for retina).
[weakSelf setNeedsDisplayInMapRect:mapRect zoomScale:zoomScale];
Copy link
Contributor

Choose a reason for hiding this comment

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

Does setNeedsDisplayInMapRect:zoomScale: restart the requests for tiles?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants