GLMapVectorObject
Objective-C
@interface GLMapVectorObject : GLMapTagsContainer <NSCopying>
Swift
class GLMapVectorObject : GLMapTagsContainer, NSCopying
GLMapVectorObject
is a bridge class, to work with GLMap internal representation of vector object.
-
Point that belongs to vector object.
-
Resolved draw attributes after last update.
Declaration
Objective-C
@property (copy) GLMapVectorStyle *_Nullable drawAttributes;
Swift
@NSCopying var drawAttributes: GLMapVectorStyle? { get set }
-
Creates array of vector object from GeoJSON data
Declaration
Objective-C
+ (GLMapVectorObjectArray *_Nullable) createVectorObjectsFromGeoJSONData:(nonnull NSData *)geoJSONData error:(NSError *_Nullable *_Nullable)error;
Swift
class func createVectorObjects(fromGeoJSONData geoJSONData: Data) throws -> GLMapVectorObjectArray
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;
Swift
class func createVectorObjects(fromGeoJSON geoJSON: String) throws -> GLMapVectorObjectArray
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;
Swift
class func createVectorObjects(fromFile filePath: String) throws -> GLMapVectorObjectArray
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;
Swift
class func enumVectorObjects(fromFile filePath: String, objectBlock: @escaping GLMapVectorObjectBlock) throws
Parameters
objectBlock
block that is called when next object is ready
Return Value
NO if error happened
-
Finds nearest point of object to given point.
Declaration
Objective-C
- (BOOL)findNearestPoint:(nonnull GLMapPoint *)nearestPoint toPoint:(GLMapPoint)point maxDistance:(CGFloat)distance;
Swift
func findNearestPoint(_ nearestPoint: UnsafeMutablePointer<GLMapPoint>, to point: GLMapPoint, maxDistance distance: CGFloat) -> Bool
-
Compare with other object.
Declaration
Objective-C
- (NSComparisonResult)compare:(nonnull id)object;
Swift
func compare(_ object: Any) -> ComparisonResult
-
Usefull for debuging.
Declaration
Objective-C
- (nonnull NSString *)debugDescription;
Swift
func debugDescription() -> String
-
GeoJSON representaion on vector object
Declaration
Objective-C
- (nonnull NSString *)asGeoJSON;
Swift
func asGeoJSON() -> String
-
Category of the object.
Declaration
Objective-C
@property (copy) GLSearchCategory *_Nullable searchCategory;
Swift
@NSCopying var searchCategory: GLSearchCategory? { get set }
-
Returns all address names associated with the object.
Declaration
Objective-C
- (NSArray<GLMapValue *> *_Nullable)localizedAddressNames: (GLMapLocaleSettings *_Nonnull)localeSettings;
Swift
func localizedAddressNames(_ localeSettings: GLMapLocaleSettings) -> [GLMapValue]?
Parameters
localeSettings
Locale settings used to find the name.
Return Value
Array of address names.
-
Returns the address for the vector object.
Declaration
Objective-C
- (GLMapValue *_Nullable)addressWithStyle:(GLSearchAddressStyle)style localeSettings: (GLMapLocaleSettings *_Nonnull)localeSettings;
Swift
func address(with style: GLSearchAddressStyle, localeSettings: GLMapLocaleSettings) -> GLMapValue?
Parameters
style
Address information requested.
localeSettings
Locale settings to use.
Return Value
Returns a value with address data.
-
Search score of the vector object obtained from GLSearch. Can be used to sort search results.
Declaration
Objective-C
- (NSInteger)searchScore;
Swift
func searchScore() -> Int
Return Value
Some internal score value.
-
Compares tags in vector objects and tag filters from the category and returns a dictionary of matched tags.
Declaration
Objective-C
- (NSDictionary<NSNumber *, GLMapValue *> *_Nullable)matchedCategoryTags;
Swift
func matchedCategoryTags() -> [NSNumber : GLMapValue]?
Return Value
Dictionary of matched tags.