GLMapUserLocation

Objective-C


@interface GLMapUserLocation : NSObject <CLLocationManagerDelegate>

Swift

class GLMapUserLocation : NSObject, CLLocationManagerDelegate

Helper class that displays the user’s current location. To display the user’s location using GLMapUserLocation, create your own CLLocationManager and set GLMapUserLocation as the manager’s delegate. Alternatively, forward -locationManager:didUpdateLocations: calls from your existing location manager delegate to GLMapUserLocation.

  • Initializes with default images user_location.svg and user_movement.svg from the application resources.

    Declaration

    Objective-C

    - (instancetype _Nullable)initWithDrawOrder:(int32_t)drawOrder;

    Swift

    init?(drawOrder: Int32)

    Parameters

    drawOrder

    Draw order of images.

  • Initializes with custom images.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDrawOrder:(int32_t)drawOrder
                                locationImage:(nonnull PlatformImage *)locationImage
                                movementImage:
                                    (nonnull PlatformImage *)movementImage;

    Swift

    init(drawOrder: Int32, locationImage: NSImage, movementImage: NSImage)

    Parameters

    drawOrder

    Draw order of images.

    locationImage

    User location image (used when the user is stationary).

    movementImage

    User movement image (used when movement is detected).

  • Adds location images to the map.

    Declaration

    Objective-C

    - (void)addToMap:(nonnull GLMapView *)mapView;

    Swift

    func add(toMap mapView: GLMapView)

    Parameters

    mapView

    Map view where images should be added.

  • Removes location images from the map.

    Declaration

    Objective-C

    - (void)removeFromMap:(nonnull GLMapView *)mapView;

    Swift

    func remove(fromMap mapView: GLMapView)

    Parameters

    mapView

    Map view from which images should be removed.

  • The last location received by GLMapUserLocation.

    Declaration

    Objective-C

    @property (readonly) CLLocation *_Nullable lastLocation;

    Swift

    var lastLocation: CLLocation? { get }
  • Image used when no movement is detected.

    Declaration

    Objective-C

    @property (readonly) GLMapImage *_Nonnull locationImage;

    Swift

    var locationImage: GLMapImage { get }
  • Image used when movement is detected.

    Declaration

    Objective-C

    @property (readonly) GLMapImage *_Nonnull movementImage;

    Swift

    var movementImage: GLMapImage { get }
  • Accuracy circle layer.

    Declaration

    Objective-C

    @property (readonly) GLMapVectorLayer *_Nonnull accuracyCircle;

    Swift

    var accuracyCircle: GLMapVectorLayer { get }