TGMarker


@interface TGMarker : NSObject

Marker interface that makes you able to add icons, polylines and polygons to the map view.

The marker style should defined using the Tangram YAML syntax.

  • Similar to -[TGMarker point] except that the point will transition to the geographic coordinate with a transition of time seconds and with an ease type function of type ease (See TGEaseType) from its previous coordinate, if a point geometry hasn’t been set any coordinate yet, this method will act as -[TGMarker point].

    Note

    Markers can have their geometry set multiple time with possibly different geometry types.

    Declaration

    Objective-C

    - (void)pointEased:(CLLocationCoordinate2D)point
               seconds:(NSTimeInterval)seconds
              easeType:(TGEaseType)ease;

    Swift

    func pointEased(_ point: CLLocationCoordinate2D, seconds: TimeInterval, easeType ease: TGEaseType)

    Parameters

    point

    the longitude and latitude where the marker will be placed

    seconds

    the animation duration given in seconds

    ease

    the ease function to be used between animation timestep

  • Sets the styling for a marker with a string of YAML defining a ‘draw rule’. See the more detailed scene documentation to get more styling informations.

    Note

    Setting the stylingString will overwrite any previously set stylingString or stylingPath.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull stylingString;

    Swift

    var stylingString: String { get set }
  • Sets the styling for a marker with a path, delimited by ‘.’ that specifies a ‘draw rule’ in the current scene. See the more detailed scene documentation to get more styling informations.

    Note

    Setting the stylingPath will overwrite any previously set stylingString or stylingPath.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull stylingPath;

    Swift

    var stylingPath: String { get set }
  • Sets a marker to be a single point geometry at a geographic coordinate.

    Note

    Markers can have their geometry set multiple time with possibly different geometry types.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CLLocationCoordinate2D point;

    Swift

    var point: CLLocationCoordinate2D { get set }
  • Sets a marker styled to be a polyline (described in a TGGeoPolyline).

    Note

    Markers can have their geometry set multiple time wwith possibly different geometry types.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) TGGeoPolyline *_Nonnull polyline;

    Swift

    var polyline: TGGeoPolyline { get set }
  • Sets a marker to be a polygon geometry (described in a TGGeoPolygon).

    Note

    Markers can have their geometry set multiple time with possibly different geometry types.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) TGGeoPolygon *_Nonnull polygon;

    Swift

    var polygon: TGGeoPolygon { get set }
  • Sets an icon loaded with a UIImage to a marker styled with a points style.

    TGMarker marker;
    marker.styling = "{ style: 'points', color: 'white', size: [25px, 25px], order:500 }"
    marker.point = CLLocationCoordinate2DMake(longitude, latitude)
    marker.icon = UIIMage(name: "marker-icon.png")
    

    Note

    An icon marker must be styled with a point style.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) UIImage *_Nonnull icon;

    Swift

    var icon: UIImage { get set }
  • Adjusts marker visibility

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL visible;

    Swift

    var visible: Bool { get set }
  • Set the ordering of point marker object relative to other markers; higher values are drawn ‘above’

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSInteger drawOrder;

    Swift

    var drawOrder: Int { get set }
  • A custom user data

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) void *_Nonnull userData;

    Swift

    var userData: UnsafeMutableRawPointer { get set }
  • Returns whether the usage of this marker resulted in internal errors

    Note

    The internal marker error will remain until you access it, make sure to check for errors on the marker after critical API calls or property access.

    Declaration

    Objective-C

    - (BOOL)getError:(NSError *_Nullable *_Nullable)result;

    Swift

    func getError() throws

    Parameters

    result

    a pointer to output error

    Return Value

    YES if an error has been set to the input paramater, NO otherwise