GLMapVectorObject


@interface GLMapVectorObject : GLMapTagsContainer <NSCopying>

GLMapVectorObject is a bridge class, to work with GLMap internal representation of vector object.

Properties

Static Methods

  • Creates array of vector object from GeoJSON data

    Declaration

    Objective-C

    + (GLMapVectorObjectArray *_Nullable)
        createVectorObjectsFromGeoJSONData:(nonnull NSData *)geoJSONData
                                     error:(NSError *_Nullable *_Nullable)error;

    Parameters

    geoJSONData

    Data with GeoJSON inside

    Return Value

    Array of new vector objects

  • Creates array of vector object from GeoJSON string

    Declaration

    Objective-C

    + (GLMapVectorObjectArray *_Nullable)
        createVectorObjectsFromGeoJSON:(nonnull NSString *)geoJSON
                                 error:(NSError *_Nullable *_Nullable)error;

    Parameters

    geoJSON

    String with GeoJSON inside

    Return Value

    Array of new vector objects

  • Creates array of vector object from GeoJSON file

    Declaration

    Objective-C

    + (GLMapVectorObjectArray *_Nullable)
        createVectorObjectsFromFile:(nonnull NSString *)filePath
                              error:(NSError *_Nullable *_Nullable)error;

    Parameters

    filePath

    Path to GeoJSON file

    Return Value

    Array of new vector objects

  • Streamed parsing of GeoJSON file

    Declaration

    Objective-C

    + (BOOL)enumVectorObjectsFromFile:(nonnull NSString *)filePath
                          objectBlock:(nonnull GLMapVectorObjectBlock)objectBlock
                                error:(NSError *_Nullable *_Nullable)error;

    Parameters

    objectBlock

    block that is called when next object is ready

    Return Value

    NO if error happened

Methods

  • Creates vector object with point.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPoint:(GLMapPoint)point;

    Parameters

    point

    Point on the map.

  • Creates vector object with line

    Declaration

    Objective-C

    - (nonnull instancetype)initWithLine:(nonnull GLMapPointArray *)line;

    Parameters

    line

    line

  • Creates vector object with multiline

    Declaration

    Objective-C

    - (nonnull instancetype)initWithMultiline:
        (nonnull NSArray<GLMapPointArray *> *)multiline;

    Parameters

    multiline

    Multiline

  • Creates vector object with polygon

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithPolygonOuterRings:(nonnull NSArray<GLMapPointArray *> *)outerRings
                       innerRings:(NSArray<GLMapPointArray *> *_Nullable)innerRings;

    Parameters

    outerRings

    exterior of polygon

    innerRings

    holes of polygon

  • Creates vector object with big circle line from start to end. Useful to display plane routes.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithGeoLineStart:(GLMapPoint)start
                                             end:(GLMapPoint)end
                                         quality:(double)quality;

    Parameters

    start

    Start point

    end

    End point

    quality

    Maximum distance from point to line, used for simplification in Douglas Peucker algorithm. Units is map internal coordinates.

  • Finds nearest point of object to given point.

    Declaration

    Objective-C

    - (BOOL)findNearestPoint:(nonnull GLMapPoint *)nearestPoint
                     toPoint:(GLMapPoint)point
                 maxDistance:(CGFloat)distance;
  • Compare with other object. *

    Declaration

    Objective-C

    - (NSComparisonResult)compare:(nonnull id)object;
  • Usefull for debuging.

    Declaration

    Objective-C

    - (nonnull NSString *)debugDescription;
  • GeoJSON representaion on vector object

    Declaration

    Objective-C

    - (nonnull NSString *)asGeoJSON;

GLSearch

  • Category of the object.

    Declaration

    Objective-C

    @property (readonly) GLSearchCategory *_Nullable searchCategory;
  • Returns all address names associated with object

    Declaration

    Objective-C

    - (NSArray<GLMapValue *> *_Nullable)localizedAddressNames:
        (GLMapLocaleSettings *_Nonnull)localeSettings;

    Parameters

    localeSettings

    Locale settings used to find name

    Return Value

    array of address names

  • Returns address for vector object

    Declaration

    Objective-C

    - (GLMapValue *_Nullable)addressWithStyle:(GLSearchAddressStyle)style
                               localeSettings:
                                   (GLMapLocaleSettings *_Nonnull)localeSettings;

    Parameters

    style

    Address information requested

    localeSettings

    Locale settings to use

    Return Value

    Returns value with address data.

  • Search score of vector object obtained from GLSearch. Could be used to sort search results.

    Declaration

    Objective-C

    - (NSInteger)searchScore;

    Return Value

    Some internal score value

  • Compares tags in vector objects and tag filters from category and returns dictonairy of matched tags.

    Declaration

    Objective-C

    - (NSDictionary<NSNumber *, GLMapValue *> *_Nullable)matchedCategoryTags;

    Return Value

    Dictonairy of matched tags