-mapView:annotationCanShowCallout: returns a boolean value indicating whether the annotation can display additional information inside a callout.-mapView:didSelectAnnotation: is called when an annotation is tapped on.-mapView:imageForAnnotation: returns an MGLAnnotationImage that can associate a UIImage with a specific MGLPointAnnotation.-mapView:viewForAnnotation: returns an MGLAnnotationView that can associate a UIView with a specific MGLPointAnnotation.Commonly implemented delegate methods include: How annotations workĪny MGLPointAnnotation, MGLLine, or MGLPolygon that conforms to the MGLAnnotation protocol can be used to annotate the map to mark a place with a specific shape.īy implementing optional MGLMapViewDelegate, you can customize the basic styling of annotations. If your project includes those requirements, consider using our more performant MGLStyleLayer classes, detailed below. But using annotations is not recommended if you need to add a large number of markers to a map, or if you also need to style annotations differently based on a specific data property. It has built-in dragging and selection support. Approach 1: Use annotationsĪnnotations provide an interface that will look familiar if you've used annotations in MapKit. Below is an overview of the three main approaches with descriptions of their advantages and disadvantages and related resources for implementing each approach.įor a summary of features supported by each API, see the Compare use cases table, below.įor a high-level overview of visualizing point data with Mapbox, see our Add markers getting started guide. You can use several approaches to add markers and shapes to a map. Learn about the latest version, v10.12.0, in the Maps SDK documentation. This page uses v6.4.1 of the Mapbox Maps SDK. A newer version of the Maps SDK is available
0 Comments
Leave a Reply. |