Other Classes
MGLAttributedExpression
@interface MGLAttributedExpression : NSObject
An MGLAttributedExpression
object associates text formatting attibutes (such as
font size or
font names) to an NSExpression
.
Example
let redColor = UIColor.red
let expression = NSExpression(forConstantValue: "Foo")
let attributes: [MGLAttributedExpressionKey: NSExpression] = [.fontNamesAttribute : NSExpression(forConstantValue: ["DIN Offc Pro Italic",
"Arial Unicode MS Regular"]),
.fontScaleAttribute: NSExpression(forConstantValue: 1.2),
.fontColorAttribute: NSExpression(forConstantValue: redColor)]
let attributedExpression = MGLAttributedExpression(expression, attributes:attributes)
-
expression
The expression content of the receiver as
NSExpression
.Declaration
Objective-C
@property (nonatomic, strong) NSExpression *_Nonnull expression;
Swift
var expression: NSExpression { get set }
-
attributes
The formatting attributes dictionary. Key | Value Type — | —
MGLFontNamesAttribute
| AnNSExpression
evaluating to anNSString
array.MGLFontScaleAttribute
| AnNSExpression
evaluating to anNSNumber
value.MGLFontColorAttribute
| AnNSExpression
evaluating to anUIColor
.Declaration
Objective-C
@property (nonatomic, strong, readonly) NSDictionary<MGLAttributedExpressionKey, NSExpression *> *_Nonnull attributes;
Swift
var attributes: [MGLAttributedExpressionKey : NSExpression] { get }
-
-initWithExpression:
Returns an
MGLAttributedExpression
object initialized with an expression and no attribute information.Declaration
Objective-C
- (nonnull instancetype)initWithExpression:(nonnull NSExpression *)expression;
Swift
init(expression: NSExpression)
-
-initWithExpression:attributes:
Returns an
MGLAttributedExpression
object initialized with an expression and text format attributes.Declaration
Objective-C
- (nonnull instancetype) initWithExpression:(nonnull NSExpression *)expression attributes:(nonnull NSDictionary<MGLAttributedExpressionKey, NSExpression *> *)attrs;
Swift
init(expression: NSExpression, attributes attrs: [MGLAttributedExpressionKey : NSExpression] = [:])
-
+attributedExpression:fontNames:fontScale:
Creates an
MGLAttributedExpression
object initialized with an expression and the format attributes for font names and font size.Declaration
Objective-C
+ (nonnull instancetype)attributedExpression:(nonnull NSExpression *)expression fontNames: (nullable NSArray<NSString *> *)fontNames fontScale:(nullable NSNumber *)fontScale;
Swift
convenience init(_ expression: NSExpression, fontNames: [String]?, fontScale: NSNumber?)
-
+attributedExpression:attributes:
Creates an
MGLAttributedExpression
object initialized with an expression and the format attributes dictionary.Declaration
Objective-C
+ (nonnull instancetype) attributedExpression:(nonnull NSExpression *)expression attributes:(nonnull NSDictionary<MGLAttributedExpressionKey, NSExpression *> *)attrs;
Swift
convenience init(_ expression: NSExpression, attributes attrs: [MGLAttributedExpressionKey : NSExpression] = [:])
MGLAttributionInfo
@interface MGLAttributionInfo : NSObject
Information about an attribution statement, usually a copyright or trademark statement, associated with a map content source.
-
-initWithTitle:URL:
Returns an initialized attribution info object with the given title and URL.
Declaration
Objective-C
- (nonnull instancetype)initWithTitle:(nonnull NSAttributedString *)title URL:(nullable NSURL *)URL;
Parameters
title
The attribution statement’s title.
URL
A URL to more information about the entity named in the attribution.
Return Value
An initialized attribution info object.
-
title
The attribution statement’s attributed title text.
Declaration
Objective-C
@property (nonatomic) NSAttributedString *_Nonnull title;
Swift
var title: NSAttributedString { get set }
-
URL
The URL to more information about the entity named in the attribution.
If this property is set, the attribution statement should be displayed as a hyperlink or action button. Otherwise, if it is
nil
, the attribution statement should be displayed as plain text.Declaration
Objective-C
@property (nonatomic, nullable) NSURL *URL;
Swift
var url: URL? { get set }
-
feedbackLink
A Boolean value indicating whether the attribution statement is a shortcut to a feedback tool.
If this property is set, the statement should be treated as a way for the user to provide feedback rather than an attribution statement.
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite, getter=isFeedbackLink) BOOL feedbackLink;
Swift
var isFeedbackLink: Bool { get set }
-
-titleWithStyle:
Returns a copy of the current
title
formatted accordingly tostyle
.Example: If the
style
property is set toMGLAttributionInfoStyleShort
and thetitle
property is set toOpenStreetMap
, then this method returnsOSM
.Declaration
Objective-C
- (nonnull NSAttributedString *)titleWithStyle:(MGLAttributionInfoStyle)style;
Swift
func title(with style: MGLAttributionInfoStyle) -> NSAttributedString
Parameters
style
The attribution info style.
Return Value
The
NSAttributedString
styled title.
MGLDefaultStyle
@interface MGLDefaultStyle : NSObject
The MGLDefaultStyle
defines the predefined vendor style
-
url
The style URL
Declaration
Objective-C
@property (nonatomic, retain) NSURL *_Nonnull url;
Swift
var url: URL { get set }
-
name
The style name
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull name;
Swift
var name: String { get set }
-
version
The style version
Declaration
Objective-C
@property (nonatomic) int version;
Swift
var version: Int32 { get set }
MGLLoggingConfiguration
@interface MGLLoggingConfiguration : NSObject
The MGLLoggingConfiguration
object provides a global way to set this SDK logging
levels
and logging handler.
-
handler
The handler this SDK uses to log messages.
If this property is set to nil or if no custom handler is provided this property is set to the default handler.
The default handler uses
os_log
andNSLog
for iOS 10+ and iOS < 10 respectively.Declaration
Objective-C
@property (nonatomic, copy, null_resettable) MGLLoggingBlockHandler handler;
Swift
var handler: MGLLoggingBlockHandler! { get set }
-
loggingLevel
The logging level.
The default value is
MGLLoggingLevelNone
.Setting this property includes logging levels less than or equal to the setted value.
Declaration
Objective-C
@property (nonatomic) MGLLoggingLevel loggingLevel;
Swift
var loggingLevel: MGLLoggingLevel { get set }
-
sharedConfiguration
Returns the shared logging object.
Declaration
Objective-C
@property (class, nonatomic, readonly) MGLLoggingConfiguration *_Nonnull sharedConfiguration;
Swift
class var shared: MGLLoggingConfiguration { get }
MGLMapProjection
@interface MGLMapProjection : NSObject
The aim of this class is to provide the functionality of changing the camera state and converting between map view screen coordinates and geographical coordinates without changing the actual map view camera state.
-
-initWithMapView:
Initializes and returns the new projection object with the current camera state from the provided map view.
Declaration
Objective-C
- (nonnull instancetype)initWithMapView:(nonnull MGLMapView *)mapView;
Swift
init(mapView: MGLMapView)
Parameters
mapView
The map view the camera state to use for the initialization.
Return Value
An initialized map projection.
-
camera
A camera representing the current projection state
Declaration
Objective-C
@property (copy, readonly) MGLMapCamera *_Nonnull camera;
Swift
@NSCopying var camera: MGLMapCamera { get }
-
-setCamera:withEdgeInsets:
Change the projection state with camera and padding values.
Note
MGLMapView
instance frame must not be changed since this projection is initialized, otherwise the calculation may be wrong.Declaration
Objective-C
- (void)setCamera:(MGLMapCamera *_Nonnull)camera withEdgeInsets:(UIEdgeInsets)insets;
Swift
func setCamera(_ camera: MGLMapCamera, with insets: UIEdgeInsets)
Parameters
camera
The new camera to be used in the projection calculation.
insets
The insets applied on top of the camera be used in the projection calculation.
-
-setVisibleCoordinateBounds:edgePadding:
Change the projection state to make the provided bounds visible with the specified inset.
Note
MGLMapView
instance frame must not be changed since this projection is initialized, otherwise the calculation may be wrong.Declaration
Objective-C
- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets;
Swift
func setVisibleCoordinateBounds(_ bounds: MGLCoordinateBounds, edgePadding insets: UIEdgeInsets)
Parameters
bounds
The bounds that the viewport should fit.
insets
The insets applied on top of the viewport to be used in the projection calculation.
-
-convertPoint:
Converts a point in the coordinate system of the map view the projection was initialized with to the geographical coordinate.
Declaration
Objective-C
- (CLLocationCoordinate2D)convertPoint:(CGPoint)point;
Swift
func convert(_ point: CGPoint) -> CLLocationCoordinate2D
Parameters
point
The point to convert.
Return Value
The geographic coordinate at the given point.
-
-convertCoordinate:
Converts a geographic coordinate to a point in the map view’s the projection was initialized with coordinate system.
Declaration
Objective-C
- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate;
Swift
func convert(_ coordinate: CLLocationCoordinate2D) -> CGPoint
Parameters
coordinate
The geographic coordinate to convert.
Return Value
The point corresponding to the given geographic coordinate.
-
metersPerPoint
The distance in meters spanned by a single point for the current camera.
Declaration
Objective-C
@property (readonly) CLLocationDistance metersPerPoint;
Swift
var metersPerPoint: CLLocationDistance { get }
MGLMapSnapshotOverlay
@interface MGLMapSnapshotOverlay : NSObject
An overlay that is placed within a
MGLMapSnapshot
.
To access this object, use
-[MGLMapSnapshotter startWithOverlayHandler:completionHandler:]
.
-
context
The current
CGContext
that snapshot is drawing within. You may use this context to perform additional custom drawing.Declaration
Objective-C
@property (nonatomic, readonly) CGContextRef _Nonnull context;
Swift
var context: CGContext { get }
-
-pointForCoordinate:
Converts the specified map coordinate to a point in the coordinate space of the context.
Declaration
Objective-C
- (CGPoint)pointForCoordinate:(CLLocationCoordinate2D)coordinate;
Swift
func point(for coordinate: CLLocationCoordinate2D) -> CGPoint
-
-coordinateForPoint:
Converts the specified context point to a map coordinate.
Declaration
Objective-C
- (CLLocationCoordinate2D)coordinateForPoint:(CGPoint)point;
Swift
func coordinate(for point: CGPoint) -> CLLocationCoordinate2D
MGLNetworkConfiguration
@interface MGLNetworkConfiguration : NSObject
The MGLNetworkConfiguration
object provides a global way to set a base
NSURLSessionConfiguration
, and other resources.
-
sharedManager
Returns the shared instance of the
MGLNetworkConfiguration
class.Declaration
Objective-C
@property (class, nonatomic, readonly) MGLNetworkConfiguration *_Nonnull sharedManager;
Swift
class var sharedManager: MGLNetworkConfiguration { get }
-
sessionConfiguration
The session configuration object that is used by the
NSURLSession
objects in this SDK.If this property is set to nil or if no session configuration is provided this property is set to the default session configuration.
Assign this object before instantiating any
MGLMapView
object, or usingMGLOfflineStorage
Note
NSURLSession
objects store a copy of this configuration. Any further changes to mutable properties on this configuration object passed to a session’s initializer will not affect the behavior of that session.Note
Background sessions are not currently supported.
Declaration
Objective-C
@property (strong, null_resettable) NSURLSessionConfiguration *sessionConfiguration;
Swift
var sessionConfiguration: URLSessionConfiguration! { get set }
MGLTileServerOptions
@interface MGLTileServerOptions : NSObject
The MGLTileServerOptions
defines server properties such as URL etc…
-
baseURL
API base URL.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull baseURL;
Swift
var baseURL: String { get set }
-
uriSchemeAlias
Tile server URI alias.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull uriSchemeAlias;
Swift
var uriSchemeAlias: String { get set }
-
sourceTemplate
URL template for sources.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull sourceTemplate;
Swift
var sourceTemplate: String { get set }
-
sourceDomainName
source domain name.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull sourceDomainName;
Swift
var sourceDomainName: String { get set }
-
sourceVersionPrefix
source version prefix
Declaration
Objective-C
@property (nonatomic, retain, nullable) NSString *sourceVersionPrefix;
Swift
var sourceVersionPrefix: String? { get set }
-
styleTemplate
URL template for style.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull styleTemplate;
Swift
var styleTemplate: String { get set }
-
styleDomainName
style domain name.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull styleDomainName;
Swift
var styleDomainName: String { get set }
-
styleVersionPrefix
style version prefix
Declaration
Objective-C
@property (nonatomic, retain, nullable) NSString *styleVersionPrefix;
Swift
var styleVersionPrefix: String? { get set }
-
spritesTemplate
URL template for sprites.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull spritesTemplate;
Swift
var spritesTemplate: String { get set }
-
spritesDomainName
sprites domain name.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull spritesDomainName;
Swift
var spritesDomainName: String { get set }
-
spritesVersionPrefix
version prefix
Declaration
Objective-C
@property (nonatomic, retain, nullable) NSString *spritesVersionPrefix;
Swift
var spritesVersionPrefix: String? { get set }
-
glyphsTemplate
URL template for glyphs.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull glyphsTemplate;
Swift
var glyphsTemplate: String { get set }
-
glyphsDomainName
glyphs domain name.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull glyphsDomainName;
Swift
var glyphsDomainName: String { get set }
-
glyphsVersionPrefix
Glyphs version prefix
Declaration
Objective-C
@property (nonatomic, retain, nullable) NSString *glyphsVersionPrefix;
Swift
var glyphsVersionPrefix: String? { get set }
-
tileTemplate
URL template for tiles.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull tileTemplate;
Swift
var tileTemplate: String { get set }
-
tileDomainName
tile domain name.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull tileDomainName;
Swift
var tileDomainName: String { get set }
-
tileVersionPrefix
tile version prefix
Declaration
Objective-C
@property (nonatomic, retain, nullable) NSString *tileVersionPrefix;
Swift
var tileVersionPrefix: String? { get set }
-
apiKeyParameterName
API key parameter name.
Declaration
Objective-C
@property (nonatomic, retain) NSString *_Nonnull apiKeyParameterName;
Swift
var apiKeyParameterName: String { get set }
-
defaultStyles
Default styles.
Declaration
Objective-C
@property (nonatomic, retain) NSArray<MGLDefaultStyle *> *_Nonnull defaultStyles;
Swift
var defaultStyles: [MGLDefaultStyle] { get set }
-
defaultStyle
Default style
Declaration
Objective-C
@property (nonatomic, retain) MGLDefaultStyle *_Nonnull defaultStyle;
Swift
var defaultStyle: MGLDefaultStyle { get set }
MGLUserLocationAnnotationViewStyle
@interface MGLUserLocationAnnotationViewStyle : NSObject
A class containing information about the default User Location annotation view style.
-
puckFillColor
The fill color for the puck view.
Declaration
Objective-C
@property (nonatomic) UIColor *_Nonnull puckFillColor;
Swift
var puckFillColor: UIColor { get set }
-
puckShadowColor
The shadow color for the puck view.
Declaration
Objective-C
@property (nonatomic) UIColor *_Nonnull puckShadowColor;
Swift
var puckShadowColor: UIColor { get set }
-
puckShadowOpacity
The shadow opacity for the puck view. Set any value between 0.0 and 1.0. The default value of this property is equal to
0.25
Declaration
Objective-C
@property (nonatomic) CGFloat puckShadowOpacity;
Swift
var puckShadowOpacity: CGFloat { get set }
-
puckArrowFillColor
The fill color for the arrow puck.
Declaration
Objective-C
@property (nonatomic) UIColor *_Nonnull puckArrowFillColor;
Swift
var puckArrowFillColor: UIColor { get set }
-
haloFillColor
The fill color for the puck view.
Declaration
Objective-C
@property (nonatomic) UIColor *_Nonnull haloFillColor;
Swift
var haloFillColor: UIColor { get set }
-
approximateHaloFillColor
The halo fill color for the approximate view.
Declaration
Objective-C
@property (nonatomic) API_AVAILABLE(ios(14)) UIColor *approximateHaloFillColor;
Swift
var approximateHaloFillColor: UIColor { get set }
-
approximateHaloBorderColor
The halo border color for the approximate view.
Declaration
Objective-C
@property (nonatomic) API_AVAILABLE(ios(14)) UIColor *approximateHaloBorderColor;
Swift
var approximateHaloBorderColor: UIColor { get set }
-
approximateHaloBorderWidth
The halo border width for the approximate view. The default value of this property is equal to
2.0
Declaration
Objective-C
@property (nonatomic) CGFloat approximateHaloBorderWidth;
Swift
var approximateHaloBorderWidth: CGFloat { get set }
-
approximateHaloOpacity
The halo opacity for the approximate view. Set any value between 0.0 and 1.0 The default value of this property is equal to
0.15
Declaration
Objective-C
@property (nonatomic) CGFloat approximateHaloOpacity;
Swift
var approximateHaloOpacity: CGFloat { get set }