Classes

The following classes are available globally.

  • An APIRequest is a class that is used to capture an asynchronous result from a HTTP request. This class will be called by the SDK when the result has completed, and acts as a way to communicate the data back to the client logic.

    Note

    Internally APIRequest will capture the state of the request if the SDK client did not install a callback in-time. This avoid any race with the asynchronous request.

    Note

    All callbacks will always be invoked on the main application thread.

    See more

    Declaration

    Swift

    public class APIRequest<DataType>
  • A Category is a collection of similar Locations, which may have parent or child categories. For example, you may have a Fashion category, which has a Men’s Fashion and Women’s Fashion category. A Men’s clothing store would belong to the Men’s Fashion category, but not necessarily be present in the Fashion category’s list of Locations.

    See more

    Declaration

    Swift

    public class Category : Deserializable
  • A Connection links two or more Coordinate together. For example, Stairs or an elevator.

    See more

    Declaration

    Swift

    public class Connection : Location, Indexed
  • A coordinate represents a 3-dimensional position that is in reference to a a specific Map’s origin. A Coordinate is different from just a vector in the way that it is tagged to only pertain to a single map.

    See more

    Declaration

    Swift

    public class Coordinate : Navigatable, Focusable, Indexed, Deserializable
    extension Coordinate: Hashable
    extension Coordinate: Position
  • A location is something like a store or washroom on a map.

    A location can also belong to zero or more Categories (Store, Jewelery Store, etc), and will be linked to zero or more Nodes and Polygons.

    A location’s nodes can be on multiple maps, or in multiple non-adjacent places on the same map. For example, all washrooms at a given venue could belong to one Location, or a department store could live on multiple floors.

    See more

    Declaration

    Swift

    open class Location : Deserializable
    extension Location: Navigatable
    extension Location: Equatable
    extension Location: Hashable
  • Map

    A Map belonging to a given venue. Typically represents a certain floor. Give this to MapView to display to the user. The floor property can be used to determine the order of the floors (first, second, third, etc)

    See more

    Declaration

    Swift

    public class Map : Focusable, Indexed, Deserializable
    extension Map: Equatable
  • MapView is a custom view designed to handle displaying Maps for a Venue. call setMap(Map) to display the first map.

    See more

    Declaration

    Swift

    public class MapView : UIView
  • A vertical cylinder that can be displayed in the MapView. This can be used to indicate a object of intrest, or a person in the map.

    • Example: This will create an Cylinder and place it in the center of the map
    // initialize this element, and set it to the origin 
    let cylinder = Cylinder(
        position: Vector3(0, 0, 0),
        diameter: 4,
        height: 4,
        color: UIColor(red: 1.0, green: 0.29, blue: 0.03, alpha: 1.0)
    )
    // Add the element to the current Map View
    myMapView.add(cylinder)
    

    The results in:

    Cylinder

    See more

    Declaration

    Swift

    public final class Cylinder : Element, Focusable
  • A pseudo class marker to identify what is or isn’t an Element.

    This protocol should not be used as a 3rd party, as the actual mechanics of how Element interact with the MapView is internal the SDK. This is added as a way to identify what is or isn’t an Element in the type system.

    Declaration

    Swift

    public class Element
  • A ImageOverlay will overlay a UIImage on top of a Map. An Overlay is always on top of other elements, it will always be rotated in such a way that it is facing the MapView camera. The Overlay scales keeping the size consistent regardless of how far away the MapView Camera is.

    Note: an ImageOverlay will respect the alpha channel of the UIImage, so it can be used to do more sophisticated graphics on some areas.

    The ImageOverlay always tries to be a 1:1 pixel scale with the device’s screen. Meaning a high resolution image will end up much larger then an image that is a low resolution. Care should be taken in selecting the correctly scaled images.

    See more

    Declaration

    Swift

    public class ImageOverlay : Element
  • A Path is an Element that can show a route between two or more Coordinates on the map. This is used to help route a patron to their desired location.

    See more

    Declaration

    Swift

    public final class Path : Element, Focusable
  • A Prism is a class that allows the creation of any type of prism. It requires a 2D list of points that will be used to build that path. If there are N points, there will be N+1 Line segments as the last and the first point will always be joined.

    • Example:
    let points = [
        Vector2(0,1.2),
        Vector2(1.0,-1.2),
        Vector2(0,-0.8),
        Vector2(-1.0,-1.2)
    ]
    let prism = Prism(
        position: Vector3(50, 25, 0),
        heading: 0,
        points: points,
        height: 2,
        color: UIColor(red: 1.0, green: 0.29, blue: 0.03, alpha: 1.0)
    )
    self.mapView.add(prism)
    

    The results in:

    Prism

    See more

    Declaration

    Swift

    public final class Prism : Element, Focusable
  • A TextOverlay will overlay a UILabel on top of a Map. An Overlay is always on top of other elements, it will always be rotated in such a way that it is facing the MapView camera. The Overlay scales keeping the size consistent regardless of how far away the MapView Camera is.

    Since a UILabel is used, it can be themed anyway a normal UILabel can be. By default a UILabel does not get drawn with a background. This can make it difficult to read over a map in some typefaces. It is recommended that you manually set a background color. The background color will always be used to fill the backdrop of the TextOverlay.

    See more

    Declaration

    Swift

    public final class TextOverlay : ImageOverlay
  • The PathSolver is used to take a set of locations and create an ordered list of locations that is an efficent path though a venue.

    This solver cannot just give the best solution, as this a brute force solver would run in O(N!) time, which is not resonable if the number is bigger then half a dozen items.

    Instead of solving the problem all at once, the solver improves the solution continuously until a good enough solution is found.

    To expediate this result for users, the solver returns results periodically as it finds a better solution then the one it currently has.

    If the solver fails to improve it’s solution based on it’s internal huresitcs it will give up to save the users battery life.

    See more

    Declaration

    Swift

    public class PathSolver
  • The polygon class represents the 3D shape of a Location on a Map.

    A Location would have zero or more Polygons associated with it. For example, a Washroom Location might have a few Polygons spread throughout the Venue for each one that exists, but a single store might just have one presence, and therefor one Polygon. Some locations just have a single point and only have Coordinates.

    See more

    Declaration

    Swift

    public class Polygon : Navigatable, Focusable, Deserializable
    extension Polygon: Equatable
    extension Polygon: Hashable
  • Venue is a specific place (like a mall) with one or more maps (typically representing different floors) and locations (stores, washrooms, elevators, etc).

    Each Location is linked to:

    • zero or more Polygons which represent its physical presence on the map
    • zero or more nodes that represent entrances
    • zero or more Categories that group several Locations together

    A Venue can be in one of two states:

    1. As returned by getVenues() - When it’s initially pulled from the Mappedin API as part of a list of all venues your credentials have access to, it only contains basic information.
    2. As returned by getVenue() - When you retrieve the full details of a given venue, the locations, categories, maps, etc will be populated.
    See more

    Declaration

    Swift

    open class Venue
    extension Venue: Hashable
    extension Venue: Equatable