GLMapVectorObject
Objective-C
@interface GLMapVectorObject : GLMapTagsContainer <NSCopying>
Swift
class GLMapVectorObject : GLMapTagsContainer, NSCopying
GLMapVectorObject is a bridge class to work with GLMap’s internal representation of a vector object.
-
Reference point of the object in internal map coordinates. For point objects, this is the point itself. For lines/polygons, this is a representative point used for labeling/search.
-
Resolved draw attributes after last update.
Declaration
Objective-C
@property (copy) GLMapVectorStyle *_Nullable drawAttributes;Swift
@NSCopying var drawAttributes: GLMapVectorStyle? { get set }
-
Creates an array of vector objects 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 -> GLMapVectorObjectArrayParameters
geoJSONDataGeoJSON data.
errorOutput: error if parsing fails.
Return Value
Array of vector objects, or
nilon error. -
Creates an array of vector objects from a GeoJSON string.
Declaration
Objective-C
+ (GLMapVectorObjectArray *_Nullable) createVectorObjectsFromGeoJSON:(nonnull NSString *)geoJSON error:(NSError *_Nullable *_Nullable)error;Swift
class func createVectorObjects(fromGeoJSON geoJSON: String) throws -> GLMapVectorObjectArrayParameters
geoJSONGeoJSON string.
errorOutput: error if parsing fails.
Return Value
Array of vector objects, or
nilon error. -
Creates an array of vector objects from a GeoJSON file.
Declaration
Objective-C
+ (GLMapVectorObjectArray *_Nullable) createVectorObjectsFromFile:(nonnull NSString *)filePath error:(NSError *_Nullable *_Nullable)error;Swift
class func createVectorObjects(fromFile filePath: String) throws -> GLMapVectorObjectArrayParameters
filePathPath to a GeoJSON file.
errorOutput: error if parsing fails.
Return Value
Array of vector objects, or
nilon error. -
Streamed parsing of a 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) throwsParameters
filePathPath to a GeoJSON file.
objectBlockBlock called for each parsed object.
errorOutput: error if parsing fails.
Return Value
YESif parsing succeeds, otherwiseNO.
-
Finds the nearest point on the object to the 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) -> BoolParameters
nearestPointOutput: nearest point on the object (internal map coordinates).
pointReference point (internal map coordinates).
distanceMaximum search distance in internal map units.
Return Value
YESif a point withindistanceis found, otherwiseNO. -
Compare with other object.
Declaration
Objective-C
- (NSComparisonResult)compare:(nonnull id)object;Swift
func compare(_ object: Any) -> ComparisonResult -
Useful for debugging.
Declaration
Objective-C
- (nonnull NSString *)debugDescription;Swift
func debugDescription() -> String -
GeoJSON representation of the vector object.
Declaration
Objective-C
- (nonnull NSString *)asGeoJSON;Swift
func asGeoJSON() -> String
-
Category of the object (filled by
GLSearch/GLSearchCategories).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
localeSettingsLocale 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
styleAddress information requested.
localeSettingsLocale 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 results.Declaration
Objective-C
- (NSInteger)searchScore;Swift
func searchScore() -> IntReturn Value
An internal score value (higher usually means more relevant).
-
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 keyed by tag hash.
Install in Dash