Represents a polyline object with points placed along it on the location view.
More...
#include <com/navigine/idl/objc/NCDottedPolylineMapObject.h>
|
| (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.
|
| |
Represents a polyline object with points placed along it on the location view.
Referenced from LocationWindow.
Definition at line 22 of file NCDottedPolylineMapObject.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");
◆ setCollisionEnabled:
| - (BOOL) setCollisionEnabled: |
|
(BOOL) | enabled |
|
Method is used to enable or disable collision detection for the icon.
- Parameters
-
| enabled | Specifies 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:
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
-
| red | Red RGBA component. |
| green | Green RGBA component. |
| blue | Blue RGBA component. |
| alpha | Opacity 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:
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
-
| 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");
◆ setPlacement:
Method is used to specify the placement mode for points along the polyline.
- Parameters
-
| placement | The 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:
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
-
| ratio | The 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:
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
-
| spacing | The 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:
NSLog(@"Set dotted polyline placement spacing to 10.0: %@", spacingSuccess ? @"YES" : @"NO");
◆ setPolyLine:
Method is used to specify the source polyline for the points.
- Parameters
-
- Returns
- true if the operation is successful, false otherwise.
Swift code snippet:
// Set dotted polyline geometry
let points = [
NCPoint(x: 160.0, y: 170.0),
NCPoint(x: 165.0, y: 175.0),
NCPoint(x: 170.0, y: 180.0),
NCPoint(x: 175.0, y: 185.0),
]
let dottedPl = NCPolyline(points: points)
let polyline = NCLocationPolyline(polyline: dottedPl, locationId: 1, sublocationId: 0)
let success = dottedPolylineMapObject.setPolyline(polyline)
print("Set dotted polyline with \(points.count) points: \(success)")
Objective C code snippet:
NSArray<NCPoint *> *dottedPoints = @[
[[
NCPoint alloc] initWithX:160.0 y:170.0],
[[
NCPoint alloc] initWithX:165.0 y:175.0],
[[
NCPoint alloc] initWithX:170.0 y:180.0],
[[
NCPoint alloc] initWithX:175.0 y:185.0],
];
NCPolyline *dottedPl = [[
NCPolyline alloc] initWithPoints:dottedPoints];
NCLocationPolyline *dottedPolyline = [[
NCLocationPolyline alloc] initWithPolyline:dottedPl locationId:1 sublocationId:0];
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
-
| priority | The 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:
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
-
| distance | The 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:
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
-
| group | The 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:
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
-
| width | Width of the points in pixels. |
| height | Height 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:
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
-
| 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");
◆ valid
Tells if this object is valid or not. Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now.
Definition at line 208 of file NCDottedPolylineMapObject.h.
The documentation for this class was generated from the following file: