Loading...
Searching...
No Matches

Base interface for handling objects on the location view. More...

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

+ Inheritance diagram for NCMapObject:

Instance Methods

(int32_t) - getId
 Gets the unique identifier of the map object.
 
(NCMapObjectType- getType
 Gets the type of the map object.
 
(nonnull NSData *) - getData
 Gets the user-defined data associated with the map object.
 
(BOOL) - setVisible:
 Method is used to specify the visibility of the map object.
 
(BOOL) - setInteractive:
 Method is used to specify whether the map object can be interacted with.
 
(void) - setData:
 Method is used to set user-defined data for the map object.
 
(BOOL) - setTitle:
 Method is used to set the title of the map object.
 
(BOOL) - setAlpha:
 Method is used to set the opacity of the map object.
 

Detailed Description

Base interface for handling objects on the location view.

Used to manage objects in LocationWindow. Can be handled in the pickMapObjectAt method LocationWindow.

Referenced from CircleMapObject, IconMapObject, PolylineMapObject, PolygonMapObject, DottedPolylineMapObject.

Definition at line 23 of file NCMapObject.h.

Method Documentation

◆ getData

- (nonnull NSData *) getData

Gets the user-defined data associated with the map object.

Returns
The data stored in the map object.

Swift code snippet:

// Get custom data
let retrievedData = circleMapObject.data
print("Circle custom data: \‍(retrievedData)")

Objective C code snippet:

// Get custom data
NSDictionary *retrievedData = circleObject.data;
NSLog(@"Circle custom data: %@", retrievedData);

◆ getId

- (int32_t) getId

Gets the unique identifier of the map object.

Returns
The unique identifier of the map object.

Swift code snippet:

// Get object ID
let objectId = circleMapObject.id
print("Circle object ID: \‍(objectId)")

Objective C code snippet:

// Get object ID
NSInteger objectId = circleObject.id;
NSLog(@"Circle object ID: %ld", (long)objectId);

◆ getType

- (NCMapObjectType) getType

Gets the type of the map object.

Returns
The type of the map object MapObjectType.

Swift code snippet:

// Get object type
let objectTypeString = circleMapObject.type
print("Circle object type: \‍(objectTypeString)")

Objective C code snippet:

// Get object type
NSString *objectTypeString = circleObject.type;
NSLog(@"Circle object type: %@", objectTypeString);

◆ setAlpha:

- (BOOL) setAlpha: (float) alpha

Method is used to set the opacity of the map object.

Parameters
alphaOpacity multiplier. Values below 0 will be set to 0. Values above 1 will be set to 1. Default: 1.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set alpha transparency
let alphaSuccess = circleMapObject.setAlpha(0.7)
print("Set circle alpha to 0.7: \‍(alphaSuccess)")

Objective C code snippet:

// Set alpha transparency
BOOL alphaSuccess = [circleObject setAlpha:0.7];
NSLog(@"Set circle alpha to 0.7: %@", alphaSuccess ? @"YES" : @"NO");

◆ setData:

- (void) setData: (nonnull NSData *) data

Method is used to set user-defined data for the map object.

Parameters
dataData to store in the map object.

Swift code snippet:

// Set custom data
let customData = ["key": "value", "number": "42"]
let dataSuccess = circleMapObject.setData(customData)
print("Set circle custom data: \‍(dataSuccess)")

Objective C code snippet:

// Set custom data
NSDictionary *customData = @{@"key": @"value", @"number": @"42"};
BOOL dataSuccess = [circleObject setData:customData];
NSLog(@"Set circle custom data: %@", dataSuccess ? @"YES" : @"NO");

◆ setInteractive:

- (BOOL) setInteractive: (BOOL) interactive

Method is used to specify whether the map object can be interacted with.

Parameters
interactiveSpecifies whether the object can be picked in the pickMapObjectAt method (true) or not (false). Default: false.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set interactive mode
let interactiveSuccess = circleMapObject.setInteractive(true)
print("Set circle interactive to true: \‍(interactiveSuccess)")

Objective C code snippet:

// Set interactive mode
BOOL interactiveSuccess = [circleObject setInteractive:YES];
NSLog(@"Set circle interactive to true: %@", interactiveSuccess ? @"YES" : @"NO");

◆ setTitle:

- (BOOL) setTitle: (nonnull NSString *) title

Method is used to set the title of the map object.

Parameters
titleThe title to display on the location view.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set title
let titleSuccess = circleMapObject.setTitle("Circle Object")
print("Set circle title to 'Circle Object': \‍(titleSuccess)")

Objective C code snippet:

// Set title
BOOL titleSuccess = [circleObject setTitle:@"Circle Object"];
NSLog(@"Set circle title to 'Circle Object': %@", titleSuccess ? @"YES" : @"NO");

◆ setVisible:

- (BOOL) setVisible: (BOOL) visible

Method is used to specify the visibility of the map object.

Parameters
visibleSpecifies whether the object is visible (true) or hidden (false). Default: true.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set visibility
let visibleSuccess = circleMapObject.setVisible(true)
print("Set circle visibility to true: \‍(visibleSuccess)")

Objective C code snippet:

// Set visibility
BOOL visibleSuccess = [circleObject setVisible:YES];
NSLog(@"Set circle visibility to true: %@", visibleSuccess ? @"YES" : @"NO");

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