Loading...
Searching...
No Matches
NCUserLocationLayer Class Reference

Layer that automatically renders current user position (arrow and accuracy circle) on the map. Provides visibility and anchoring controls. Referenced from LocationView. More...

#include <com/navigine/idl/objc/NCUserLocationLayer.h>

Inherits NSObject.

Instance Methods

(void) - setVisible:
 Shows or hides user location layer.
 
(BOOL) - isVisible
 Returns true if user location layer is visible.
 
(void) - setAnchor:
 Sets anchor point for user indicator in screen pixels.
 
(void) - resetAnchor
 Resets anchor to default (center).
 
(BOOL) - anchorEnabled
 Returns true if custom anchor is enabled.
 

Detailed Description

Layer that automatically renders current user position (arrow and accuracy circle) on the map. Provides visibility and anchoring controls. Referenced from LocationView.

Definition at line 18 of file NCUserLocationLayer.h.

Method Documentation

◆ anchorEnabled

- (BOOL) anchorEnabled

Returns true if custom anchor is enabled.

Swift code snippet:

let anchorEnabled = userLocationLayer.anchorEnabled()
print("Anchor enabled: \‍(anchorEnabled)")

Objective C code snippet:

BOOL anchorEnabled = [_userLocationLayer anchorEnabled];
NSLog(@"Anchor enabled: %@", anchorEnabled ? @"YES" : @"NO");

◆ isVisible

- (BOOL) isVisible

Returns true if user location layer is visible.

Swift code snippet:

let visible = userLocationLayer.isVisible()
print("User location layer is visible: \‍(visible)")

Objective C code snippet:

BOOL visible = [_userLocationLayer isVisible];
NSLog(@"User location layer is visible: %@", visible ? @"YES" : @"NO");

◆ resetAnchor

- (void) resetAnchor

Resets anchor to default (center).

Swift code snippet:

userLocationLayer.resetAnchor()
print("Anchor reset to default")

Objective C code snippet:

NSLog(@"Anchor reset to default");

◆ setAnchor:

- (void) setAnchor: (CGPoint) anchor

Sets anchor point for user indicator in screen pixels.

Swift code snippet:

let anchor = ScreenPoint(x: 100.0, y: 200.0)
userLocationLayer.setAnchor(anchor)
print("Set user location anchor to: (\‍(anchor.x), \‍(anchor.y))")

Objective C code snippet:

NCScreenPoint *anchor = [[NCScreenPoint alloc] initWithX:100.0f y:200.0f];
NSLog(@"Set user location anchor to: (%.1f, %.1f)", anchor.x, anchor.y);

◆ setVisible:

- (void) setVisible: (BOOL) visible

Shows or hides user location layer.

Swift code snippet:

userLocationLayer.setVisible(true)
print("User location layer set visible")

Objective C code snippet:

NSLog(@"User location layer set visible");

The documentation for this class was generated from the following file: