MGLTilePyramidOfflineRegion
@interface MGLTilePyramidOfflineRegion
: NSObject <MGLOfflineRegion, NSSecureCoding, NSCopying>
An offline region defined by a style URL, geographic coordinate bounds, and range of zoom levels.
To minimize the resources required by an irregularly shaped offline region, use the MGLShapeOfflineRegion class instead.
Example
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!)
bounds
The coordinate bounds for the geographic region covered by the downloaded tiles.
Declaration
Objective-C
@property (nonatomic, readonly) MGLCoordinateBounds bounds;
Swift
var bounds: MGLCoordinateBounds { get }
minimumZoomLevel
The minimum zoom level for which to download tiles and other resources.
For more information about zoom levels, -[MGLMapView zoomLevel]
.
Declaration
Objective-C
@property (nonatomic, readonly) double minimumZoomLevel;
Swift
var minimumZoomLevel: Double { get }
maximumZoomLevel
The maximum zoom level for which to download tiles and other resources.
For more information about zoom levels, -[MGLMapView zoomLevel]
.
Declaration
Objective-C
@property (nonatomic, readonly) double maximumZoomLevel;
Swift
var maximumZoomLevel: Double { get }
-initWithStyleURL:bounds:fromZoomLevel:toZoomLevel:
Initializes a newly created offline region with the given style URL, geographic coordinate bounds, and range of zoom levels.
This is the designated initializer for MGLTilePyramidOfflineRegion
.
Declaration
Objective-C
- (nonnull instancetype)initWithStyleURL:(nullable NSURL *)styleURL
bounds:(MGLCoordinateBounds)bounds
fromZoomLevel:(double)minimumZoomLevel
toZoomLevel:(double)maximumZoomLevel;
Swift
init(styleURL: URL?, bounds: MGLCoordinateBounds, fromZoomLevel minimumZoomLevel: Double, toZoomLevel maximumZoomLevel: Double)
Parameters
styleURL
URL of the map style for which to download resources. The URL may be a full HTTP or HTTPS URL or a MapTiler style URL (https://api.maptiler.com/maps/{style}/style.json
). Specify nil
for the default style. Relative file URLs cannot be used as offline style URLs. To download the online resources required by a local style, specify a URL to an online copy of the style.
bounds
The coordinate bounds for the geographic region to be covered by the downloaded tiles.
minimumZoomLevel
The minimum zoom level to be covered by the downloaded tiles. This parameter should be set to at least 0 but no greater than the value of the maximumZoomLevel
parameter. For each required tile source, if this parameter is set to a value less than the tile source’s minimum zoom level, the download covers zoom levels down to the tile source’s minimum zoom level.
maximumZoomLevel
The maximum zoom level to be covered by the downloaded tiles. This parameter should be set to at least the value of the minimumZoomLevel
parameter. For each required tile source, if this parameter is set to a value greater than the tile source’s minimum zoom level, the download covers zoom levels up to the tile source’s maximum zoom level.
iOS SDK
Examples
SDK JS Reference
- Annotations
- Appendices
- NSExpression(MGLAdditions)
- NSValue(MGLAdditions)
- NSValue(MGLCircleStyleLayerAdditions)
- NSValue(MGLFillExtrusionStyleLayerAdditions)
- NSValue(MGLFillStyleLayerAdditions)
- NSValue(MGLHillshadeStyleLayerAdditions)
- NSValue(MGLLineStyleLayerAdditions)
- NSValue(MGLRasterStyleLayerAdditions)
- NSValue(MGLSymbolStyleLayerAdditions)
- MGLAccountManager
- MGLAnnotationImage
- MGLAnnotationView
- MGLAttributedExpression
- MGLAttributionInfo
- MGLBackgroundStyleLayer
- MGLCircleStyleLayer
- MGLClockDirectionFormatter
- MGLCompassButton
- MGLCompassDirectionFormatter
- MGLComputedShapeSource
- MGLCoordinateFormatter
- MGLDistanceFormatter
- MGLFillExtrusionStyleLayer
- MGLFillStyleLayer
- MGLForegroundStyleLayer
- MGLHeatmapStyleLayer
- MGLHillshadeStyleLayer
- MGLImageSource
- MGLLight
- MGLLineStyleLayer
- MGLLoggingConfiguration
- MGLMapCamera
- MGLMapSnapshot
- MGLMapSnapshotOptions
- MGLMapSnapshotOverlay
- MGLMapSnapshotter
- MGLMapView
- MGLMultiPoint
- MGLMultiPolygon
- MGLMultiPolyline
- MGLNetworkConfiguration
- MGLOfflinePack
- MGLOfflineStorage
- MGLPointAnnotation
- MGLPointCollection
- MGLPolygon
- MGLPolyline
- MGLRasterStyleLayer
- MGLRasterTileSource
- MGLShape
- MGLShapeCollection
- MGLShapeOfflineRegion
- MGLShapeSource
- MGLSource
- MGLStyle
- MGLStyleLayer
- MGLSymbolStyleLayer
- MGLTilePyramidOfflineRegion
- MGLTileSource
- MGLUserLocation
- MGLUserLocationAnnotationView
- MGLUserLocationAnnotationViewStyle
- MGLVectorStyleLayer
- MGLVectorTileSource
- MGLAnnotationVerticalAlignment
- MGLAnnotationViewDragState
- MGLAttributionInfoStyle
- MGLCirclePitchAlignment
- MGLCircleScaleAlignment
- MGLCircleTranslationAnchor
- MGLDEMEncoding
- MGLErrorCode
- MGLFillExtrusionTranslationAnchor
- MGLFillTranslationAnchor
- MGLHillshadeIlluminationAnchor
- MGLIconAnchor
- MGLIconPitchAlignment
- MGLIconRotationAlignment
- MGLIconTextFit
- MGLIconTranslationAnchor
- MGLLightAnchor
- MGLLineCap
- MGLLineJoin
- MGLLineTranslationAnchor
- MGLLoggingLevel
- MGLMapDebugMaskOptions
- MGLOfflinePackState
- MGLOrnamentPosition
- MGLOrnamentVisibility
- MGLRasterResamplingMode
- MGLResourceKind
- MGLSymbolPlacement
- MGLSymbolZOrder
- MGLTextAnchor
- MGLTextJustification
- MGLTextPitchAlignment
- MGLTextRotationAlignment
- MGLTextTransform
- MGLTextTranslationAnchor
- MGLTextWritingMode
- MGLTileCoordinateSystem
- MGLUserTrackingMode
- Formatters
- Geometry
- Location Updates
- Maps
- Offline Maps
- Other Categories
- Other Classes
- Other Constants
- Other Enumerations
- Other Functions
- Other Protocols
- Other Structures
- Other Type Definitions
- Primitive Shapes
- MGLAnnotation
- MGLCalloutView
- MGLCalloutViewDelegate
- MGLCluster
- MGLComputedShapeSourceDataSource
- MGLFeature
- MGLLocationManager
- MGLLocationManagerDelegate
- MGLMapSnapshotterDelegate
- MGLMapViewDelegate
- MGLOfflineRegion
- MGLOfflineStorageDelegate
- MGLOverlay
- MGLStylable
- MGLCoordinateBounds
- MGLCoordinateQuad
- MGLCoordinateSpan
- MGLOfflinePackProgress
- MGLSphericalPosition
- MGLTransition
- Style Content
- Style Layers
- Style Primitives
- Styling the Map
- MGLCoordinateBounds
- MGLCoordinateQuad
- MGLCoordinateSpan
- MGLOfflinePackProgress
- MGLSphericalPosition
- MGLTransition
- User Interaction
- Customizing Fonts
- Information for Style Authors
- Gesture Recognizers
- Info.plist Keys
- Migrating to Expressions
- Predicates and expressions
- Tile URL Templates
- Working with GeoJSON Data