An interactive, customizable map view with an interface similar to the one provided by Apple’s MapKit.
MGLMapView, you can embed the map inside a view, allow users to manipulate it with standard gestures, animate the map between different viewpoints, and present information in the form of annotations and overlays.
The map view loads scalable vector tiles that conform to the Mapbox Vector Tile Specification. It styles them with a style that conforms to the Mapbox Style Specification. Such styles can be designed in Mapbox Studio and hosted on mapbox.com.
A collection of Mapbox-hosted styles is available through the
MGLStyleclass. These basic styles use Mapbox Streets or Mapbox Satellite data sources, but you can specify a custom style that makes use of your own data.
Mapbox-hosted vector tiles and styles require an API access token, which you can obtain from the Mapbox account page. Access tokens associate requests to Mapbox’s vector tile and style APIs with your Mapbox account. They also deter other developers from using your styles without your permission.
@interface MGLMapView : NSView
class MGLMapView : NSView
MGLMapViewDelegateprotocol defines a set of optional methods that you can use to receive messages from an
MGLMapViewinstance. Because many map operations require the
MGLMapViewclass to load data asynchronously, the map view calls these methods to notify your application when specific operations complete. The map view also uses these methods to request information about annotations displayed on the map, such as the styles and interaction modes to apply to individual annotations.
@protocol MGLMapViewDelegate <NSObject>
protocol MGLMapViewDelegate : NSObjectProtocol