# NSValue(MGLAdditions)

    @interface NSValue (MGLAdditions)

Methods for round-tripping values for Mapbox-defined types.

### Working with Geographic Coordinate Values

- `+valueWithMGLCoordinate:`

  Creates a new value object containing the specified Core Location geographic coordinate structure.

  #### Declaration

  Objective-C

      + (nonnull instancetype)valueWithMGLCoordinate:
          (CLLocationCoordinate2D)coordinate;

  Swift

      convenience init(mglCoordinate coordinate: CLLocationCoordinate2D)

  #### Parameters

  `coordinate` | The value for the new object.

  #### Return Value

  A new value object that contains the geographic coordinate information.

  View Source on GitHub
- `MGLCoordinateValue`

  The Core Location geographic coordinate structure representation of the value.

  #### Declaration

  Objective-C

      @property (readonly, atomic) CLLocationCoordinate2D MGLCoordinateValue;

  Swift

      var mglCoordinateValue: CLLocationCoordinate2D { get }

  View Source on GitHub
- `+valueWithMGLMapPoint:`

  Creates a new value object containing the specified Mapbox map point structure.

  #### Declaration

  Objective-C

      + (nonnull instancetype)valueWithMGLMapPoint:(MGLMapPoint)point;

  Swift

      convenience init(mglMapPoint point: MGLMapPoint)

  #### Parameters

  `point` | The value for the new object.

  #### Return Value

  A new value object that contains the coordinate and zoom level information.

  View Source on GitHub
- `MGLMapPointValue`

  The Mapbox map point structure representation of the value.

  #### Declaration

  Objective-C

      @property (readonly, atomic) MGLMapPoint MGLMapPointValue;

  Swift

      var mglMapPointValue: MGLMapPoint { get }

  View Source on GitHub
- `+valueWithMGLCoordinateSpan:`

  Creates a new value object containing the specified Mapbox coordinate span structure.

  #### Declaration

  Objective-C

      + (nonnull instancetype)valueWithMGLCoordinateSpan:(MGLCoordinateSpan)span;

  Swift

      convenience init(mglCoordinateSpan span: MGLCoordinateSpan)

  #### Parameters

  `span` | The value for the new object.

  #### Return Value

  A new value object that contains the coordinate span information.

  View Source on GitHub
- `MGLCoordinateSpanValue`

  The Mapbox coordinate span structure representation of the value.

  #### Declaration

  Objective-C

      @property (readonly, atomic) MGLCoordinateSpan MGLCoordinateSpanValue;

  Swift

      var mglCoordinateSpanValue: MGLCoordinateSpan { get }

  View Source on GitHub
- `+valueWithMGLCoordinateBounds:`

  Creates a new value object containing the specified Mapbox coordinate bounds structure.

  #### Declaration

  Objective-C

      + (nonnull instancetype)valueWithMGLCoordinateBounds:
          (MGLCoordinateBounds)bounds;

  Swift

      convenience init(mglCoordinateBounds bounds: MGLCoordinateBounds)

  #### Parameters

  `bounds` | The value for the new object.

  #### Return Value

  A new value object that contains the coordinate bounds information.

  View Source on GitHub
- `MGLCoordinateBoundsValue`

  The Mapbox coordinate bounds structure representation of the value.

  #### Declaration

  Objective-C

      @property (readonly, atomic) MGLCoordinateBounds MGLCoordinateBoundsValue;

  Swift

      var mglCoordinateBoundsValue: MGLCoordinateBounds { get }

  View Source on GitHub
- `+valueWithMGLCoordinateQuad:`

  Creates a new value object containing the specified Mapbox coordinate quad structure.

  #### Declaration

  Objective-C

      + (nonnull instancetype)valueWithMGLCoordinateQuad:(MGLCoordinateQuad)quad;

  Swift

      convenience init(mglCoordinateQuad quad: MGLCoordinateQuad)

  #### Parameters

  `quad` | The value for the new object.

  #### Return Value

  A new value object that contains the coordinate quad information.

  View Source on GitHub
- `-MGLCoordinateQuadValue`

  The Mapbox coordinate quad structure representation of the value.

  #### Declaration

  Objective-C

      - (MGLCoordinateQuad)MGLCoordinateQuadValue;

  Swift

      func mglCoordinateQuadValue() -> MGLCoordinateQuad

  View Source on GitHub

### Working with Offline Map Values

- `+valueWithMGLOfflinePackProgress:`

  Creates a new value object containing the given `MGLOfflinePackProgress` structure.

  #### Declaration

  Objective-C

      + (nonnull NSValue *)valueWithMGLOfflinePackProgress:
          (MGLOfflinePackProgress)progress;

  Swift

      /*not inherited*/ init(mglOfflinePackProgress progress: MGLOfflinePackProgress)

  #### Parameters

  `progress` | The value for the new object.

  #### Return Value

  A new value object that contains the offline pack progress information.

  View Source on GitHub
- `MGLOfflinePackProgressValue`

  The `MGLOfflinePackProgress` structure representation of the value.

  #### Declaration

  Objective-C

      @property (readonly, atomic) MGLOfflinePackProgress MGLOfflinePackProgressValue;

  Swift

      var mglOfflinePackProgressValue: MGLOfflinePackProgress { get }

  View Source on GitHub

### Working with Transition Values

- `+valueWithMGLTransition:`

  Creates a new value object containing the given `MGLTransition` structure.

  #### Declaration

  Objective-C

      + (nonnull NSValue *)valueWithMGLTransition:(MGLTransition)transition;

  Swift

      /*not inherited*/ init(mglTransition transition: MGLTransition)

  #### Parameters

  `transition` | The value for the new object.

  #### Return Value

  A new value object that contains the transition information.

  View Source on GitHub
- `MGLTransitionValue`

  The `MGLTransition` structure representation of the value.

  #### Declaration

  Objective-C

      @property (readonly, atomic) MGLTransition MGLTransitionValue;

  Swift

      var mglTransitionValue: MGLTransition { get }

  View Source on GitHub
- `+valueWithMGLSphericalPosition:`

  Creates a new value object containing the given `MGLSphericalPosition` structure.

  #### Declaration

  Objective-C

      + (nonnull instancetype)valueWithMGLSphericalPosition:
          (MGLSphericalPosition)lightPosition;

  Swift

      convenience init(mglSphericalPosition lightPosition: MGLSphericalPosition)

  #### Parameters

  `lightPosition` | The value for the new object.

  #### Return Value

  A new value object that contains the light position information.

  View Source on GitHub
- `MGLSphericalPositionValue`

  The `MGLSphericalPosition` structure representation of the value.

  #### Declaration

  Objective-C

      @property (readonly, atomic) MGLSphericalPosition MGLSphericalPositionValue;

  Swift

      var mglSphericalPositionValue: MGLSphericalPosition { get }

  View Source on GitHub
- `+valueWithMGLLightAnchor:`

  Creates a new value object containing the given `MGLLightAnchor` enum.

  #### Declaration

  Objective-C

      + (nonnull NSValue *)valueWithMGLLightAnchor:(MGLLightAnchor)lightAnchor;

  Swift

      /*not inherited*/ init(mglLightAnchor lightAnchor: MGLLightAnchor)

  #### Parameters

  `lightAnchor` | The value for the new object.

  #### Return Value

  A new value object that contains the light anchor information.

  View Source on GitHub
- `MGLLightAnchorValue`

  The `MGLLightAnchor` enum representation of the value.

  #### Declaration

  Objective-C

      @property (readonly, atomic) MGLLightAnchor MGLLightAnchorValue;

  Swift

      var mglLightAnchorValue: MGLLightAnchor { get }

  View Source on GitHub