# Other Constants

The following constants are available globally.

- `MGLClusterIdentifierInvalid`

  An `NSUInteger` constant used to indicate an invalid cluster identifier. This indicates a missing cluster feature.

  #### Declaration

  Objective-C

      extern const NSUInteger MGLClusterIdentifierInvalid

  Swift

      let MGLClusterIdentifierInvalid: UInt

  View Source on GitHub

- `MGLShapeSourceOptionWrapsCoordinates`

  An `NSNumber` object containing a Boolean value; specifies whether the shape of an `MGLComputedShapeSource` should be wrapped to accomodate coordinates with longitudes beyond −180 and 180. The default value is `NO`.

  Setting this option to `YES` affects rendering performance.

  This option is used with the `MGLComputedShapeSource` class; it is ignored when creating an `MGLShapeSource` object.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionWrapsCoordinates

  Swift

      static let wrapsCoordinates: MGLShapeSourceOption

  View Source on GitHub
- `MGLShapeSourceOptionClipsCoordinates`

  An `NSNumber` object containing a Boolean value; specifies whether the shape of an `MGLComputedShapeSource` should be clipped at the edge of each tile. The default value is `NO`.

  Setting this option to `YES` affects rendering performance. Use this option to clip `MGLPolyline`s and `MGLPolygon`s at tile boundaries without artifacts.

  This option is used with the `MGLComputedShapeSource` class; it is ignored when creating an `MGLShapeSource` object.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClipsCoordinates

  Swift

      static let clipsCoordinates: MGLShapeSourceOption

  View Source on GitHub

- `MGLOfflinePackProgressChangedNotification`

  Posted by the shared `MGLOfflineStorage` object when an `MGLOfflinePack` object’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 the `progress` property changes.

  The `object` is the `MGLOfflinePack` object whose progress changed. The `userInfo` dictionary contains the pack’s current state in the `MGLOfflinePackStateUserInfoKey` key and details about the pack’s current progress in the `MGLOfflinePackProgressUserInfoKey` key. You may also consult the `MGLOfflinePack.state` and `MGLOfflinePack.progress` properties, 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 `progress` key path.

  #### Related examples

  See the Download an offline map example to learn how to calculate the progress of an offline download.

  #### Declaration

  Objective-C

      extern const NSNotificationName _Nonnull MGLOfflinePackProgressChangedNotification

  Swift

      static let MGLOfflinePackProgressChanged: NSNotification.Name

  View Source on GitHub
- `MGLOfflinePackErrorNotification`

  Posted by the shared `MGLOfflineStorage` object whenever an `MGLOfflinePack` object 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 `object` is the `MGLOfflinePack` object that encountered the error. The `userInfo` dictionary contains the error object in the `MGLOfflinePackErrorUserInfoKey` key.

  #### Declaration

  Objective-C

      extern const NSNotificationName _Nonnull MGLOfflinePackErrorNotification

  Swift

      static let MGLOfflinePackError: NSNotification.Name

  View Source on GitHub
- `MGLOfflinePackMaximumMapboxTilesReachedNotification`

  Posted by the shared `MGLOfflineStorage` object when the maximum number of Mapbox-hosted tiles has been downloaded and stored on the current device.

  The `object` is the `MGLOfflinePack` object that reached the tile limit in the course of downloading. The `userInfo` dictionary contains the tile limit in the `MGLOfflinePackMaximumCountUserInfoKey` key.

  Once this limit is reached, no instance of `MGLOfflinePack` can 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 MGLOfflinePackMaximumMapboxTilesReachedNotification

  Swift

      static let MGLOfflinePackMaximumMapboxTilesReached: NSNotification.Name

  View Source on GitHub
- `MGLOfflinePackUserInfoKeyState`

  The key for an `NSNumber` object that indicates an offline pack’s current state. This key is used in the `userInfo` dictionary of an `MGLOfflinePackProgressChangedNotification` notification. Call `-integerValue` on the object to receive the `MGLOfflinePackState`-typed state.

  #### Declaration

  Objective-C

      extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyState

  Swift

      static let state: MGLOfflinePackUserInfoKey

  View Source on GitHub
- `MGLOfflinePackUserInfoKeyProgress`

  The key for an `NSValue` object that indicates an offline pack’s current progress. This key is used in the `userInfo` dictionary of an `MGLOfflinePackProgressChangedNotification` notification. Call `-MGLOfflinePackProgressValue` on the object to receive the `MGLOfflinePackProgress`-typed progress.

  #### Declaration

  Objective-C

      extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyProgress

  Swift

      static let progress: MGLOfflinePackUserInfoKey

  View Source on GitHub
- `MGLOfflinePackUserInfoKeyError`

  The key for an `NSError` object that is encountered in the course of downloading an offline pack. This key is used in the `userInfo` dictionary of an `MGLOfflinePackErrorNotification` notification. The error’s domain is `MGLErrorDomain`. See `MGLErrorCode` for possible error codes.

  #### Declaration

  Objective-C

      extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyError

  Swift

      static let error: MGLOfflinePackUserInfoKey

  View Source on GitHub
- `MGLOfflinePackUserInfoKeyMaximumCount`

  The key for an `NSNumber` object that indicates the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. This key is used in the `userInfo` dictionary of an `MGLOfflinePackMaximumMapboxTilesReachedNotification` notification. Call `-unsignedLongLongValue` on the object to receive the `uint64_t`-typed tile limit.

  #### Declaration

  Objective-C

      extern const MGLOfflinePackUserInfoKey _Nonnull MGLOfflinePackUserInfoKeyMaximumCount

  Swift

      static let maximumCount: MGLOfflinePackUserInfoKey

  View Source on GitHub

- `MGLTileSourceOptionDEMEncoding`

  An `NSNumber` object containing an unsigned integer that specifies the encoding formula for raster-dem tilesets. The integer corresponds to one of the constants described in `MGLDEMEncoding`.

  The default value for this option is `MGLDEMEncodingMapbox`.

  This option cannot be represented in a TileJSON or style JSON file. It is used with the `MGLRasterDEMSource` class and is ignored when creating an `MGLRasterTileSource` or `MGLVectorTileSource` object.

  #### Declaration

  Objective-C

      extern const MGLTileSourceOption MGLTileSourceOptionDEMEncoding

  Swift

      static let demEncoding: MGLTileSourceOption

  View Source on GitHub

- `MGLTileSourceOptionTileSize`

  An `NSNumber` object 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 tile 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 `MGLRasterTileSource` objects; it is ignored when initializing `MGLVectorTileSource` objects.

  #### Declaration

  Objective-C

      extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileSize

  Swift

      static let tileSize: MGLTileSourceOption

  View Source on GitHub

- `MGLShapeSourceOptionClustered`

  An `NSNumber` object containing a Boolean enabling or disabling clustering. If the `shape` property contains point shapes, setting this option to `YES` clusters the points by radius into groups. The default value is `NO`.

  This option corresponds to the `cluster` source property in the Mapbox Style Specification.

  This option only affects point features within an `MGLShapeSource` object; it is ignored when creating an `MGLComputedShapeSource` object.

  #### Related examples

  See the Cluster point data and Use images to cluster point data examples to learn how to cluster point data with this `MGLShapeSourceOption`.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClustered

  Swift

      static let clustered: MGLShapeSourceOption

  View Source on GitHub
- `MGLShapeSourceOptionClusterRadius`

  An `NSNumber` object 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.

  This option only affects point features within an `MGLShapeSource` object; it is ignored when creating an `MGLComputedShapeSource` object.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionClusterRadius

  Swift

      static let clusterRadius: MGLShapeSourceOption

  View Source on GitHub
- `MGLShapeSourceOptionMaximumZoomLevelForClustering`

  An `NSNumber` object 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 of `MGLShapeSourceOptionMaximumZoomLevel` so that, at the maximum zoom level, the shapes are not clustered.

  This option corresponds to the `clusterMaxZoom` source property in the Mapbox Style Specification.

  This option only affects point features within an `MGLShapeSource` object; it is ignored when creating an `MGLComputedShapeSource` object.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevelForClustering

  Swift

      static let maximumZoomLevelForClustering: MGLShapeSourceOption

  View Source on GitHub
- `MGLShapeSourceOptionMinimumZoomLevel`

  An `NSNumber` object containing an integer; specifies the minimum zoom level at which to create vector tiles. The default value is 0.

  This option corresponds to the `minzoom` source property in the Mapbox Style Specification.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMinimumZoomLevel

  Swift

      static let minimumZoomLevel: MGLShapeSourceOption

  View Source on GitHub
- `MGLShapeSourceOptionMaximumZoomLevel`

  An `NSNumber` object 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 option corresponds to the `maxzoom` source property in the Mapbox Style Specification.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionMaximumZoomLevel

  Swift

      static let maximumZoomLevel: MGLShapeSourceOption

  View Source on GitHub
- `MGLShapeSourceOptionBuffer`

  An `NSNumber` object 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 option corresponds to the `buffer` source property in the Mapbox Style Specification.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionBuffer

  Swift

      static let buffer: MGLShapeSourceOption

  View Source on GitHub
- `MGLShapeSourceOptionSimplificationTolerance`

  An `NSNumber` object 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 option corresponds to the `tolerance` source property in the Mapbox Style Specification.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionSimplificationTolerance

  Swift

      static let simplificationTolerance: MGLShapeSourceOption

  View Source on GitHub
- `MGLShapeSourceOptionLineDistanceMetrics`

  An `NSNumber` object containing a Boolean enabling or disabling calculating line distance metrics.

  Set this property to `YES` in order for the `MGLLineStyleLayer.lineGradient` property to have its intended effect. The default value is `NO`.

  This option corresponds to the `lineMetrics` source property in the Mapbox Style Specification.

  #### Declaration

  Objective-C

      extern const MGLShapeSourceOption _Nonnull MGLShapeSourceOptionLineDistanceMetrics

  Swift

      static let lineDistanceMetrics: MGLShapeSourceOption

  View Source on GitHub

- `MGLStyleDefaultVersion`

  A version number identifying the default version of the Mapbox Streets style obtained through the `MGLStyle.streetsStyleURL` method. This version number may also be passed into the `+[MGLStyle streetsStyleURLWithVersion:]` method.

  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 `MGLMapView` and `MGLTilePyramidOfflineRegion` when 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 = 11

  Swift

      let MGLStyleDefaultVersion: Int

  View Source on GitHub

- `MGLTileSourceOptionMinimumZoomLevel`

  An `NSNumber` object 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 `minzoom` key in the TileJSON specification.

  #### Declaration

  Objective-C

      extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMinimumZoomLevel

  Swift

      static let minimumZoomLevel: MGLTileSourceOption

  View Source on GitHub
- `MGLTileSourceOptionMaximumZoomLevel`

  An `NSNumber` object 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 `maxzoom` key in the TileJSON specification.

  #### Declaration

  Objective-C

      extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionMaximumZoomLevel

  Swift

      static let maximumZoomLevel: MGLTileSourceOption

  View Source on GitHub
- `MGLTileSourceOptionCoordinateBounds`

  An `NSValue` object containing an `MGLCoordinateBounds` struct that specifies the geographic extent of the source.

  If this option is specified, the SDK avoids requesting any tile that falls outside of the coordinate bounds. Otherwise, the SDK requests any tile needed to cover the viewport, as it does by default.

  This option corresponds to the `bounds` key in the TileJSON specification.

  #### Declaration

  Objective-C

      extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionCoordinateBounds

  Swift

      static let coordinateBounds: MGLTileSourceOption

  View Source on GitHub
- `MGLTileSourceOptionAttributionHTMLString`

  An HTML string defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.

  By default, no attribution statements are displayed. If the `MGLTileSourceOptionAttributionInfos` option is specified, this option is ignored.

  This option corresponds to the `attribution` key in the TileJSON specification.

  #### Declaration

  Objective-C

      extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionHTMLString

  Swift

      static let attributionHTMLString: MGLTileSourceOption

  View Source on GitHub
- `MGLTileSourceOptionAttributionInfos`

  An array of `MGLAttributionInfo` objects defining the buttons to be displayed in an action sheet when the source is part of a map view’s style and the map view’s attribution button is pressed.

  By default, no attribution statements are displayed.

  #### Declaration

  Objective-C

      extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionAttributionInfos

  Swift

      static let attributionInfos: MGLTileSourceOption

  View Source on GitHub
- `MGLTileSourceOptionTileCoordinateSystem`

  An `NSNumber` object 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 in `MGLTileCoordinateSystem`.

  The default value for this option is `MGLTileCoordinateSystemXYZ`.

  This option corresponds to the `scheme` key in the TileJSON specification.

  #### Declaration

  Objective-C

      extern const MGLTileSourceOption _Nonnull MGLTileSourceOptionTileCoordinateSystem

  Swift

      static let tileCoordinateSystem: MGLTileSourceOption

  View Source on GitHub

- `MGLErrorDomain`

  Indicates an error occurred in the Mapbox SDK.

  #### Declaration

  Objective-C

      extern const NSErrorDomain _Nonnull MGLErrorDomain

  Swift

      let MGLErrorDomain: String

  View Source on GitHub

- `MGLExpressionInterpolationModeLinear`

  An `NSString` identifying the `linear` interpolation type in an `NSExpression`.

  This attribute corresponds to the `linear` value in the `interpolate` expression operator in the Mapbox Style Specification.

  #### Declaration

  Objective-C

      extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeLinear

  Swift

      static let linear: MGLExpressionInterpolationMode

  View Source on GitHub
- `MGLExpressionInterpolationModeExponential`

  An `NSString` identifying the `expotential` interpolation type in an `NSExpression`.

  This attribute corresponds to the `exponential` value in the `interpolate` expression operator in the Mapbox Style Specification.

  #### Declaration

  Objective-C

      extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeExponential

  Swift

      static let exponential: MGLExpressionInterpolationMode

  View Source on GitHub
- `MGLExpressionInterpolationModeCubicBezier`

  An `NSString` identifying the `cubic-bezier` interpolation type in an `NSExpression`.

  This attribute corresponds to the `cubic-bezier` value in the `interpolate` expression operator in the Mapbox Style Specification.

  #### Declaration

  Objective-C

      extern const MGLExpressionInterpolationMode _Nonnull MGLExpressionInterpolationModeCubicBezier

  Swift

      static let cubicBezier: MGLExpressionInterpolationMode

  View Source on GitHub

- `MGLMapViewDecelerationRateNormal`

  The default deceleration rate for a map view.

  #### Declaration

  Objective-C

      extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateNormal

  Swift

      static let normal: MGLMapViewDecelerationRate

  View Source on GitHub
- `MGLMapViewDecelerationRateFast`

  A fast deceleration rate for a map view.

  #### Declaration

  Objective-C

      extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateFast

  Swift

      static let fast: MGLMapViewDecelerationRate

  View Source on GitHub
- `MGLMapViewDecelerationRateImmediate`

  Disables deceleration in a map view.

  #### Declaration

  Objective-C

      extern const MGLMapViewDecelerationRate MGLMapViewDecelerationRateImmediate

  Swift

      static let immediate: MGLMapViewDecelerationRate

  View Source on GitHub
- `MGLMapViewPreferredFramesPerSecondDefault`

  The default frame rate. This can be either 30 FPS or 60 FPS, depending on device capabilities.

  #### Declaration

  Objective-C

      extern const MGLMapViewPreferredFramesPerSecond
          MGLMapViewPreferredFramesPerSecondDefault

  Swift

      static let `default`: MGLMapViewPreferredFramesPerSecond

  View Source on GitHub
- `MGLMapViewPreferredFramesPerSecondLowPower`

  A conservative frame rate; typically 30 FPS.

  #### Declaration

  Objective-C

      extern const MGLMapViewPreferredFramesPerSecond
          MGLMapViewPreferredFramesPerSecondLowPower

  Swift

      static let lowPower: MGLMapViewPreferredFramesPerSecond

  View Source on GitHub
- `MGLMapViewPreferredFramesPerSecondMaximum`

  The maximum supported frame rate; typically 60 FPS.

  #### Declaration

  Objective-C

      extern const MGLMapViewPreferredFramesPerSecond
          MGLMapViewPreferredFramesPerSecondMaximum

  Swift

      static let maximum: MGLMapViewPreferredFramesPerSecond

  View Source on GitHub

- `MapboxVersionNumber`

  Project version number for Mapbox.

  #### Declaration

  Objective-C

      extern double MapboxVersionNumber

  Swift

      var MapboxVersionNumber: Double

  View Source on GitHub
- `MapboxVersionString`

  Project version string for Mapbox.

  #### Declaration

  Objective-C

      extern const unsigned char MapboxVersionString[]

  View Source on GitHub