NSValue(MGLAdditions)
@interface NSValue (MGLAdditions)
Methods for round-tripping values for MapLibre-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.
MGLCoordinateValue
The Core Location geographic coordinate structure representation of the value.
Declaration
Objective-C
@property (atomic, readonly) CLLocationCoordinate2D MGLCoordinateValue;
Swift
var mglCoordinateValue: CLLocationCoordinate2D { get }
+valueWithMGLMapPoint:
Creates a new value object containing the specified 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.
MGLMapPointValue
The map point structure representation of the value.
Declaration
Objective-C
@property (atomic, readonly) MGLMapPoint MGLMapPointValue;
Swift
var mglMapPointValue: MGLMapPoint { get }
+valueWithMGLCoordinateSpan:
Creates a new value object containing the specified 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.
MGLCoordinateSpanValue
The coordinate span structure representation of the value.
Declaration
Objective-C
@property (atomic, readonly) MGLCoordinateSpan MGLCoordinateSpanValue;
Swift
var mglCoordinateSpanValue: MGLCoordinateSpan { get }
+valueWithMGLCoordinateBounds:
Creates a new value object containing the specified 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.
MGLCoordinateBoundsValue
The coordinate bounds structure representation of the value.
Declaration
Objective-C
@property (atomic, readonly) MGLCoordinateBounds MGLCoordinateBoundsValue;
Swift
var mglCoordinateBoundsValue: MGLCoordinateBounds { get }
+valueWithMGLCoordinateQuad:
Creates a new value object containing the specified 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.
-MGLCoordinateQuadValue
The coordinate quad structure representation of the value.
Declaration
Objective-C
- (MGLCoordinateQuad)MGLCoordinateQuadValue;
Swift
func mglCoordinateQuadValue() -> MGLCoordinateQuad
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.
MGLOfflinePackProgressValue
The MGLOfflinePackProgress
structure representation of the value.
Declaration
Objective-C
@property (atomic, readonly) MGLOfflinePackProgress MGLOfflinePackProgressValue;
Swift
var mglOfflinePackProgressValue: MGLOfflinePackProgress { get }
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.
MGLTransitionValue
The MGLTransition
structure representation of the value.
Declaration
Objective-C
@property (atomic, readonly) MGLTransition MGLTransitionValue;
Swift
var mglTransitionValue: MGLTransition { get }
+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.
MGLSphericalPositionValue
The MGLSphericalPosition
structure representation of the value.
Declaration
Objective-C
@property (atomic, readonly) MGLSphericalPosition MGLSphericalPositionValue;
Swift
var mglSphericalPositionValue: MGLSphericalPosition { get }
+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.
MGLLightAnchorValue
The MGLLightAnchor
enum representation of the value.
Declaration
Objective-C
@property (atomic, readonly) MGLLightAnchor MGLLightAnchorValue;
Swift
var mglLightAnchorValue: MGLLightAnchor { get }
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