-
The
See moreDingiAccountManager
object provides a global way to set a DingiMap API access token.Declaration
Objective-C
@interface DingiAccountManager : NSObject
Swift
class DingiAccountManager : NSObject
-
An
See moreDingiMapCamera
object represents a viewpoint from which the user observes some point on anDingiMapView
.Declaration
Objective-C
@interface DingiMapCamera : NSObject <NSSecureCoding, NSCopying>
Swift
class DingiMapCamera : NSObject, NSSecureCoding, NSCopying
-
An interactive, customizable map view with an interface similar to the one provided by Apple’s MapKit.
Using
DingiMapView
, 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 DingiMap Vector Tile Specification. It styles them with a style that conforms to the DingiMap Style Specification.
A collection of Dingi-hosted styles is available through the
DingiStyle
class.DingiMap-hosted vector tiles and styles require an API access token, which you can obtain from the DingiMap account page. Access tokens associate requests to DingiMap’s vector tile and style APIs with your DingiMap account. They also deter other developers from using your styles without your permission.
Because
DingiMapView
loads asynchronously, several delegate methods are available for receiving map-related updates. These methods can be used to ensure that certain operations have completed before taking any additional actions. Information on these methods is located in theDingiMapViewDelegate
protocol documentation.Adding your own gesture recognizer to
DingiMapView
will block the corresponding gesture recognizer built intoDingiMapView
. To avoid conflicts, define which gesture takes precedence. For example, you can create your ownUITapGestureRecognizer
that will be invoked only if the defaultDingiMapView
tap gesture fails:let mapTapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(myCustomFunction)) for recognizer in mapView.gestureRecognizers! where recognizer is UITapGestureRecognizer { mapTapGestureRecognizer.require(toFail: recognizer) } mapView.addGestureRecognizer(mapTapGestureRecognizer)
Note
You are responsible for getting permission to use the map data and for ensuring that your use adheres to the relevant terms of use.Declaration
Objective-C
@interface DingiMapView : UIView
Swift
class DingiMapView : UIView
-
The mode used to track the user location on the map. Used with
See moreDingiMapView.userTrackingMode
.Declaration
Objective-C
enum DingiUserTrackingMode {}
Swift
enum DingiUserTrackingMode : UInt
-
The
See moreDingiMapViewDelegate
protocol defines a set of optional methods that you can use to receive map-related update messages. Because many map operations require theDingiMapView
class 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.Declaration
Objective-C
@protocol DingiMapViewDelegate <NSObject>
Swift
protocol DingiMapViewDelegate : NSObjectProtocol
-
An image generated by a snapshotter object.
See moreDeclaration
Objective-C
@interface DingiMapSnapshot : NSObject
Swift
class DingiMapSnapshot : NSObject
-
The options to use when creating images with the
See moreDingiMapSnapshotter
.Declaration
Objective-C
@interface DingiMapSnapshotOptions : NSObject
Swift
class DingiMapSnapshotOptions : NSObject
-
An
DingiMapSnapshotter
generates static raster images of the map. Each snapshot image depicts a portion of a map defined by anDingiMapSnapshotOptions
object you provide. The snapshotter generates anDingiMapSnapshot
object asynchronously, passing it into a completion handler once tiles and other resources needed for the snapshot are finished loading.You can change the snapshotter’s options at any time and reuse the snapshotter for multiple distinct snapshots; however, the snapshotter can only generate one snapshot at a time. If you need to generate multiple snapshots concurrently, create multiple snapshotter objects.
For an interactive map, use the
DingiMapView
class. BothDingiMapSnapshotter
andDingiMapView
are compatible with offline packs managed by theDingiOfflineStorage
class.Example
See morelet camera = DingiMapCamera(lookingAtCenter: CLLocationCoordinate2D(latitude: 37.7184, longitude: -122.4365), altitude: 100, pitch: 20, heading: 0) let options = DingiMapSnapshotOptions(styleURL: DingiStyle.satelliteStreetsStyleURL, camera: camera, size: CGSize(width: 320, height: 480)) options.zoomLevel = 10 let snapshotter = DingiMapSnapshotter(options: options) snapshotter.start { (snapshot, error) in if let error = error { fatalError(error.localizedDescription) } image = snapshot?.image }
Declaration
Objective-C
@interface DingiMapSnapshotter : NSObject
Swift
class DingiMapSnapshotter : NSObject