Loading...
Searching...
No Matches
NCDottedPolylineMapObject Class Reference

Represents a polyline object with points placed along it on the location view. More...

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

+ Inheritance diagram for NCDottedPolylineMapObject:

Instance Methods

(BOOL) - setPolyLine:
 Method is used to specify the source polyline for the points.
 
(BOOL) - setColor:green:blue:alpha:
 Method is used to specify the color of the object.
 
(BOOL) - setSize:height:
 Method is used to specify the size of the points.
 
(BOOL) - setCollisionEnabled:
 Method is used to enable or disable collision detection for the icon.
 
(BOOL) - setPlacement:
 Method is used to specify the placement mode for points along the polyline.
 
(BOOL) - setPlacementMinRatio:
 Method is used to specify the minimum ratio of the polyline length for point placement.
 
(BOOL) - setPlacementSpacing:
 Method is used to specify the spacing between points for spaced placement.
 
(BOOL) - setRepeatDistance:
 Method is used to specify the distance interval for repeating points along the polyline.
 
(BOOL) - setRepeatGroup:
 Method is used to specify the group identifier for repeating points.
 
(BOOL) - setPriority:
 Method is used to specify the priority of the icon.
 
(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 polyline object with points placed along it on the location view.

Referenced from LocationWindow.

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

◆ setCollisionEnabled:

- (BOOL) setCollisionEnabled: (BOOL) enabled

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

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 dottedCollisionSuccess = dottedPolylineMapObject.setCollisionEnabled(true)
print("Enabled collision detection for dotted polyline: \‍(dottedCollisionSuccess)")

Objective C code snippet:

// Enable collision detection
BOOL collisionSuccess = [dottedPolylineObject setCollisionEnabled:YES];
NSLog(@"Enabled collision detection for dotted polyline: %@", 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 color of the object.

Parameters
redRed RGBA component.
greenGreen RGBA component.
blueBlue RGBA component.
alphaOpacity multiplier. Values below 0 will be set to 0. Default: 1.
Returns
true if success, false otherwise.

Swift code snippet:

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

Objective C code snippet:

// Set dotted polyline color
BOOL colorSuccess = [dottedPolylineObject setColorWithRed:0.5 green:0.0 blue:1.0 alpha:0.8];
NSLog(@"Set dotted polyline color to purple 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");

◆ setPlacement:

- (BOOL) setPlacement: (NCPlacement) placement

Method is used to specify the placement mode for points along the polyline.

Parameters
placementThe placement mode Placement. Default: VERTEX.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set placement type
let dottedPlacementSuccess = dottedPolylineMapObject.setPlacement(.center)
print("Set dotted polyline placement to CENTER: \‍(dottedPlacementSuccess)")

Objective C code snippet:

// Set placement type
BOOL placementSuccess = [dottedPolylineObject setPlacement:NCCenter];
NSLog(@"Set dotted polyline placement to CENTER: %@", placementSuccess ? @"YES" : @"NO");

◆ setPlacementMinRatio:

- (BOOL) setPlacementMinRatio: (float) ratio

Method is used to specify the minimum ratio of the polyline length for point placement.

Parameters
ratioThe minimum ratio of the polyline length (typically between 0 and 1). Default: 1.0.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set placement min ratio
let dottedMinRatioSuccess = dottedPolylineMapObject.setPlacementMinRatio(0.5)
print("Set dotted polyline placement min ratio to 0.5: \‍(dottedMinRatioSuccess)")

Objective C code snippet:

// Set placement min ratio
BOOL minRatioSuccess = [dottedPolylineObject setPlacementMinRatio:0.5];
NSLog(@"Set dotted polyline placement min ratio to 0.5: %@", minRatioSuccess ? @"YES" : @"NO");

◆ setPlacementSpacing:

- (BOOL) setPlacementSpacing: (float) spacing

Method is used to specify the spacing between points for spaced placement.

Parameters
spacingThe spacing distance in pixels. Default: 80.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set placement spacing
let dottedSpacingSuccess = dottedPolylineMapObject.setPlacementSpacing(10.0)
print("Set dotted polyline placement spacing to 10.0: \‍(dottedSpacingSuccess)")

Objective C code snippet:

// Set placement spacing
BOOL spacingSuccess = [dottedPolylineObject setPlacementSpacing:10.0];
NSLog(@"Set dotted polyline placement spacing to 10.0: %@", spacingSuccess ? @"YES" : @"NO");

◆ setPolyLine:

- (BOOL) setPolyLine: (nonnull NCLocationPolyline *) polyline

Method is used to specify the source polyline for the points.

Parameters
polylineMetrics coordinates of the polyline LocationPolyline.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set dotted polyline geometry
let points = [
NCLocationPoint(x: 160.0, y: 170.0),
NCLocationPoint(x: 165.0, y: 175.0),
NCLocationPoint(x: 170.0, y: 180.0),
NCLocationPoint(x: 175.0, y: 185.0)
]
let polyline = NCLocationPolyline(points: points)
let success = dottedPolylineMapObject.setPolyline(polyline)
print("Set dotted polyline with \‍(points.count) points: \‍(success)")

Objective C code snippet:

// Set dotted polyline geometry
NSArray *dottedPoints = @[
[[NCLocationPoint alloc] initWithX:160.0 y:170.0],
[[NCLocationPoint alloc] initWithX:165.0 y:175.0],
[[NCLocationPoint alloc] initWithX:170.0 y:180.0],
[[NCLocationPoint alloc] initWithX:175.0 y:185.0]
];
NCLocationPolyline *dottedPolyline = [[NCLocationPolyline alloc] initWithPoints:dottedPoints];
BOOL dottedSuccess = [dottedPolylineObject setPolyline:dottedPolyline];
NSLog(@"Set dotted polyline with %lu points: %@", (unsigned long)dottedPoints.count, dottedSuccess ? @"YES" : @"NO");

◆ setPriority:

- (BOOL) setPriority: (float) priority

Method is used to specify the priority of the icon.

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

Swift code snippet:

// Set rendering priority
let dottedPrioritySuccess = dottedPolylineMapObject.setPriority(1)
print("Set dotted polyline rendering priority to 1: \‍(dottedPrioritySuccess)")

Objective C code snippet:

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

◆ setRepeatDistance:

- (BOOL) setRepeatDistance: (float) distance

Method is used to specify the distance interval for repeating points along the polyline.

Parameters
distanceThe repeat distance in pixels. Default: 0.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set repeat distance
let dottedRepeatDistanceSuccess = dottedPolylineMapObject.setRepeatDistance(20.0)
print("Set dotted polyline repeat distance to 20.0: \‍(dottedRepeatDistanceSuccess)")

Objective C code snippet:

// Set repeat distance
BOOL repeatDistanceSuccess = [dottedPolylineObject setRepeatDistance:20.0];
NSLog(@"Set dotted polyline repeat distance to 20.0: %@", repeatDistanceSuccess ? @"YES" : @"NO");

◆ setRepeatGroup:

- (BOOL) setRepeatGroup: (int32_t) group

Method is used to specify the group identifier for repeating points.

Parameters
groupThe group identifier for point repetition. Default: 0.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set repeat group
let dottedRepeatGroupSuccess = dottedPolylineMapObject.setRepeatGroup(1)
print("Set dotted polyline repeat group to 1: \‍(dottedRepeatGroupSuccess)")

Objective C code snippet:

// Set repeat group
BOOL repeatGroupSuccess = [dottedPolylineObject setRepeatGroup:1];
NSLog(@"Set dotted polyline repeat group to 1: %@", repeatGroupSuccess ? @"YES" : @"NO");

◆ setSize:height:

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

Method is used to specify the size of the points.

Parameters
widthWidth of the points in pixels.
heightHeight of the points in pixels.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set size
let dottedSize = NCSize(width: 16.0, height: 16.0)
let dottedSizeSuccess = dottedPolylineMapObject.setSize(dottedSize)
print("Set dotted polyline size to (\‍(dottedSize.width), \‍(dottedSize.height)): \‍(dottedSizeSuccess)")

Objective C code snippet:

// Set size
NCSize *size = [[NCSize alloc] initWithWidth:16.0 height:16.0];
BOOL sizeSuccess = [dottedPolylineObject setSize:size];
NSLog(@"Set dotted polyline size to (%.1f, %.1f): %@", size.width, size.height, sizeSuccess ? @"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: