GLMapViewState

Objective-C


@interface GLMapViewState : NSObject

Swift

class GLMapViewState : NSObject

GLMapViewState holds the state of a mapView (like map position, locale settings, map style, depth buffer).

  • Unavailable

    GLMapViewState is returned by [GLMapView state]

    Default -init is disabled.

    Declaration

    Objective-C

    - (instancetype _Nonnull)init;

Methods

  • 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

    Maximum distance from the track in screen points.

    Return Value

    YES if point found, otherwise NO.

  • Converts a point on the screen to projected map coordinates. Terrain elevation is taken into account

    Declaration

    Objective-C

    - (GLMapPoint)makeMapPointFromDisplayPoint:(CGPoint)displayPoint;

    Swift

    func makeMapPoint(fromDisplay displayPoint: CGPoint) -> GLMapPoint

    Parameters

    displayPoint

    The point you want to convert.

    Return Value

    The internal map coordinate of the specified point.

  • Converts projected map coordinates to screen coordinates. Terrain elevation is taken into account

    Declaration

    Objective-C

    - (CGPoint)makeDisplayPointFromMapPoint:(GLMapPoint)mapPoint
                                  elevation:(float)elevation;

    Swift

    func makeDisplayPoint(from mapPoint: GLMapPoint, elevation: Float) -> CGPoint

    Parameters

    mapPoint

    The point you want to convert.

    elevation

    Elevation at point

    Return Value

    The screen coordinate of the specified map point.

GLSearch

  • Returns the vector object associated with the nearest visible POI label.

    Declaration

    Objective-C

    - (GLMapVectorObject *_Nullable)mapObjectAt:(CGPoint)screenPoint
                                    maxDistance:(double)maxDistance;

    Swift

    func mapObject(at screenPoint: CGPoint, maxDistance: Double) -> GLMapVectorObject?

    Parameters

    screenPoint

    Point in internal map coordinates.

    maxDistance

    Maximum hit distance in screen points.

    Return Value

    Vector object loaded from the offline map, or nil if nothing is found.

  • 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 in internal map coordinates.

    maxDistance

    Maximum search distance in screen points.

    filters

    Filters for relations.

    Return Value

    Relations near the point.