Loading...
Searching...
No Matches

Interface for interacting with the location view. More...

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

Inherits NSObject.

Instance Methods

(void) - setSublocationId:
 Method is used to switch the location view between sublocations (e.g., floors).
 
(nullable NSNumber *) - getSublocationId
 Returns current sublocation ID if set, otherwise null.
 
(nonnull NCCamera *) - getEnclosingCamera:
 Calculates camera that fits provided bounding box.
 
(nonnull NCPoint *) - screenPositionToMeters:
 Converts screen coordinates (pixels) to metrics coordinates (meters).
 
(CGPoint) - metersToScreenPosition:clipToViewport:
 Converts metrics coordinates (meters) to screen coordinates (pixels).
 
(nullable NCCircleMapObject *) - addCircleMapObject
 Creates and adds a circle map object to the location view.
 
(BOOL) - removeCircleMapObject:
 Removes a circle map object from the location view.
 
(nullable NCIconMapObject *) - addIconMapObject
 Creates and adds an icon map object to the location view.
 
(BOOL) - removeIconMapObject:
 Removes an icon map object from the location view.
 
(nullable NCPolygonMapObject *) - addPolygonMapObject
 Creates and adds a polygon map object to the location view.
 
(BOOL) - removePolygonMapObject:
 Removes a polygon map object from the location view.
 
(nullable NCPolylineMapObject *) - addPolylineMapObject
 Creates and adds a polyline map object to the location view.
 
(BOOL) - removePolylineMapObject:
 Removes a polyline map object from the location view.
 
(nullable NCDottedPolylineMapObject *) - addDottedPolylineMapObject
 Creates and adds a polyline points map object to the location view.
 
(BOOL) - removeDottedPolylineMapObject:
 Removes a polyline points map object from the location view.
 
(void) - removeAllMapObjects
 Removes all map objects from the location view.
 
(void) - pickMapObjectAt:
 Selects a visible, interactive map object at the specified screen position.
 
(void) - pickMapFeatureAt:
 Selects visible map features (e.g., venues) at the specified screen position.
 
(void) - addPickListener:
 Adds a PickListener to receive picking result events.
 
(void) - removePickListener:
 Removes a previously added PickListener.
 
(void) - addInputListener:
 Adds an InputListener to receive input events.
 
(void) - removeInputListener:
 Removes a previously added InputListener.
 
(void) - addCameraListener:
 Adds a CameraListener to receive camera movement events.
 
(void) - removeCameraListener:
 Removes a previously added CameraListener.
 
(void) - addSublocationChangeListener:
 Adds listener for sublocation change events.
 
(void) - removeSublocationChangeListener:
 Removes previously added sublocation change listener.
 
(void) - flyTo:duration:callback:
 Moves the map camera to a new position with an easing animation.
 
(void) - moveTo:duration:animationType:callback:
 Moves the map camera to a new position with a smooth pan-and-zoom animation.
 
(BOOL) - selectMapFeature:
 Selects a map feature by its feature ID.
 
(BOOL) - deselectMapFeature:
 Deselects a map feature by its feature ID.
 
(void) - deselectAllMapFeatures
 Deselects all currently selected map features.
 
(void) - applyFilter:layer:
 Applies a filter to a specific map layer.
 

Class Methods

(void) + setDebugFlag:on:
 Sets the state of a debug flag.
 
(BOOL) + getDebugFlag:
 Gets the state of a debug flag.
 

Properties

float zoomFactor
 Specifies the zoom level of the location view, in pixels per meter. Default: approximately 100 meters across the screen width.
 
float minZoomFactor
 Minimum zoom level for the location view (pixels per meter).
 
float maxZoomFactor
 Maximum zoom level for the location view (pixels per meter).
 
BOOL stickToBorder
 Specifies whether sublocation content sticks to screen borders. If true, content sticks to screen bounds; if false, content is centered. Default: true.
 
NCCameracamera
 Current camera position in meters. Camera.
 
BOOL rotateGestureEnabled
 Specifies whether rotation gestures (e.g., two-finger rotation) are enabled.
 
BOOL tiltGesturesEnabled
 Specifies whether tilt gestures (e.g., two-finger parallel pan) are enabled.
 
BOOL scrollGesturesEnabled
 Specifies whether scroll gestures (e.g., pan gesture) are enabled.
 
BOOL zoomGesturesEnabled
 Specifies whether zoom gestures (e.g., two-finger pinch) are enabled.
 
float pickRadius
 Radius for picking features on the map, in density-independent pixels. Default: 0.5 dp.
 
NSArray< NSString * > * selectedMapFeatures
 List of currently selected map feature IDs.
 

Detailed Description

Interface for interacting with the location view.

Referenced from LocationView.

Definition at line 35 of file NCLocationWindow.h.

Method Documentation

◆ addCameraListener:

- (void) addCameraListener: (nullable id< NCCameraListener >) listener

Adds a CameraListener to receive camera movement events.

Parameters
listenerThe CameraListener instance CameraListener.
Note
Remove the listener when no longer needed.

Swift code snippet:

// Add camera listener
cameraListener = CameraListenerImpl()
locationWindow.addCameraListener(cameraListener!)
print("Added camera listener")

Objective C code snippet:

// Add camera listener
_cameraListener = [[CameraListenerImpl alloc] init];
[_locationWindow addCameraListener:_cameraListener];
NSLog(@"Added camera listener");

◆ addCircleMapObject

- (nullable NCCircleMapObject *) addCircleMapObject

Creates and adds a circle map object to the location view.

Returns
A CircleMapObject instance CircleMapObject if successful, null otherwise.

Swift code snippet:

// Add circle map object
circleMapObject = locationWindow.addCircleMapObject()
print("Added circle map object")

Objective C code snippet:

// Add circle map object
[_locationWindow addCircleMapObject:circleObject];
[_mapObjects addObject:circleObject];
NSLog(@"Added circle map object");

◆ addDottedPolylineMapObject

- (nullable NCDottedPolylineMapObject *) addDottedPolylineMapObject

Creates and adds a polyline points map object to the location view.

Returns
A DottedPolylineMapObject instance DottedPolylineMapObject if successful, null otherwise.

Swift code snippet:

// Add dotted polyline map object
dottedPolylineMapObject = locationWindow.addDottedPolylineMapObject()
print("Added dotted polyline map object")

Objective C code snippet:

// Add dotted polyline map object
[_locationWindow addDottedPolylineMapObject:dottedPolylineObject];
[_mapObjects addObject:dottedPolylineObject];
NSLog(@"Added dotted polyline map object");

◆ addIconMapObject

- (nullable NCIconMapObject *) addIconMapObject

Creates and adds an icon map object to the location view.

Returns
An IconMapObject instance IconMapObject if successful, null otherwise.

Swift code snippet:

// Add icon map object
iconMapObject = locationWindow.addIconMapObject()
print("Added icon map object")

Objective C code snippet:

// Add icon map object
[_locationWindow addIconMapObject:iconObject];
[_mapObjects addObject:iconObject];
NSLog(@"Added icon map object");

◆ addInputListener:

- (void) addInputListener: (nullable id< NCInputListener >) listener

Adds an InputListener to receive input events.

Parameters
listenerThe InputListener instance InputListener.
Note
Remove the listener when no longer needed.

Swift code snippet:

// Add input listener
inputListener = InputListenerImpl()
locationWindow.addInputListener(inputListener!)
print("Added input listener")

Objective C code snippet:

// Add input listener
_inputListener = [[InputListenerImpl alloc] init];
[_locationWindow addInputListener:_inputListener];
NSLog(@"Added input listener");

◆ addPickListener:

- (void) addPickListener: (nullable id< NCPickListener >) listener

Adds a PickListener to receive picking result events.

Parameters
listenerThe PickListener instance PickListener.
Note
Remove the listener when no longer needed.

Swift code snippet:

// Add pick listener
pickListener = PickListenerImpl()
locationWindow.addPickListener(pickListener!)
print("Added pick listener")

Objective C code snippet:

// Add pick listener
_pickListener = [[PickListenerImpl alloc] init];
[_locationWindow addPickListener:_pickListener];
NSLog(@"Added pick listener");

◆ addPolygonMapObject

- (nullable NCPolygonMapObject *) addPolygonMapObject

Creates and adds a polygon map object to the location view.

Returns
A PolygonMapObject instance PolygonMapObject if successful, null otherwise.

Swift code snippet:

// Add polygon map object
polygonMapObject = locationWindow.addPolygonMapObject()
print("Added polygon map object")

Objective C code snippet:

// Add polygon map object
NCPolygonMapObject *polygonObject = [_locationWindow addPolygonMapObject];
NSLog(@"Added polygon map object");

◆ addPolylineMapObject

- (nullable NCPolylineMapObject *) addPolylineMapObject

Creates and adds a polyline map object to the location view.

Returns
A PolylineMapObject instance PolylineMapObject if successful, null otherwise.

Swift code snippet:

// Add polyline map object
polylineMapObject = locationWindow.addPolylineMapObject()
print("Added polyline map object")

Objective C code snippet:

// Add polyline map object
[_locationWindow addPolylineMapObject:polylineObject];
[_mapObjects addObject:polylineObject];
NSLog(@"Added polyline map object");

◆ addSublocationChangeListener:

- (void) addSublocationChangeListener: (nullable id< NCSublocationChangeListener >) listener

Adds listener for sublocation change events.

Parameters
listenerSublocation change listener SublocationChangeListener.

Swift code snippet:

locationWindow.addSublocationChangeListener(listener)
print("Added sublocation change listener")

Objective C code snippet:

[_locationWindow addSublocationChangeListener:listener];
NSLog(@"Added sublocation change listener");

◆ applyFilter:layer:

- (void) applyFilter: (nonnull NSString *) filter
layer: (nonnull NSString *) layer 

Applies a filter to a specific map layer.

Parameters
filterThe filter stringю
layerThe map layer to apply the filter to.

◆ deselectAllMapFeatures

- (void) deselectAllMapFeatures

Deselects all currently selected map features.

Swift code snippet:

// Deselect all map features
locationWindow.deselectAllMapFeatures()
print("Deselected all map features")

Objective C code snippet:

// Deselect all map features
[_locationWindow deselectAllMapFeatures];
NSLog(@"Deselected all map features");

◆ deselectMapFeature:

- (BOOL) deselectMapFeature: (nonnull NSString *) featureId

Deselects a map feature by its feature ID.

Parameters
featureIdThe feature ID from the mapFeaturePickResult PickListener.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Deselect specific map feature
let deselected = locationWindow.deselectMapFeature(featureId)
print("Deselected map feature \‍(featureId): \‍(deselected)")

Objective C code snippet:

// Deselect specific map feature
BOOL deselected = [_locationWindow deselectMapFeature:featureId];
NSLog(@"Deselected map feature %@: %@", featureId, deselected ? @"YES" : @"NO");

◆ flyTo:duration:callback:

- (void) flyTo: (nonnull NCCamera *) camera
duration: (int32_t) duration
callback: (nullable NCCameraCallback) callback 

Moves the map camera to a new position with an easing animation.

Parameters
cameraThe new camera position Camera.
durationAnimation duration in milliseconds.
callbackCallback to execute when the animation completes CameraCallback.

Swift code snippet:

// Fly to position with smooth animation
let targetPoint = NCPoint(x: 150.0, y: 250.0)
let targetCamera = NCCamera(point: targetPoint, zoom: 75.0, rotation: 45.0)
let callback = CameraCallbackImpl()
locationWindow.flyTo(camera: targetCamera, duration: 2000, callback: callback)
print("Started fly to animation to point (\‍(targetPoint.x), \‍(targetPoint.y))")

Objective C code snippet:

// Fly to position with smooth animation
NCPoint *targetPoint = [[NCPoint alloc] initWithX:150.0 y:250.0];
NCCamera *targetCamera = [[NCCamera alloc] initWithPoint:targetPoint zoom:75.0 rotation:45.0];
CameraCallbackImpl *callback = [[CameraCallbackImpl alloc] init];
[_locationWindow flyToWithCamera:targetCamera duration:2000 callback:callback];
NSLog(@"Started fly to animation to point (%.2f, %.2f)", targetPoint.x, targetPoint.y);

◆ getDebugFlag:

+ (BOOL) getDebugFlag: (NCDebugFlag) flag

Gets the state of a debug flag.

Parameters
flagThe debug flag to query DebugFlag.
Returns
true if the debug flag is enabled, false otherwise.

◆ getEnclosingCamera:

- (nonnull NCCamera *) getEnclosingCamera: (nonnull NCBoundingBox *) boundingBox

Calculates camera that fits provided bounding box.

Parameters
boundingBoxMetrics bounding box to enclose.

Swift code snippet:

let boundingBox = BoundingBox(bottomLeft: Point(x: 0.0, y: 0.0),
topRight: Point(x: 20.0, y: 30.0))
let camera = locationWindow.getEnclosingCamera(boundingBox)
print("Camera that fits bounding box: \‍(camera)")

Objective C code snippet:

NCBoundingBox *boundingBox = [[NCBoundingBox alloc] initWithBottomLeft:[[NCPoint alloc] initWithX:0.0 y:0.0]
topRight:[[NCPoint alloc] initWithX:20.0 y:30.0]];
NCCamera *camera = [_locationWindow getEnclosingCamera:boundingBox];
NSLog(@"Camera that fits bounding box: %@", camera);

◆ getSublocationId

- (nullable NSNumber *) getSublocationId

Returns current sublocation ID if set, otherwise null.

Swift code snippet:

if let currentId = locationWindow.getSublocationId() {
print("Current sublocation id: \‍(currentId)")
} else {
print("Current sublocation id is not set")
}

Objective C code snippet:

NSNumber *currentId = [_locationWindow getSublocationId];
if (currentId != nil) {
NSLog(@"Current sublocation id: %@", currentId);
} else {
NSLog(@"Current sublocation id is not set");
}

◆ metersToScreenPosition:clipToViewport:

- (CGPoint) metersToScreenPosition: (nonnull NCPoint *) point
clipToViewport: (BOOL) clipToViewport 

Converts metrics coordinates (meters) to screen coordinates (pixels).

Parameters
point(x,y) coordinates in meters Point.
clipToViewportIf true, coordinates outside the viewport are clipped to the viewport edge.
Returns
(x,y) coordinates in screen pixels.

Swift code snippet:

// Convert meters to screen position with clipping
let metersPoint3 = Point(x: 50.0, y: 75.0)
let screenPoint3 = locationWindow.metersToScreenPosition(metersPoint3, clipToViewport: true)
print("Meters position (\‍(metersPoint3.x), \‍(metersPoint3.y)) converted to screen with clipping: (\‍(screenPoint3.x), \‍(screenPoint3.y))")

Objective C code snippet:

// Convert meters to screen position with clipping
NCPoint *metersPoint3 = [[NCPoint alloc] initWithX:50.0 y:75.0];
NCPoint *screenPoint3 = [_locationWindow metersToScreenPosition:metersPoint3 clipToViewport:YES];
NSLog(@"Meters position (%.1f, %.1f) converted to screen with clipping: (%.1f, %.1f)",
metersPoint3.x, metersPoint3.y, screenPoint3.x, screenPoint3.y);

◆ moveTo:duration:animationType:callback:

- (void) moveTo: (nonnull NCCamera *) camera
duration: (int32_t) duration
animationType: (NCAnimationType) animationType
callback: (nullable NCCameraCallback) callback 

Moves the map camera to a new position with a smooth pan-and-zoom animation.

Parameters
cameraThe new camera position Camera.
durationAnimation duration in milliseconds (-1 for default duration).
animationTypeThe type of easing animation AnimationType.
callbackCallback to execute when the animation completes CameraCallback.

Swift code snippet:

// Move to position with linear animation
let targetPoint = NCPoint(x: 200.0, y: 300.0)
let targetCamera = NCCamera(point: targetPoint, zoom: 100.0, rotation: 90.0)
let callback = CameraCallbackImpl()
locationWindow.moveTo(camera: targetCamera, duration: 1500, animationType: .linear, callback: callback)
print("Started move to with linear animation")

Objective C code snippet:

// Move to position with linear animation
NCPoint *targetPoint = [[NCPoint alloc] initWithX:200.0 y:300.0];
NCCamera *targetCamera = [[NCCamera alloc] initWithPoint:targetPoint zoom:100.0 rotation:90.0];
CameraCallbackImpl *callback = [[CameraCallbackImpl alloc] init];
[_locationWindow moveToWithCamera:targetCamera duration:1500 animationType:NCAnimationTypeLinear callback:callback];
NSLog(@"Started move to with linear animation");

◆ pickMapFeatureAt:

- (void) pickMapFeatureAt: (CGPoint) point

Selects visible map features (e.g., venues) at the specified screen position.

Parameters
pointPosition in screen pixels to pick from. Results are delivered to the PickListener via onMapFeaturePickComplete PickListener.

Swift code snippet:

// Pick map feature at screen position
let featurePoint = NCPoint(x: 150.0, y: 250.0)
locationWindow.pickMapFeature(at: featurePoint)
print("Picked map feature at screen position (\‍(featurePoint.x), \‍(featurePoint.y))")

Objective C code snippet:

// Pick map feature at screen position
NCPoint *featurePoint = [[NCPoint alloc] initWithX:150.0 y:250.0];
[_locationWindow pickMapFeatureAt:featurePoint];
NSLog(@"Picked map feature at screen position (%.1f, %.1f)", featurePoint.x, featurePoint.y);

◆ pickMapObjectAt:

- (void) pickMapObjectAt: (CGPoint) point

Selects a visible, interactive map object at the specified screen position.

Parameters
pointPosition in screen pixels to pick from. Results are delivered to the PickListener via onMapObjectPickComplete PickListener.

Swift code snippet:

// Pick map object at screen position
let screenPoint = NCPoint(x: 100.0, y: 200.0)
locationWindow.pickMapObject(at: screenPoint)
print("Picked map object at screen position (\‍(screenPoint.x), \‍(screenPoint.y))")

Objective C code snippet:

// Pick map object at screen position
NCPoint *screenPoint = [[NCPoint alloc] initWithX:100.0 y:200.0];
[_locationWindow pickMapObjectAt:screenPoint];
NSLog(@"Picked map object at screen position (%.1f, %.1f)", screenPoint.x, screenPoint.y);

◆ removeAllMapObjects

- (void) removeAllMapObjects

Removes all map objects from the location view.

Swift code snippet:

// Remove all map objects
locationWindow.removeAllMapObjects()
print("Removed all map objects")

Objective C code snippet:

// Remove all map objects
[_locationWindow removeAllMapObjects];
[_mapObjects removeAllObjects];
NSLog(@"Removed all map objects");

◆ removeCameraListener:

- (void) removeCameraListener: (nullable id< NCCameraListener >) listener

Removes a previously added CameraListener.

Parameters
listenerThe CameraListener instance to remove CameraListener.

Swift code snippet:

// Remove camera listener
locationWindow.removeCameraListener(cameraListener!)
cameraListener = nil
print("Removed camera listener")

Objective C code snippet:

// Remove camera listener
[_locationWindow removeCameraListener:_cameraListener];
_cameraListener = nil;
NSLog(@"Removed camera listener");

◆ removeCircleMapObject:

- (BOOL) removeCircleMapObject: (nullable NCCircleMapObject *) circleMapObject

Removes a circle map object from the location view.

Parameters
circleMapObjectThe circle map object instance CircleMapObject.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Remove circle map object
if let circleMapObject = circleMapObject {
let removed = locationWindow.removeCircleMapObject(circleMapObject)
print("Removed circle map object: \‍(removed)")
self.circleMapObject = nil
}

Objective C code snippet:

// Remove circle map object
[_locationWindow removeCircleMapObject:circleObject];
[_mapObjects removeObject:circleObject];
NSLog(@"Removed circle map object");

◆ removeDottedPolylineMapObject:

- (BOOL) removeDottedPolylineMapObject: (nullable NCDottedPolylineMapObject *) dottedPolylineMapObject

Removes a polyline points map object from the location view.

Parameters
dottedPolylineMapObjectThe polyline points map object instance DottedPolylineMapObject.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Remove dotted polyline map object
if let dottedPolylineMapObject = dottedPolylineMapObject {
let removed = locationWindow.removeDottedPolylineMapObject(dottedPolylineMapObject)
print("Removed dotted polyline map object: \‍(removed)")
self.dottedPolylineMapObject = nil
}

Objective C code snippet:

// Remove dotted polyline map object
[_locationWindow removeDottedPolylineMapObject:dottedPolylineObject];
[_mapObjects removeObject:dottedPolylineObject];
NSLog(@"Removed dotted polyline map object");

◆ removeIconMapObject:

- (BOOL) removeIconMapObject: (nullable NCIconMapObject *) iconMapObject

Removes an icon map object from the location view.

Parameters
iconMapObjectThe icon map object instance IconMapObject.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Remove icon map object
if let iconMapObject = iconMapObject {
let removed = locationWindow.removeIconMapObject(iconMapObject)
print("Removed icon map object: \‍(removed)")
self.iconMapObject = nil
}

Objective C code snippet:

// Remove icon map object
[_locationWindow removeIconMapObject:iconObject];
[_mapObjects removeObject:iconObject];
NSLog(@"Removed icon map object");

◆ removeInputListener:

- (void) removeInputListener: (nullable id< NCInputListener >) listener

Removes a previously added InputListener.

Parameters
listenerThe InputListener instance to remove InputListener.

Swift code snippet:

// Remove input listener
locationWindow.removeInputListener(inputListener!)
inputListener = nil
print("Removed input listener")

Objective C code snippet:

// Remove input listener
[_locationWindow removeInputListener:_inputListener];
_inputListener = nil;
NSLog(@"Removed input listener");

◆ removePickListener:

- (void) removePickListener: (nullable id< NCPickListener >) listener

Removes a previously added PickListener.

Parameters
listenerThe PickListener instance to remove PickListener.

Swift code snippet:

locationWindow.removePickListener(listener)
print("Removed pick listener \‍(i)")

Objective C code snippet:

[_locationWindow removePickListener:listeners[i]];
NSLog(@"Removed pick listener %d", i);

◆ removePolygonMapObject:

- (BOOL) removePolygonMapObject: (nullable NCPolygonMapObject *) polygonMapObject

Removes a polygon map object from the location view.

Parameters
polygonMapObjectThe polygon map object instance PolygonMapObject.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Remove polygon map object
if let polygonMapObject = polygonMapObject {
let removed = locationWindow.removePolygonMapObject(polygonMapObject)
print("Removed polygon map object: \‍(removed)")
self.polygonMapObject = nil
}

Objective C code snippet:

// Remove polygon map object
if (polygonObject != nil) {
BOOL removed = [_locationWindow removePolygonMapObject:polygonObject];
NSLog(@"Removed polygon map object: %@", removed ? @"YES" : @"NO");
}

◆ removePolylineMapObject:

- (BOOL) removePolylineMapObject: (nullable NCPolylineMapObject *) polylineMapObject

Removes a polyline map object from the location view.

Parameters
polylineMapObjectThe polyline map object instance PolylineMapObject.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Remove polyline map object
if let polylineMapObject = polylineMapObject {
let removed = locationWindow.removePolylineMapObject(polylineMapObject)
print("Removed polyline map object: \‍(removed)")
self.polylineMapObject = nil
}

Objective C code snippet:

// Remove polyline map object
[_locationWindow removePolylineMapObject:polylineObject];
[_mapObjects removeObject:polylineObject];
NSLog(@"Removed polyline map object");

◆ removeSublocationChangeListener:

- (void) removeSublocationChangeListener: (nullable id< NCSublocationChangeListener >) listener

Removes previously added sublocation change listener.

Parameters
listenerListener instance to remove SublocationChangeListener.

Swift code snippet:

locationWindow.removeSublocationChangeListener(listener)
print("Removed sublocation change listener")

Objective C code snippet:

[_locationWindow removeSublocationChangeListener:listener];
NSLog(@"Removed sublocation change listener");

◆ screenPositionToMeters:

- (nonnull NCPoint *) screenPositionToMeters: (CGPoint) point

Converts screen coordinates (pixels) to metrics coordinates (meters).

Parameters
point(x,y) coordinates in screen pixels.
Returns
(x,y) coordinates in meters Point.

Swift code snippet:

// Convert screen position to meters
let screenPoint = Point(x: 100.0, y: 200.0)
let metersPoint = locationWindow.screenPositionToMeters(screenPoint)
print("Screen position (\‍(screenPoint.x), \‍(screenPoint.y)) converted to meters: (\‍(metersPoint.x), \‍(metersPoint.y))")

Objective C code snippet:

// Convert screen position to meters
NCPoint *screenPoint = [[NCPoint alloc] initWithX:100.0 y:200.0];
NCPoint *metersPoint = [_locationWindow screenPositionToMeters:screenPoint];
NSLog(@"Screen position (%.1f, %.1f) converted to meters: (%.1f, %.1f)",
screenPoint.x, screenPoint.y, metersPoint.x, metersPoint.y);

◆ selectMapFeature:

- (BOOL) selectMapFeature: (nonnull NSString *) featureId

Selects a map feature by its feature ID.

Parameters
featureIdThe feature ID from the mapFeaturePickResult PickListener.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Select map feature by ID
let featureId = "room_101"
let selected = locationWindow.selectMapFeature(featureId)
print("Selected map feature \‍(featureId): \‍(selected)")

Objective C code snippet:

// Select map feature by ID
NSString *featureId = "room_101";
BOOL selected = [_locationWindow selectMapFeature:featureId];
NSLog(@"Selected map feature %@: %@", featureId, selected ? @"YES" : @"NO");

◆ setDebugFlag:on:

+ (void) setDebugFlag: (NCDebugFlag) flag
on: (BOOL) on 

Sets the state of a debug flag.

Parameters
flagThe debug flag to set DebugFlag.
onSpecifies whether the debug flag is enabled (true) or disabled (false).

◆ setSublocationId:

- (void) setSublocationId: (int32_t) id

Method is used to switch the location view between sublocations (e.g., floors).

Parameters
idSublocation unique identifier Sublocation.

Swift code snippet:

// Set sublocation ID to switch between floors
locationWindow.setSublocationId(1)
print("Set sublocation ID to 1 (first floor)")

Objective C code snippet:

// Set sublocation ID to switch between floors
[_locationWindow setSublocationId:1];
NSLog(@"Set sublocation ID to 1 (first floor)");

Property Documentation

◆ camera

- (NCCamera*) camera
readwritenonatomicassign

Current camera position in meters. Camera.

Swift code snippet:

// Set camera position without animation
locationWindow.camera = newCamera
print("Set camera position to (\‍(newPoint.x), \‍(newPoint.y)) with zoom 50.0 and rotation 0°")

Objective C code snippet:

// Set camera position without animation
_locationWindow.camera = newCamera;
NSLog(@"Set camera position to (%.2f, %.2f) with zoom 50.0 and rotation 0°", newPoint.x, newPoint.y);

Definition at line 661 of file NCLocationWindow.h.

◆ maxZoomFactor

- (float) maxZoomFactor
readwritenonatomicassign

Maximum zoom level for the location view (pixels per meter).

Swift code snippet:

// Set maximum zoom factor
locationWindow.maxZoomFactor = 300.0
print("Set maximum zoom factor to 300.0")

Objective C code snippet:

// Set maximum zoom factor
[_locationWindow setMaxZoomFactor:300.0];
NSLog(@"Set maximum zoom factor to 300.0");

Definition at line 629 of file NCLocationWindow.h.

◆ minZoomFactor

- (float) minZoomFactor
readwritenonatomicassign

Minimum zoom level for the location view (pixels per meter).

Swift code snippet:

// Set minimum zoom factor
locationWindow.minZoomFactor = 50.0
print("Set minimum zoom factor to 50.0")

Objective C code snippet:

// Set minimum zoom factor
[_locationWindow setMinZoomFactor:50.0];
NSLog(@"Set minimum zoom factor to 50.0");

Definition at line 614 of file NCLocationWindow.h.

◆ pickRadius

- (float) pickRadius
readwritenonatomicassign

Radius for picking features on the map, in density-independent pixels. Default: 0.5 dp.

Swift code snippet:

// Set pick radius
locationWindow.pickRadius = 10.0
print("Set pick radius to 10.0 pixels")

Objective C code snippet:

// Set pick radius
_locationWindow.pickRadius = 10.0;
NSLog(@"Set pick radius to 10.0 pixels");

Definition at line 737 of file NCLocationWindow.h.

◆ rotateGestureEnabled

- (BOOL) rotateGestureEnabled
readwritenonatomicassign

Specifies whether rotation gestures (e.g., two-finger rotation) are enabled.

Swift code snippet:

// Set rotate gesture enabled
locationWindow.rotateGestureEnabled = true
print("Set rotate gesture enabled to true")

Objective C code snippet:

// Set rotate gesture enabled
_locationWindow.rotateGestureEnabled = YES;
NSLog(@"Set rotate gesture enabled to true");

Definition at line 676 of file NCLocationWindow.h.

◆ scrollGesturesEnabled

- (BOOL) scrollGesturesEnabled
readwritenonatomicassign

Specifies whether scroll gestures (e.g., pan gesture) are enabled.

Swift code snippet:

// Set scroll gestures enabled
locationWindow.scrollGesturesEnabled = true
print("Set scroll gestures enabled to true")

Objective C code snippet:

// Set scroll gestures enabled
_locationWindow.scrollGesturesEnabled = YES;
NSLog(@"Set scroll gestures enabled to true");

Definition at line 706 of file NCLocationWindow.h.

◆ selectedMapFeatures

- (NSArray<NSString *>*) selectedMapFeatures
readnonatomicassign

List of currently selected map feature IDs.

Swift code snippet:

// Get list of selected map features
let selectedFeatures = locationWindow.selectedMapFeatures
print("Currently selected map features: \‍(selectedFeatures.count) features")
for feature in selectedFeatures {
print(" - \‍(feature)")
}

Objective C code snippet:

// Get list of selected map features
NSArray<NSString *> *selectedFeatures = [_locationWindow selectedMapFeatures];
NSLog(@"Currently selected map features: %lu features", (unsigned long)selectedFeatures.count);
for (NSString *feature in selectedFeatures) {
NSLog(@" - %@", feature);
}

Definition at line 752 of file NCLocationWindow.h.

◆ stickToBorder

- (BOOL) stickToBorder
readwritenonatomicassign

Specifies whether sublocation content sticks to screen borders. If true, content sticks to screen bounds; if false, content is centered. Default: true.

Swift code snippet:

// Set stick to border property
locationWindow.stickToBorder = true
print("Set stick to border to true")

Objective C code snippet:

// Set stick to border property
_locationWindow.stickToBorder = YES;
NSLog(@"Set stick to border to true");

Definition at line 645 of file NCLocationWindow.h.

◆ tiltGesturesEnabled

- (BOOL) tiltGesturesEnabled
readwritenonatomicassign

Specifies whether tilt gestures (e.g., two-finger parallel pan) are enabled.

Swift code snippet:

// Set tilt gestures enabled
locationWindow.tiltGesturesEnabled = true
print("Set tilt gestures enabled to true")

Objective C code snippet:

// Set tilt gestures enabled
_locationWindow.tiltGesturesEnabled = YES;
NSLog(@"Set tilt gestures enabled to true");

Definition at line 691 of file NCLocationWindow.h.

◆ zoomFactor

- (float) zoomFactor
readwritenonatomicassign

Specifies the zoom level of the location view, in pixels per meter. Default: approximately 100 meters across the screen width.

Swift code snippet:

// Set zoom factor
locationWindow.zoomFactor = 150.0
print("Set zoom factor to 150.0")

Objective C code snippet:

// Set zoom factor
[_locationWindow setZoomFactor:150.0];
NSLog(@"Set zoom factor to 150.0");

Definition at line 599 of file NCLocationWindow.h.

◆ zoomGesturesEnabled

- (BOOL) zoomGesturesEnabled
readwritenonatomicassign

Specifies whether zoom gestures (e.g., two-finger pinch) are enabled.

Swift code snippet:

// Set zoom gestures enabled
locationWindow.zoomGesturesEnabled = true
print("Set zoom gestures enabled to true")

Objective C code snippet:

// Set zoom gestures enabled
_locationWindow.zoomGesturesEnabled = YES;
NSLog(@"Set zoom gestures enabled to true");

Definition at line 721 of file NCLocationWindow.h.


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