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;
Swift
init(title: NSAttributedString, url URL: 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, assign, unsafe_unretained, readwrite)
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, assign, unsafe_unretained, readwrite, 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 }
-feedbackURLAtCenterCoordinate:zoomLevel:
Returns a copy of the URL
property modified to account for the given center coordinate and zoom level.
Declaration
Objective-C
- (nullable NSURL *)feedbackURLAtCenterCoordinate:
(CLLocationCoordinate2D)centerCoordinate
zoomLevel:(double)zoomLevel;
Swift
func feedbackURL(atCenter centerCoordinate: CLLocationCoordinate2D, zoomLevel: Double) -> URL?
Parameters
centerCoordinate
The map’s center coordinate.
zoomLevel
The map’s zoom level. See the MGLMapView.zoomLevel
property for more information.
Return Value
A modified URL containing a fragment that points to the specified viewport. If the feedbackLink
property is set to NO
, this method returns nil
.
-titleWithStyle:
Returns a copy of the current title
formatted accordingly to style
.
Example: If the style
property is set to MGLAttributionInfoStyleShort
and the title
property is set to OpenStreetMap
, then this method returns OSM
.
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.
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