Other Constants
The following constants are available globally.
-
Posted by the shared
MGLOfflineStorageobject when anMGLOfflinePackobject’s progress changes. The progress may change due to a resource being downloaded or because the pack discovers during the download that more resources are required for offline viewing. This notification is posted whenever any field in theprogressproperty changes.The
objectis theMGLOfflinePackobject whose progress changed. TheuserInfodictionary contains the pack’s current state in theMGLOfflinePackStateUserInfoKeykey and details about the pack’s current progress in theMGLOfflinePackProgressUserInfoKeykey. You may also consult theMGLOfflinePack.stateandMGLOfflinePack.progressproperties, which provide the same values.If you only need to observe changes in a particular pack’s progress, you can alternatively observe KVO change notifications to the pack’s
progresskey path.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotificationSwift
static let MGLOfflinePackProgressChanged: NSNotification.Name -
Posted by the shared
MGLOfflineStorageobject whenever anMGLOfflinePackobject encounters an error while downloading. The error may be recoverable and may not warrant the user’s attention. For example, the pack’s implementation may attempt to re-request failed resources based on an exponential backoff strategy or upon the restoration of network access.The
objectis theMGLOfflinePackobject that encountered the error. TheuserInfodictionary contains the error object in theMGLOfflinePackErrorUserInfoKeykey.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotificationSwift
static let MGLOfflinePackError: NSNotification.Name -
Posted by the shared
MGLOfflineStorageobject when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.The
objectis theMGLOfflinePackobject that reached the tile limit in the course of downloading. TheuserInfodictionary contains the tile limit in theMGLOfflinePackMaximumCountUserInfoKeykey.Once this limit is reached, no instance of
MGLOfflinePackcan download additional tiles from Mapbox APIs until already downloaded tiles are removed by calling the-[MGLOfflineStorage removePack:withCompletionHandler:]method. Contact your Mapbox sales representative to have the limit raised.Declaration
Objective-C
extern const NSNotificationName _Nonnull MGLOfflinePackMaximumMapboxTilesReachedNotificationSwift
static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name -
The key for an
NSNumberobject that indicates an offline pack’s current state. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-integerValueon the object to receive theMGLOfflinePackState-typed state.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyStateSwift
static let state: MGLOfflinePackUserInfoKey -
The key for an
NSValueobject that indicates an offline pack’s current progress. This key is used in theuserInfodictionary of anMGLOfflinePackProgressChangedNotificationnotification. Call-MGLOfflinePackProgressValueon the object to receive theMGLOfflinePackProgress-typed progress.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgressSwift
static let progress: MGLOfflinePackUserInfoKey -
The key for an
NSErrorobject that is encountered in the course of downloading an offline pack. This key is used in theuserInfodictionary of anMGLOfflinePackErrorNotificationnotification. The error’s domain isMGLErrorDomain. SeeMGLErrorCodefor possible error codes.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyErrorSwift
static let error: MGLOfflinePackUserInfoKey -
The key for an
NSNumberobject that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in theuserInfodictionary of anMGLOfflinePackMaximumMapboxTilesReachedNotificationnotification. Call-unsignedLongLongValueon the object to receive theuint64_t-typed tile limit.Declaration
Objective-C
extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCountSwift
static let maximumCount: MGLOfflinePackUserInfoKey
-
An
NSNumberobject containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster image tile when the map’s zoom level is an integer. The raster source scales its images up or down when the map’s zoom level falls between two integers.The default value for this option is 512. Version 4 of the Mapbox Maps API requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value.
This option is only applicable to
MGLRasterSourceobjects; it is ignored when initializingMGLVectorSourceobjects.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSizeSwift
static let tileSize: MGLTileSourceOption
-
An
NSNumberobject containing a Boolean enabling or disabling clustering. If theshapeproperty contains point shapes, setting this option toYESclusters the points by radius into groups. The default value isNO.This attribute corresponds to the
clustersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusteredSwift
static let clustered: MGLShapeSourceOption -
An
NSNumberobject containing an integer; specifies the radius of each cluster if clustering is enabled. A value of 512 produces a radius equal to the width of a tile. The default value is 50.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadiusSwift
static let clusterRadius: MGLShapeSourceOption -
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to cluster points if clustering is enabled. Defaults to one zoom level less than the value ofMGLShapeSourceOptionMaximumZoomLevelso that, at the maximum zoom level, the shapes are not clustered.This attribute corresponds to the
clusterMaxZoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClusteringSwift
static let maximumZoomLevelForClustering: MGLShapeSourceOption -
An
NSNumberobject containing an integer; specifies the maximum zoom level at which to create vector tiles. A greater value produces greater detail at high zoom levels. The default value is 18.This attribute corresponds to the
maxzoomsource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLShapeSourceOption -
An
NSNumberobject containing an integer; specifies the size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance. The default value is 128.This attribute corresponds to the
buffersource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBufferSwift
static let buffer: MGLShapeSourceOption -
An
NSNumberobject containing a double; specifies the Douglas-Peucker simplification tolerance. A greater value produces simpler geometries and improves performance. The default value is 0.375.This attribute corresponds to the
tolerancesource property in the Mapbox Style Specification.Declaration
Objective-C
extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationToleranceSwift
static let simplificationTolerance: MGLShapeSourceOption
-
A version number identifying the default version of the suite of default styles provided by Mapbox. This version number may be passed into one of the “StyleURLWithVersion” class methods of MGLStyle.
The value of this constant generally corresponds to the latest released version as of the date on which this SDK was published. You can use this constant to ascertain the style used by
MGLMapViewandMGLTilePyramidOfflineRegionwhen no style URL is specified. Consult the Mapbox Styles API documentation for the most up-to-date style versioning information.Warning
The value of this constant may change in a future release of the SDK. If you use any feature that depends on a specific aspect of a default style – for instance, the minimum zoom level that includes roads – you may use the current value of this constant or the underlying style URL, but do not use the constant itself. Such details may change significantly from version to version.Declaration
Objective-C
static const NSInteger MGLStyleDefaultVersion = 9Swift
let MGLStyleDefaultVersion: Int
-
An
NSNumberobject containing an unsigned integer that specifies the minimum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMaximumZoomLevel, if specified. The default value for this option is 0.This option corresponds to the
minzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevelSwift
static let minimumZoomLevel: MGLTileSourceOption -
An
NSNumberobject containing an unsigned integer that specifies the maximum zoom level at which to display tiles from the source.The value should be between 0 and 22, inclusive, and less than
MGLTileSourceOptionMinimumZoomLevel, if specified. The default value for this option is 22.This option corresponds to the
maxzoomkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevelSwift
static let maximumZoomLevel: MGLTileSourceOption -
An HTML string defining the buttons to be displayed in the map view’s attribution view when the source is part of the map view’s style.
By default, no attribution statements are displayed. If the
MGLTileSourceOptionAttributionInfosoption is specified, this option is ignored.This option corresponds to the
attributionkey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLStringSwift
static let attributionHTMLString: MGLTileSourceOption -
An array of
MGLAttributionInfoobjects defining the buttons to be displayed in the map view’s attribution view when the source is part of the map view’s style.By default, no attribution statements are displayed.
Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfosSwift
static let attributionInfos: MGLTileSourceOption -
An
NSNumberobject containing an unsigned integer that specifies the tile coordinate system for the source’s tile URLs. The integer corresponds to one of the constants described inMGLTileCoordinateSystem.The default value for this option is
MGLTileCoordinateSystemXYZ.This option corresponds to the
schemekey in the TileJSON specification.Declaration
Objective-C
extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystemSwift
static let tileCoordinateSystem: MGLTileSourceOption
-
Indicates an error occurred in the Mapbox SDK.
Declaration
Objective-C
extern const NSErrorDomain _Nonnull MGLErrorDomainSwift
let MGLErrorDomain: String
-
Project version number for Mapbox.
Declaration
Objective-C
extern double MapboxVersionNumberSwift
var MapboxVersionNumber: Double -
Project version string for Mapbox.
Declaration
Objective-C
extern const unsigned char MapboxVersionString[]
Install in Dash
Other Constants Reference