diff options
Diffstat (limited to 'platform/darwin/src/MGLTilePyramidOfflineRegion.h')
-rw-r--r-- | platform/darwin/src/MGLTilePyramidOfflineRegion.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLTilePyramidOfflineRegion.h b/platform/darwin/src/MGLTilePyramidOfflineRegion.h index 162636eda0..d04e656230 100644 --- a/platform/darwin/src/MGLTilePyramidOfflineRegion.h +++ b/platform/darwin/src/MGLTilePyramidOfflineRegion.h @@ -13,6 +13,17 @@ NS_ASSUME_NONNULL_BEGIN To minimize the resources required by an irregularly shaped offline region, use the MGLShapeOfflineRegion class instead. + ### Example + ```swift + let northeast = CLLocationCoordinate2D(latitude: 40.989329, longitude: -102.062592) + let southwest = CLLocationCoordinate2D(latitude: 36.986207, longitude: -109.049896) + let bbox = MGLCoordinateBounds(sw: southwest, ne: northeast) + + let region = MGLTilePyramidOfflineRegion(styleURL: MGLStyle.lightStyleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14) + let context = "Tile Pyramid Region".data(using: .utf8) + MGLOfflineStorage.shared.addPack(for: region, withContext: context!) + ``` + #### Related examples See the <a href="https://docs.mapbox.com/ios/maps/examples/offline-pack/"> Download an offline map</a> example to learn how to define an offline region |