MGLMapSnapshotOptions
@interface MGLMapSnapshotOptions : NSObject <NSCopying>
The options to use when creating images with the MGLMapSnapshotter
.
-initWithStyleURL:camera:size:
Creates a set of options with the minimum required information.
Declaration
Objective-C
- (nonnull instancetype)initWithStyleURL:(nullable NSURL *)styleURL
camera:(nonnull MGLMapCamera *)camera
size:(CGSize)size;
Swift
init(styleURL: URL?, camera: MGLMapCamera, size: CGSize)
Parameters
styleURL
URL of the map style to snapshot. The URL may be a full HTTP or HTTPS URL, a Mapbox style URL (mapbox://styles/{user}/{style}
), or a path to a local file relative to the application’s resource path. Specify nil
for the default style.
size
The image size.
Configuring the Map
styleURL
URL of the map style to snapshot.
Declaration
Objective-C
@property (nonatomic, readonly) NSURL *_Nonnull styleURL;
Swift
var styleURL: URL { get }
zoomLevel
The zoom level.
The default zoom level is 0. If this property is non-zero and the camera property is non-nil, the camera’s altitude is ignored in favor of this property’s value.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite) double zoomLevel;
Swift
var zoomLevel: Double { get set }
camera
A camera representing the viewport visible in the snapshot.
If this property is non-nil and the coordinateBounds
property is set to a non-empty coordinate bounds, the camera’s center coordinate and altitude are ignored in favor of the coordinateBounds
property.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite)
MGLMapCamera *_Nonnull camera;
Swift
var camera: MGLMapCamera { get set }
coordinateBounds
The coordinate rectangle that encompasses the bounds to capture.
If this property is non-empty and the camera property is non-nil, the camera’s center coordinate and altitude are ignored in favor of this property’s value.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite)
MGLCoordinateBounds coordinateBounds;
Swift
var coordinateBounds: MGLCoordinateBounds { get set }
Configuring the Image
size
The size of the output image, measured in points.
Declaration
Objective-C
@property (nonatomic, readonly) CGSize size;
Swift
var size: CGSize { get }
scale
The scale of the output image. Defaults to the main screen scale.
The minimum scale is 1.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite) CGFloat scale;
Swift
var scale: CGFloat { get set }
iOS SDK
SDK JS Reference
- MGLUserLocationAnnotationViewStyle
- MGLAccountManager
- MGLAnnotationImage
- MGLCircleStyleLayer
- MGLMapSnapshot
- NSValue(MGLHillshadeStyleLayerAdditions)
- MGLLight
- MGLCoordinateSpan
- MGLOfflinePack
- MGLAnnotationVerticalAlignment
- MGLSource
- MGLDEMEncoding
- MGLCoordinateSpan
- MGLMapCamera
- MGLTextWritingMode
- MGLIconTranslationAnchor
- NSValue(MGLSymbolStyleLayerAdditions)
- MGLOfflinePackProgress
- MGLMapSnapshotOptions
- Primitive Shapes
- NSValue(MGLAdditions)
- MGLTextPitchAlignment
- MGLSphericalPosition
- MGLCompassDirectionFormatter
- MGLVectorTileSource
- MGLMapViewDelegate
- MGLHillshadeIlluminationAnchor
- MGLIconTextFit
- MGLLocationManagerDelegate
- MGLShape
- Formatters
- MGLCoordinateBounds
- MGLCoordinateQuad
- MGLMapSnapshotterDelegate
- MGLAnnotationViewDragState
- MGLComputedShapeSource
- NSValue(MGLCircleStyleLayerAdditions)
- MGLHillshadeStyleLayer
- MGLOverlay
- MGLPolygon
- MGLStyleLayer
- MGLTilePyramidOfflineRegion
- MGLMapView
- MGLTransition
- MGLOfflineStorage
- MGLComputedShapeSourceDataSource
- MGLMapDebugMaskOptions
- MGLClockDirectionFormatter
- MGLTextRotationAlignment
- MGLUserTrackingMode
- NSValue(MGLRasterStyleLayerAdditions)
- MGLAttributionInfo
- MGLRasterStyleLayer
- Style Content
- MGLUserLocation
- MGLRasterTileSource
- MGLFillTranslationAnchor
- Other Protocols
- MGLSphericalPosition
- MGLMapSnapshotter
- MGLRasterResamplingMode
- MGLAnnotationView
- MGLResourceKind
- MGLShapeCollection
- Other Enumerations
- NSExpression(MGLAdditions)
- MGLCirclePitchAlignment
- MGLFillExtrusionTranslationAnchor
- Style Layers
- Other Constants
- MGLCoordinateBounds
- Appendices
- MGLLoggingConfiguration
- Other Structures
- MGLMapSnapshotOverlay
- MGLCircleTranslationAnchor
- User Interaction
- NSValue(MGLLineStyleLayerAdditions)
- MGLErrorCode
- MGLAttributedExpression
- MGLSymbolStyleLayer
- MGLCircleScaleAlignment
- MGLTextTransform
- MGLOrnamentVisibility
- MGLMultiPoint
- MGLShapeSource
- MGLLightAnchor
- MGLCalloutViewDelegate
- MGLCluster
- MGLOfflinePackProgress
- MGLPolyline
- MGLFeature
- MGLAnnotation
- MGLFillStyleLayer
- MGLIconRotationAlignment
- NSValue(MGLFillStyleLayerAdditions)
- Other Classes
- MGLLineTranslationAnchor
- MGLTextAnchor
- Offline Maps
- MGLLocationManager
- MGLStyle
- Other Type Definitions
- NSValue(MGLFillExtrusionStyleLayerAdditions)
- Style Primitives
- MGLTileSource
- MGLTransition
- MGLForegroundStyleLayer
- MGLStylable
- MGLIconPitchAlignment
- MGLOfflineRegion
- MGLHeatmapStyleLayer
- MGLCompassButton
- MGLFillExtrusionStyleLayer
- MGLSymbolPlacement
- MGLMultiPolyline
- MGLOfflinePackState
- MGLImageSource
- MGLCoordinateFormatter
- MGLDistanceFormatter
- MGLCoordinateQuad
- MGLPointCollection
- MGLPointAnnotation
- MGLTextJustification
- MGLOfflineStorageDelegate
- MGLCalloutView
- MGLOrnamentPosition
- MGLUserLocationAnnotationView
- MGLTileCoordinateSystem
- MGLSymbolZOrder
- MGLLineCap
- Other Functions
- MGLNetworkConfiguration
- MGLShapeOfflineRegion
- Styling the Map
- MGLLineJoin
- Maps
- MGLAttributionInfoStyle
- MGLIconAnchor
- MGLBackgroundStyleLayer
- MGLMultiPolygon
- Annotations
- MGLVectorStyleLayer
- Location Updates
- MGLTextTranslationAnchor
- MGLLineStyleLayer
- Other Categories
- Geometry
- MGLLoggingLevel