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

Issue3 mbtiles - #110

Merged
13 commits merged into
mapbox:issue3-mbtilesfrom
tkrajacic:issue3-mbtiles
Jul 1, 2014
Merged

13 commits merged into
mapbox:issue3-mbtilesfrom
tkrajacic:issue3-mbtiles

Conversation

@tkrajacic

Copy link
Copy Markdown
Contributor

I transferred now all functionality to the Overlay class.

You might not want to pull my open-streets-dc.mbtiles file (as your files are way better suited I think and it would take up useless space in the repo forever).
I would then (in case you pull this) nuke my fork and refork again, to get rid of my mbtiles file as well and then include your old mbtiles files and update the viewcontroller accordingly.
Does this make sense to you or am I talking in riddles?

Interestingly I always thought that Apple removes an overlay when going over its maximumZ but it is not that way (anymore?). Apple now does its own interpolating, but not very predictable (it will only interpolate what is still in cache it seems)

Thomas Krajacic added 13 commits May 18, 2014 23:19
MBTiles functionality is now all implemented in MBXMBTilesOverlay.
MBTiles functionality is now all implemented in MBXMBTilesOverlay.
Implemented unified sqlite connection per overlay
Viewcontroller of test app correctly deallocs overlays after mapview disappears
Added two mbtiles files for testing (Courtesy of @wsnook)
Renamed mbtiles metadata key constants
@ghost ghost mentioned this pull request Jun 30, 2014
ghost pushed a commit that referenced this pull request Jul 1, 2014
Merging this into mapbox/mbxmapkit issue3-mbtiles to try it out.
@ghost
ghost merged commit 9ae04ac into mapbox:issue3-mbtiles Jul 1, 2014
@ghost

ghost commented Jul 1, 2014

Copy link
Copy Markdown

Two things I noticed...

  1. This removes attribution due to lack of space in the action sheet list... we need to bring attribution back and get rid of something else instead.
  2. It feels like tiles are loading slower than I would expect... that's probably because of the serial queue. The old way I used to do it would make many requests in parallel against the sqlite database. Since they all used separate read-only connections, locking was not a problem. Using the serial queue on one shared connection means that the tiles are never loaded in parallel.

However, it generally seems to work well, which is good. I'll look at this some more tomorrow.
Thanks @tkrajacic!

@tkrajacic

Copy link
Copy Markdown
Contributor Author

@wsnook Mhmm, then we could use a hybrid solution where we use a concurrent queue and have a separate connection for every tile we load. It would still be asynchronous but have your implementation's speed ... probably.
I realize that your first approach might have been superior to my attempt of introducing async loading.

@ghost

ghost commented Jul 1, 2014

Copy link
Copy Markdown

@tkrajacic If you want to keep working on this, here's what I'd suggest:

  1. Don't worry about the attribution stuff I mentioned earlier. That's going to get changed eventually anyhow. See Switch examples list to a UITableView #118
  2. Merge the upstream changes from this branch (mapbox/mbxmapkit issue3-mbtiles) into issue3-mbtiles of your fork. GitHub's Syncing a fork article might be helpful. When I manually merged stuff yesterday, I fixed the problem which was preventing an automatic merge, so hopefully future pull requests will be easier for you.
  3. Create a new branch from your issue3-mbtiles to experiment with the hybrid solution you mentioned above, then when you're ready, submit a new pull request against mapbox/mbxmapkit issue3-mbtiles branch. You might even try omitting the concurrent queue and just making the calls directly on the thread which calls loadTileAtPath:result:. As far as I can tell, MKMapKit already uses some sort of a concurrent queue to make multiple simultaneous tile requests, and since the sqlite calls complete quickly, I'm not convinced there's a need to add any more layers of queues or dispatching. I could be wrong about that though.

Thanks for all the work you've been doing on mbtiles!

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant