GPKGMapShapePoints

Objective-C

@interface GPKGMapShapePoints : NSObject

Swift

class GPKGMapShapePoints : NSObject

Map Shape with map points and corresponding shape point objects

  • Map shape

    Declaration

    Objective-C

    @property (nonatomic, strong) GPKGMapShape *shape;

    Swift

    var shape: GPKGMapShape! { get set }
  • Mapping between point ids and shape points they belong to (or NSNull for non shapes)

    Declaration

    Objective-C

    @property (nonatomic, strong) NSMutableDictionary *shapePoints;

    Swift

    var shapePoints: NSMutableDictionary! { get set }
  • Initialize

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()

    Return Value

    new map shape points

  • Add the point to the shape

    Declaration

    Objective-C

    - (void)addPoint:(GPKGMapPoint *)point
           withShape:(NSObject<GPKGShapePoints> *)shapePoints;

    Swift

    func add(_ point: GPKGMapPoint!, withShape shapePoints: (any GPKGShapePoints)!)

    Parameters

    point

    map point

    shapePoints

    shape points

  • Add the point id to the shape

    Declaration

    Objective-C

    - (void)addPointId:(int)pointId
             withShape:(NSObject<GPKGShapePoints> *)shapePoints;

    Swift

    func addPointId(_ pointId: Int32, withShape shapePoints: (any GPKGShapePoints)!)

    Parameters

    pointId

    map point id

    shapePoints

    shape points

  • Add all map points in the shape

    Declaration

    Objective-C

    - (void)addShapePoints:(NSObject<GPKGShapePoints> *)shapePoints;

    Swift

    func addShapePoints(_ shapePoints: (any GPKGShapePoints)!)

    Parameters

    shapePoints

    shape points

  • Add a map point with no shape

    Declaration

    Objective-C

    - (void)addPoint:(GPKGMapPoint *)point;

    Swift

    func add(_ point: GPKGMapPoint!)

    Parameters

    point

    map point

  • Add an array of map points with no shape

    Declaration

    Objective-C

    - (void)addPoints:(NSArray *)points;

    Swift

    func add(_ points: [Any]!)

    Parameters

    points

    map points

  • Add an embedded map shape points

    Declaration

    Objective-C

    - (void)addMapShapePoints:(GPKGMapShapePoints *)mapShapePoints;

    Swift

    func add(_ mapShapePoints: GPKGMapShapePoints!)

    Parameters

    mapShapePoints

    map shape points

  • Check if contains the shape point

    Declaration

    Objective-C

    - (BOOL)containsPoint:(GPKGMapPoint *)point;

    Swift

    func contains(_ point: GPKGMapPoint!) -> Bool

    Parameters

    point

    map point

    Return Value

    true if contains point

  • Check if contains the shape point id

    Declaration

    Objective-C

    - (BOOL)containsPointId:(int)pointId;

    Swift

    func containsPointId(_ pointId: Int32) -> Bool

    Parameters

    pointId

    map point id

    Return Value

    true if contains point id

  • Get the shape points for a map point, only returns a value for shapes that can be edited

    Declaration

    Objective-C

    - (NSObject<GPKGShapePoints> *)shapePointsForPoint:(GPKGMapPoint *)point;

    Swift

    func shapePoints(for point: GPKGMapPoint!) -> (any GPKGShapePoints)!

    Parameters

    point

    map point

    Return Value

    shape points

  • Get the shape points for a map point id, only returns a value for shapes that can be edited

    Declaration

    Objective-C

    - (NSObject<GPKGShapePoints> *)shapePointsForPointId:(int)pointId;

    Swift

    func shapePoints(forPointId pointId: Int32) -> (any GPKGShapePoints)!

    Parameters

    pointId

    map point id

    Return Value

    shape points

  • Delete the map point and corresponding shape from the map view

    Declaration

    Objective-C

    - (BOOL)deletePoint:(GPKGMapPoint *)point fromMapView:(MKMapView *)mapView;

    Swift

    func delete(_ point: GPKGMapPoint!, from mapView: MKMapView!) -> Bool

    Parameters

    point

    map point

    mapView

    map view

    Return Value

    true if deleted

  • Removes all objects added to the map view

    Declaration

    Objective-C

    - (void)removeFromMapView:(MKMapView *)mapView;

    Swift

    func remove(from mapView: MKMapView!)

    Parameters

    mapView

    map view

  • Updates all objects on the map view that could have changed from moved points

    Declaration

    Objective-C

    - (void)updateWithMapView:(MKMapView *)mapView;

    Swift

    func update(with mapView: MKMapView!)

    Parameters

    mapView

    map view

  • Determines if the shape is in a valid state

    Declaration

    Objective-C

    - (BOOL)isValid;

    Swift

    func isValid() -> Bool

    Return Value

    true if valid

  • Polygon add a map point to the points where it is closest to the surrounding points

    Declaration

    Objective-C

    + (void)addPointAsPolygon:(GPKGMapPoint *)point
                     toPoints:(NSMutableArray *)points;

    Swift

    class func addPoint(asPolygon point: GPKGMapPoint!, toPoints points: NSMutableArray!)

    Parameters

    point

    map point

    points

    polygon points

  • Polyline add a map point to the points where it is closest to the surrounding points

    Declaration

    Objective-C

    + (void)addPointAsPolyline:(GPKGMapPoint *)point
                      toPoints:(NSMutableArray *)points;

    Swift

    class func addPoint(asPolyline point: GPKGMapPoint!, toPoints points: NSMutableArray!)

    Parameters

    point

    map point

    points

    polyline points

  • Updates hidden state of all objects

    Declaration

    Objective-C

    - (void)hidden:(BOOL)hidden fromMapView:(MKMapView *)mapView;

    Swift

    func hidden(_ hidden: Bool, from mapView: MKMapView!)

    Parameters

    hidden

    hidden flag

    mapView

    map view

  • Updates hidden state of the shape representing points

    Declaration

    Objective-C

    - (void)hiddenPoints:(BOOL)hidden;

    Swift

    func hiddenPoints(_ hidden: Bool)

    Parameters

    hidden

    hidden flag

  • Get the shape markers size

    Declaration

    Objective-C

    - (int)size;

    Swift

    func size() -> Int32

    Return Value

    size

  • Check if the shape markers is empty

    Declaration

    Objective-C

    - (int)isEmpty;

    Swift

    func isEmpty() -> Int32

    Return Value

    true if empty