Represents a polyline object on the location view.
More...
#include <com/navigine/idl/objc/NCPolylineMapObject.h>
|
| (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.
|
| |
Represents a polyline object on the location view.
Referenced from LocationWindow.
Definition at line 23 of file NCPolylineMapObject.h.
◆ 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:
NSDictionary *retrievedData = circleObject.data;
NSLog(@"Circle custom data: %@", retrievedData);
◆ 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:
NSInteger objectId = circleObject.id;
NSLog(@"Circle object ID: %ld", (long)objectId);
◆ 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:
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
-
| alpha | Opacity 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:
BOOL alphaSuccess = [circleObject
setAlpha:0.7];
NSLog(@"Set circle alpha to 0.7: %@", alphaSuccess ? @"YES" : @"NO");
◆ setCapType:
Method is used to specify the cap style for the polyline ends.
- Parameters
-
| cap | The 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:
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
-
| red | Red RGBA component (0 to 1). |
| green | Green RGBA component (0 to 1). |
| blue | Blue RGBA component (0 to 1). |
| alpha | Opacity 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:
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
-
| data | Data 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:
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
-
| interactive | Specifies 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:
NSLog(@"Set circle interactive to true: %@", interactiveSuccess ? @"YES" : @"NO");
◆ setJoinType:
Method is used to specify the join style for polyline segments.
- Parameters
-
| join | The 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:
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
-
| miterLimit | The 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:
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
-
| order | The 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:
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
-
| alpha | Opacity 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:
NSLog(@"Set polyline outline alpha to 0.5: %@", outlineAlphaSuccess ? @"YES" : @"NO");
◆ setOutlineCapType:
Method is used to specify the cap style for the polyline’s outline ends.
- Parameters
-
| cap | The 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:
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
-
| red | Red RGBA component (0 to 1). |
| green | Green RGBA component (0 to 1). |
| blue | Blue RGBA component (0 to 1). |
| alpha | Opacity 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:
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:
Method is used to specify the join style for the polyline’s outline segments.
- Parameters
-
| join | The 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:
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
-
| miterLimit | The 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:
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
-
| order | The 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:
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
-
| radius | Width 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:
NSLog(@"Set polyline outline width to 1.0 pixels: %@", outlineWidthSuccess ? @"YES" : @"NO");
◆ setPolyLine:
Method is used to specify the source polyline of the object.
- Parameters
-
- 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:
NSArray *polylinePoints = @[
];
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
-
| title | The 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:
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
-
| visible | Specifies 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:
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
-
| width | Width 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:
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: