Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Add single (“simple”) offline pack example [WIP] #12

Merged
merged 7 commits into from
Apr 4, 2016

Conversation

friedbunny
Copy link
Contributor

@friedbunny friedbunny commented Mar 31, 2016

Fixes #11. After some futzing around with KVO, this example is essentially the current offline doc with a progress bar. I left in the not-strictly necessary MGLOfflinePack error notifications because it seems like the friendly thing to do.

To-do:

Notes:

  • Downloads 1661 resources, 89.6 MB

/cc @1ec5

@friedbunny friedbunny self-assigned this Mar 31, 2016
@friedbunny friedbunny added this to the ios-v3.2.0 milestone Mar 31, 2016
zoomLevel:13
animated:NO];

self.mapView.maximumZoomLevel = 16;
Copy link
Contributor

Choose a reason for hiding this comment

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

It isn’t strictly necessary for the example descend to the maximum zoom level. We could simply add a few to the current zoom level and set that as the upper bound.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you’re right, this isn’t a very realistic way to control the extent of the downloaded region. I’ll look at changing how the min/max zoom are set.

Copy link
Contributor

Choose a reason for hiding this comment

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

The most realistic UI would be a range slider. There are many range slider pods on CocoaPods, but I don’t know that we want to introduce that kind of dependency into an example. Maybe just a comment to the effect of “how cool would it be to use a range slider here!”

@friedbunny
Copy link
Contributor Author

Swift notes from converting https://www.mapbox.com/help/mobile-offline/:

  • Observer names needed MGL prepended (OfflinePackProgressChangedNotificationMGLOfflinePackProgressChangedNotification)
  • addPackForRegion() pack.resume() needed unwrapping

@1ec5
Copy link
Contributor

1ec5 commented Apr 2, 2016

Whoops, thanks for catching that copy-pasta!

@friedbunny friedbunny merged commit 00e008c into master Apr 4, 2016
@friedbunny friedbunny deleted the fb-simple-offline branch April 4, 2016 20:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants