Loading...
Searching...
No Matches

Represents a polyline object on the location view. More...

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

+ Inheritance diagram for NCPolylineMapObject:

Instance Methods

(BOOL) - setPolyLine:
 Method is used to specify the source polyline of the object.
 
(BOOL) - setWidth:
 Method is used to specify the width of the polyline.
 
(BOOL) - setColor:green:blue:alpha:
 Method is used to specify the fill color of the polyline.
 
(BOOL) - setOrder:
 Method is used to specify the rendering order of the polyline.
 
(BOOL) - setCapType:
 Method is used to specify the cap style for the polyline ends.
 
(BOOL) - setJoinType:
 Method is used to specify the join style for polyline segments.
 
(BOOL) - setMiterLimit:
 Method is used to specify the miter limit for miter joins.
 
(BOOL) - setOutlineColor:green:blue:alpha:
 Method is used to specify the color of the polyline’s outline.
 
(BOOL) - setOutlineWidth:
 Method is used to specify the width of the polyline’s outline.
 
(BOOL) - setOutlineAlpha:
 Method is used to specify the opacity of the polyline’s outline.
 
(BOOL) - setOutlineCapType:
 Method is used to specify the cap style for the polyline’s outline ends.
 
(BOOL) - setOutlineJoinType:
 Method is used to specify the join style for the polyline’s outline segments.
 
(BOOL) - setOutlineMiterLimit:
 Method is used to specify the miter limit for the polyline’s outline miter joins.
 
(BOOL) - setOutlineOrder:
 Method is used to specify the rendering order of the polyline’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 polyline object on the location view.

Referenced from LocationWindow.

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

◆ setCapType:

- (BOOL) setCapType: (NCCapType) cap

Method is used to specify the cap style for the polyline ends.

Parameters
capThe cap type CapType. Default: BUTT.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set polyline cap type
let capTypeSuccess = polylineMapObject.setCapType(.round)
print("Set polyline cap type to ROUND: \‍(capTypeSuccess)")

Objective C code snippet:

// Set polyline cap type
BOOL capTypeSuccess = [polylineObject setCapType:NCCapTypeRound];
NSLog(@"Set polyline cap type to ROUND: %@", capTypeSuccess ? @"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 polyline.

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 polyline color
let colorSuccess = polylineMapObject.setColor(red: 0.0, green: 1.0, blue: 0.0, alpha: 0.8)
print("Set polyline color to green with 80% opacity: \‍(colorSuccess)")

Objective C code snippet:

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

◆ setJoinType:

- (BOOL) setJoinType: (NCJoinType) join

Method is used to specify the join style for polyline segments.

Parameters
joinThe join type JoinType. Default: MITER.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set polyline join type
let joinTypeSuccess = polylineMapObject.setJoinType(.round)
print("Set polyline join type to ROUND: \‍(joinTypeSuccess)")

Objective C code snippet:

// Set polyline join type
BOOL joinTypeSuccess = [polylineObject setJoinType:NCJoinTypeRound];
NSLog(@"Set polyline join type to ROUND: %@", joinTypeSuccess ? @"YES" : @"NO");

◆ setMiterLimit:

- (BOOL) setMiterLimit: (float) miterLimit

Method is used to specify the miter limit for miter joins.

Parameters
miterLimitThe miter limit value for miter joins. Default: 3.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set polyline miter limit
let miterLimitSuccess = polylineMapObject.setMiterLimit(2.0)
print("Set polyline miter limit to 2.0: \‍(miterLimitSuccess)")

Objective C code snippet:

// Set polyline miter limit
BOOL miterLimitSuccess = [polylineObject setMiterLimit:2.0];
NSLog(@"Set polyline miter limit to 2.0: %@", miterLimitSuccess ? @"YES" : @"NO");

◆ setOrder:

- (BOOL) setOrder: (int32_t) order

Method is used to specify the rendering order of the polyline.

Parameters
orderThe rendering order value. Default: 0.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set polyline rendering order
let orderSuccess = polylineMapObject.setOrder(1)
print("Set polyline rendering order to 1: \‍(orderSuccess)")

Objective C code snippet:

// Set polyline rendering order
BOOL polylineOrderSuccess = [polylineObject setOrder:1];
NSLog(@"Set polyline rendering order to 1: %@", polylineOrderSuccess ? @"YES" : @"NO");

◆ setOutlineAlpha:

- (BOOL) setOutlineAlpha: (float) alpha

Method is used to specify the opacity of the polyline’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 polyline outline alpha
let outlineAlphaSuccess = polylineMapObject.setOutlineAlpha(0.5)
print("Set polyline outline alpha to 0.5: \‍(outlineAlphaSuccess)")

Objective C code snippet:

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

◆ setOutlineCapType:

- (BOOL) setOutlineCapType: (NCCapType) cap

Method is used to specify the cap style for the polyline’s outline ends.

Parameters
capThe cap type CapType. Default: BUTT.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set polyline outline cap type
let outlineCapTypeSuccess = polylineMapObject.setOutlineCapType(.square)
print("Set polyline outline cap type to SQUARE: \‍(outlineCapTypeSuccess)")

Objective C code snippet:

// Set polyline outline cap type
BOOL outlineCapTypeSuccess = [polylineObject setOutlineCapType:NCCapTypeSquare];
NSLog(@"Set polyline outline cap type to SQUARE: %@", outlineCapTypeSuccess ? @"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 polyline’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 polyline outline color
let outlineColorSuccess = polylineMapObject.setOutlineColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0)
print("Set polyline outline color to black: \‍(outlineColorSuccess)")

Objective C code snippet:

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

◆ setOutlineJoinType:

- (BOOL) setOutlineJoinType: (NCJoinType) join

Method is used to specify the join style for the polyline’s outline segments.

Parameters
joinThe join type JoinType. Default: MITER.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set polyline outline join type
let outlineJoinTypeSuccess = polylineMapObject.setOutlineJoinType(.miter)
print("Set polyline outline join type to MITER: \‍(outlineJoinTypeSuccess)")

Objective C code snippet:

// Set polyline outline join type
BOOL outlineJoinTypeSuccess = [polylineObject setOutlineJoinType:NCJoinTypeMiter];
NSLog(@"Set polyline outline join type to MITER: %@", outlineJoinTypeSuccess ? @"YES" : @"NO");

◆ setOutlineMiterLimit:

- (BOOL) setOutlineMiterLimit: (float) miterLimit

Method is used to specify the miter limit for the polyline’s outline miter joins.

Parameters
miterLimitThe miter limit value for outline miter joins. Default: 3.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set polyline outline miter limit
let outlineMiterLimitSuccess = polylineMapObject.setOutlineMiterLimit(3.0)
print("Set polyline outline miter limit to 3.0: \‍(outlineMiterLimitSuccess)")

Objective C code snippet:

// Set polyline outline miter limit
BOOL outlineMiterLimitSuccess = [polylineObject setOutlineMiterLimit:3.0];
NSLog(@"Set polyline outline miter limit to 3.0: %@", outlineMiterLimitSuccess ? @"YES" : @"NO");

◆ setOutlineOrder:

- (BOOL) setOutlineOrder: (int32_t) order

Method is used to specify the rendering order of the polyline’s outline.

Parameters
orderThe rendering order value for the outline. Default: 0.
Returns
true if the operation is successful, false otherwise.

Swift code snippet:

// Set polyline outline rendering order
let outlineOrderSuccess = polylineMapObject.setOutlineOrder(0)
print("Set polyline outline rendering order to 0: \‍(outlineOrderSuccess)")

Objective C code snippet:

// Set polyline outline rendering order
BOOL outlineOrderSuccess = [polylineObject setOutlineOrder:0];
NSLog(@"Set polyline outline rendering order to 0: %@", outlineOrderSuccess ? @"YES" : @"NO");

◆ setOutlineWidth:

- (BOOL) setOutlineWidth: (float) radius

Method is used to specify the width of the polyline’s outline.

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

Swift code snippet:

// Set polyline outline width
let outlineWidthSuccess = polylineMapObject.setOutlineWidth(1.0)
print("Set polyline outline width to 1.0 pixels: \‍(outlineWidthSuccess)")

Objective C code snippet:

// Set polyline outline width
BOOL outlineWidthSuccess = [polylineObject setOutlineWidth:1.0];
NSLog(@"Set polyline outline width to 1.0 pixels: %@", outlineWidthSuccess ? @"YES" : @"NO");

◆ setPolyLine:

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

Method is used to specify the source polyline of the object.

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

Swift code snippet:

// Set polyline geometry
let points = [
NCLocationPoint(x: 100.0, y: 110.0),
NCLocationPoint(x: 105.0, y: 115.0),
NCLocationPoint(x: 110.0, y: 120.0),
NCLocationPoint(x: 115.0, y: 125.0)
]
let polyline = NCLocationPolyline(points: points)
let success = polylineMapObject.setPolyLine(polyline)
print("Set polyline with \‍(points.count) points: \‍(success)")

Objective C code snippet:

// Set polyline geometry
NSArray *polylinePoints = @[
[[NCLocationPoint alloc] initWithX:100.0 y:200.0],
[[NCLocationPoint alloc] initWithX:150.0 y:250.0],
[[NCLocationPoint alloc] initWithX:200.0 y:300.0],
[[NCLocationPoint alloc] initWithX:250.0 y:350.0]
];
NCLocationPolyline *polyline = [[NCLocationPolyline alloc] initWithPoints:polylinePoints];
BOOL polylineSuccess = [polylineObject setPolyLine:polyline];
NSLog(@"Set polyline with %lu points: %@", (unsigned long)polylinePoints.count, polylineSuccess ? @"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");

◆ setWidth:

- (BOOL) setWidth: (float) width

Method is used to specify the width of the polyline.

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

Swift code snippet:

// Set polyline width
let widthSuccess = polylineMapObject.setWidth(3.0)
print("Set polyline width to 3.0 pixels: \‍(widthSuccess)")

Objective C code snippet:

// Set polyline width
BOOL widthSuccess = [polylineObject setWidth:3.0];
NSLog(@"Set polyline width to 3.0 pixels: %@", widthSuccess ? @"YES" : @"NO");

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