GLMapViewState
Objective-C
@interface GLMapViewState : NSObject
Swift
class GLMapViewState : NSObject
GLMapViewState
holds the state of a mapView (like map position, locale settings, map style).
-
Unavailable
GLMapViewState is returned by
[GLMapView state]
Default -init is disabled.
Declaration
Objective-C
- (instancetype _Nonnull)init;
-
Updates draw attributes of vector object with the style of mapView.
Declaration
Objective-C
- (BOOL)updateDrawAttributesOfVectorObject:(nonnull GLMapVectorObject *)object;
Swift
func updateDrawAttributes(of object: GLMapVectorObject) -> Bool
Return Value
YES
if object is visible. -
Finds the nearest point of track, to a given point. Useful to find the nearest point of a track when the user taps.
Declaration
Objective-C
- (BOOL)findNearestPoint:(GLMapPoint *_Nonnull)point nearTrack:(GLMapTrackData *_Nonnull)trackData maxDistance:(CGFloat)distance;
Swift
func findNearestPoint(_ point: UnsafeMutablePointer<GLMapPoint>, nearTrack trackData: GLMapTrackData, maxDistance distance: CGFloat) -> Bool
Parameters
point
Point on map. If point was found, this value will be set to the nearest point.
distance
Max distance from the track allowed.
Return Value
YES
if point found, otherwiseNO
.
-
Returns an object near a certain point on the map.
Declaration
Objective-C
- (GLMapVectorObject *_Nullable)mapObjectNearPoint:(GLMapPoint)point maxDistance:(double)maxDistance;
Swift
func mapObjectNearPoint(_ point: GLMapPoint, maxDistance: Double) -> GLMapVectorObject?
Parameters
point
Point on the map.
maxDistance
Maximum distance in points.
Return Value
Vector object on the map.
-
Searches for relations near a point on the map.
Declaration
Objective-C
- (NSArray<GLMapRelation *> *_Nullable) relationsNearPoint:(GLMapPoint)point maxDistance:(double)maxDistance withFilters:(NSArray<GLSearchFilter *> *_Nullable)filters;
Swift
func relationsNearPoint(_ point: GLMapPoint, maxDistance: Double, with filters: [GLSearchFilter]?) -> [GLMapRelation]?
Parameters
point
Point on the map.
maxDistance
Maximum distance in points.
filters
Filters for relations.
Return Value
Relations near the point.