TGMapFeature


@interface TGMapFeature : NSObject

A map object defined by a geometry and a set of properties.

Map features can be assigned to a TGMapData to be rendered in the current scene.

Create a map feature with either a point, polyline, or polygon geometry using the factory methods. Access the geometry using the method for that geometry type - the other methods will return nil.

  • Creates a map feature with a point geometry.

    Declaration

    Objective-C

    + (nonnull instancetype)mapFeatureWithPoint:(CLLocationCoordinate2D)point
                                     properties:
                                         (nonnull TGFeatureProperties *)properties;

    Swift

    convenience init(point: CLLocationCoordinate2D, properties: [String : String])

    Parameters

    point

    The point defining the feature geometry.

    properties

    The feature properties.

    Return Value

    An initialized map feature object.

  • Creates a map feature with a polyline geometry.

    Declaration

    Objective-C

    + (nonnull instancetype)mapFeatureWithPolyline:(nonnull TGGeoPolyline *)polyline
                                        properties:(nonnull TGFeatureProperties *)
                                                       properties;

    Swift

    convenience init(polyline: TGGeoPolyline, properties: [String : String])

    Parameters

    polyline

    The polyline defining the feature geometry.

    properties

    The feature properties.

    Return Value

    An initialized map feature object.

  • Creates a map feature with a polygon geometry.

    Declaration

    Objective-C

    + (nonnull instancetype)mapFeatureWithPolygon:(nonnull TGGeoPolygon *)polygon
                                       properties:(nonnull TGFeatureProperties *)
                                                      properties;

    Swift

    convenience init(polygon: TGGeoPolygon, properties: [String : String])

    Parameters

    polygon

    The polygon defining the feature geometry.

    properties

    The feature properties.

    Return Value

    An initialized map feature object.

  • If this feature has a point geometry then this returns that point, otherwise returns nil.

    Declaration

    Objective-C

    - (nullable CLLocationCoordinate2D *)point;

    Swift

    func point() -> UnsafeMutablePointer<CLLocationCoordinate2D>?
  • If this feature has a polyline geometry then this returns that polyline, otherwise returns nil.

    Declaration

    Objective-C

    - (nullable TGGeoPolyline *)polyline;

    Swift

    func polyline() -> TGGeoPolyline?
  • If this feature has a polygon geometry then this returns that polygon, otherwise returns nil.

    Declaration

    Objective-C

    - (nullable TGGeoPolygon *)polygon;

    Swift

    func polygon() -> TGGeoPolygon?
  • A set of key-value pairs defining the properties of this map feature.

    These properties are used to determine if and how the feature will be rendered in the map scene, according the the Scene File.

    Declaration

    Objective-C

    @property (readonly, atomic) TGFeatureProperties *_Nonnull properties;

    Swift

    var properties: [String : String] { get }