Protocols
The following protocols are available globally.
-
Deserializable
is a type that can be extracted from aBinaryDecoder
.This is typically used to extract an object or a struct from the decoder when a
Map
is being loaded.Note: Mappedin will supply source that implements this for you you should not have to do anything.
See moreDeclaration
Swift
public protocol Deserializable
-
A protocol used to classify what is or what isn’t an Direction Action
Declaration
Swift
public protocol DirectionsInstructionAction
-
All classes that implement the Navigatable protocol can be navigated to and from any other Navigatable object.
For example, you can navigate from a Coordinate to a Location and you will get a path from that Coordinate to the closest entrance node belonging to that Location. Beyond just pathing to a store, this might also be used for a “take me to the closest washroom” function. You can also navigate from an array of Navigatables to an Array of other Navigatables, and you will get the shortest path between an item in the first group to the second. This allows the ability to do advanced, high level things like “find a place to park that takes you closest to any restaurant”.
See moreDeclaration
Swift
public protocol Navigatable
-
A position is anything that can return a vector3 in a map, it is used to help place
Elements
in the screen.The most types to be used as a Position are
See moreVector3
orCoordinate
Declaration
Swift
public protocol Position
-
Used to connect to the Mappedin servers and retrieve venue data a
Service
once implemented is used to hold the apiKey’s and Venue type required to use the Mappedin SDKExample:
class ExampleService: Mappedin.Service { typealias VenueType = Venue let apiKey = "<key>" let apiSecret = "<secret>" let dataKey = "<data>" required init() {} } // It's important to have this step, this will modify the AppDelegate // to include Mappedin's analytics frameworks, your service will not // function if you do not install this. public let service = ExampleService(AppDelegate.self) // With that created, we can now initialized, we can call the Mappedin // API in order to get the required data from our servers. service.getVenues() .onComplete{ venues in // find your venue from the list of venues that service.getVenue(venues.first!).onComplete { venue in // With a venue loaded we can setup the MapView // but that will be shown in another example. } }
Declaration
Swift
public protocol Service