Loading...
Searching...
No Matches

Represents a circle on the location view. More...

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

+ Inheritance diagram for NCCircleMapObject:

Instance Methods

(BOOL) - setPosition:
 Method is used to specify the center of the circle.
 
(BOOL) - setPositionAnimated:duration:type:
 Method is used to move the center of the circle with the specified animation.
 
(BOOL) - setColor:green:blue:alpha:
 Method is used to specify the fill color of the circle.
 
(BOOL) - setRadius:
 Method is used to specify the size of the circle.
 
(BOOL) - setCollisionEnabled:
 Method is used to enable or disable collision detection for the circle.
 
(BOOL) - setBuffer:height:
 Method is used to specify the buffer size around the circle for collision detection.
 
(BOOL) - setOffset:height:
 Method is used to specify an offset for the circle’s position.
 
(BOOL) - setPriority:
 Method is used to specify the priority of the circle.
 
(BOOL) - setOutlineColor:green:blue:alpha:
 Method is used to specify the color of the circle’s outline.
 
(BOOL) - setOutlineRadius:
 Method is used to specify the thickness of the circle’s outline.
 
(BOOL) - setOutlineAlpha:
 Method is used to specify the opacity of the circle’s outline.
 
(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

Represents a circle on the location view.

Referenced from LocationWindow.

Definition at line 22 of file NCCircleMapObject.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");

◆ setBuffer:height:

- (BOOL) setBuffer: (float) width
height: (float) height 

Method is used to specify the buffer size around the circle for collision detection.

Parameters
widthWidth of the buffer in pixels. Default: 0.
heightHeight of the buffer in pixels. Default: 0.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set collision buffer
let bufferSuccess = circleMapObject.setBuffer(width: 5.0, height: 5.0)
print("Set collision buffer to 5x5 pixels: \‍(bufferSuccess)")

Objective C code snippet:

// Set collision buffer
BOOL bufferSuccess = [circleObject setBufferWithWidth:5.0 height:5.0];
NSLog(@"Set collision buffer to 5x5 pixels: %@", bufferSuccess ? @"YES" : @"NO");

◆ setCollisionEnabled:

- (BOOL) setCollisionEnabled: (BOOL) enabled

Method is used to enable or disable collision detection for the circle.

Parameters
enabledSpecifies whether collision detection is enabled (true) or disabled (false). Default: false.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Enable collision detection
let collisionSuccess = circleMapObject.setCollisionEnabled(true)
print("Enabled collision detection for circle: \‍(collisionSuccess)")

Objective C code snippet:

// Enable collision detection
BOOL collisionSuccess = [circleObject setCollisionEnabled:YES];
NSLog(@"Enabled collision detection for circle: %@", collisionSuccess ? @"YES" : @"NO");

◆ setColor:green:blue:alpha:

- (BOOL) setColor: (float) red
green: (float) green
blue: (float) blue
alpha: (float) alpha 

Method is used to specify the fill color of the circle.

Parameters
redRed RGBA component (0 to 1).
greenGreen RGBA component (0 to 1).
blueBlue RGBA component (0 to 1).
alphaOpacity multiplier (0 to 1). Values below 0 are set to 0. Default: 1.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set circle color
let colorSuccess = circleMapObject.setColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 0.8)
print("Set circle color to red with 80% opacity: \‍(colorSuccess)")

Objective C code snippet:

// Set circle color
BOOL colorSuccess = [circleObject setColorWithRed:1.0 green:0.0 blue:0.0 alpha:0.8];
NSLog(@"Set circle color to red with 80%% opacity: %@", colorSuccess ? @"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");

◆ setOffset:height:

- (BOOL) setOffset: (float) width
height: (float) height 

Method is used to specify an offset for the circle’s position.

Parameters
widthHorizontal offset in pixels.
heightVertical offset in pixels.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set position offset
let offsetSuccess = circleMapObject.setOffset(x: 2.0, y: 3.0)
print("Set position offset to (2.0, 3.0) pixels: \‍(offsetSuccess)")

Objective C code snippet:

// Set position offset
BOOL offsetSuccess = [circleObject setOffsetWithX:2.0 y:3.0];
NSLog(@"Set position offset to (2.0, 3.0) pixels: %@", offsetSuccess ? @"YES" : @"NO");

◆ setOutlineAlpha:

- (BOOL) setOutlineAlpha: (float) alpha

Method is used to specify the opacity of the circle’s outline.

Parameters
alphaOpacity multiplier (0 to 1). Values below 0 are set to 0. Default: 1.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set outline alpha
let outlineAlphaSuccess = circleMapObject.setOutlineAlpha(0.5)
print("Set circle outline alpha to 0.5: \‍(outlineAlphaSuccess)")

Objective C code snippet:

// Set outline alpha
BOOL outlineAlphaSuccess = [circleObject setOutlineAlpha:0.5];
NSLog(@"Set circle outline alpha to 0.5: %@", outlineAlphaSuccess ? @"YES" : @"NO");

◆ setOutlineColor:green:blue:alpha:

- (BOOL) setOutlineColor: (float) red
green: (float) green
blue: (float) blue
alpha: (float) alpha 

Method is used to specify the color of the circle’s outline.

Parameters
redRed RGBA component (0 to 1).
greenGreen RGBA component (0 to 1).
blueBlue RGBA component (0 to 1).
alphaOpacity multiplier (0 to 1). Values below 0 are set to 0. Default: 1.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set outline color
let outlineColorSuccess = circleMapObject.setOutlineColor(red: 0.0, green: 0.0, blue: 1.0, alpha: 1.0)
print("Set circle outline color to blue: \‍(outlineColorSuccess)")

Objective C code snippet:

// Set outline color
BOOL outlineColorSuccess = [circleObject setOutlineColorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0];
NSLog(@"Set circle outline color to blue: %@", outlineColorSuccess ? @"YES" : @"NO");

◆ setOutlineRadius:

- (BOOL) setOutlineRadius: (float) radius

Method is used to specify the thickness of the circle’s outline.

Parameters
radiusThickness of the outline in pixels.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set outline radius
let outlineRadiusSuccess = circleMapObject.setOutlineRadius(2.0)
print("Set circle outline radius to 2.0: \‍(outlineRadiusSuccess)")

Objective C code snippet:

// Set outline radius
BOOL outlineRadiusSuccess = [circleObject setOutlineRadius:2.0];
NSLog(@"Set circle outline radius to 2.0: %@", outlineRadiusSuccess ? @"YES" : @"NO");

◆ setPosition:

- (BOOL) setPosition: (nonnull NCLocationPoint *) point

Method is used to specify the center of the circle.

Parameters
pointMetrics coordinates of the center LocationPoint.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set circle position
let centerPoint = NCLocationPoint(x: 100.0, y: 200.0)
let success = circleMapObject.setPosition(centerPoint)
print("Set circle position to (\‍(centerPoint.x), \‍(centerPoint.y)): \‍(success)")

Objective C code snippet:

// Set circle position
NCLocationPoint *centerPoint = [[NCLocationPoint alloc] initWithX:100.0 y:200.0];
BOOL success = [circleObject setPosition:centerPoint];
NSLog(@"Set circle position to (%f, %f): %@", centerPoint.x, centerPoint.y, success ? @"YES" : @"NO");

◆ setPositionAnimated:duration:type:

- (BOOL) setPositionAnimated: (nonnull NCLocationPoint *) point
duration: (float) duration
type: (NCAnimationType) type 

Method is used to move the center of the circle with the specified animation.

Parameters
pointMetrics coordinates of the center LocationPoint.
durationAnimation duration in seconds.
typeAnimation type AnimationType. Default: CENTER.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set circle position with animation
let animatedPoint = NCLocationPoint(x: 150.0, y: 250.0)
let animatedSuccess = circleMapObject.setPositionAnimated(animatedPoint, duration: 2.0, animationType: .linear)
print("Set circle position with animation to (\‍(animatedPoint.x), \‍(animatedPoint.y)): \‍(animatedSuccess)")

Objective C code snippet:

// Set circle position with animation
NCLocationPoint *animatedPoint = [[NCLocationPoint alloc] initWithX:150.0 y:250.0];
BOOL animatedSuccess = [circleObject setPositionAnimated:animatedPoint duration:2.0 animationType:AnimationTypeLinear];
NSLog(@"Set circle position with animation to (%f, %f): %@", animatedPoint.x, animatedPoint.y, animatedSuccess ? @"YES" : @"NO");

◆ setPriority:

- (BOOL) setPriority: (float) priority

Method is used to specify the priority of the circle.

Parameters
priorityThe priority value for rendering or interaction. Default: 0.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set rendering priority
let prioritySuccess = circleMapObject.setPriority(1)
print("Set rendering priority to 1: \‍(prioritySuccess)")

Objective C code snippet:

// Set rendering priority
BOOL prioritySuccess = [circleObject setPriority:1];
NSLog(@"Set rendering priority to 1: %@", prioritySuccess ? @"YES" : @"NO");

◆ setRadius:

- (BOOL) setRadius: (float) radius

Method is used to specify the size of the circle.

Parameters
radiusRadius of the circle in meters.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set circle radius
let radiusSuccess = circleMapObject.setRadius(10.0)
print("Set circle radius to 10.0 meters: \‍(radiusSuccess)")

Objective C code snippet:

// Set circle radius
BOOL radiusSuccess = [circleObject setRadius:10.0];
NSLog(@"Set circle radius to 10.0 meters: %@", radiusSuccess ? @"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: