Represents a polygon object on the location view.
More...
#include <com/navigine/idl/objc/NCPolygonMapObject.h>
|
| (BOOL) | - setPolygon: |
| | Method is used to specify the source polygon of the object.
|
| |
| (BOOL) | - setColor: |
| | Method is used to specify the color of the object.
|
| |
| (BOOL) | - setOrder: |
| | Method is used to specify the rendering order of the object.
|
| |
| (BOOL) | - setOutlineColor: |
| | Method is used to specify the color of the polygon’s outline.
|
| |
| (BOOL) | - setOutlineWidth: |
| | Method is used to specify the width of the polygon’s outline.
|
| |
| (BOOL) | - setOutlineAlpha: |
| | Method is used to specify the opacity of the polygon’s outline.
|
| |
| (BOOL) | - setOutlineOrder: |
| | Method is used to specify the rendering order of the polygon’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) | - setTitleWithStyle:style: |
| | Method is used to set the title and its style for the map object.
|
| |
| (BOOL) | - setAlpha: |
| | Method is used to set the opacity of the map object.
|
| |
Represents a polygon object on the location view.
Referenced from LocationWindow.
Definition at line 22 of file NCPolygonMapObject.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");
◆ setColor:
| - (BOOL) setColor: |
|
(nonnull UIColor *) | color |
|
Method is used to specify the color of the object.
- Parameters
-
- Returns
- true if success, false otherwise.
Swift code snippet:
// Set polygon color
let colorSuccess = polygonMapObject.setColor(UIColor(red: 0.0, green: 1.0, blue: 0.0, alpha: 0.7))
print("Set polygon color to green with 70% opacity: \(colorSuccess)")
Objective C code snippet:
BOOL colorSuccess = [polygonObject
setColor:[UIColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:0.7]];
NSLog(@"Set polygon color to green with 70%% 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");
◆ setOrder:
| - (BOOL) setOrder: |
|
(int32_t) | order |
|
Method is used to specify the rendering order of the object.
- Parameters
-
| order | The rendering order value. Default: 0. |
- Returns
- true if success, false otherwise.
Swift code snippet:
// Set polygon rendering order
let orderSuccess = polygonMapObject.setOrder(2)
print("Set polygon rendering order to 2: \(orderSuccess)")
Objective C code snippet:
BOOL orderSuccess = [polygonObject
setOrder:2];
NSLog(@"Set polygon rendering order to 2: %@", orderSuccess ? @"YES" : @"NO");
◆ setOutlineAlpha:
| - (BOOL) setOutlineAlpha: |
|
(float) | alpha |
|
Method is used to specify the opacity of the polygon’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 polygon outline alpha
let outlineAlphaSuccess = polygonMapObject.setOutlineAlpha(0.8)
print("Set polygon outline alpha to 0.8: \(outlineAlphaSuccess)")
Objective C code snippet:
NSLog(@"Set polygon outline alpha to 0.8: %@", outlineAlphaSuccess ? @"YES" : @"NO");
◆ setOutlineColor:
| - (BOOL) setOutlineColor: |
|
(nonnull UIColor *) | color |
|
Method is used to specify the color of the polygon’s outline.
- Parameters
-
- Returns
- true if the operation is successful, false otherwise.
Swift code snippet:
// Set polygon outline color
let outlineColorSuccess = polygonMapObject.setOutlineColor(UIColor(red: 0.0, green: 0.0, blue: 1.0, alpha: 1.0))
print("Set polygon outline color to blue: \(outlineColorSuccess)")
Objective C code snippet:
BOOL outlineColorSuccess = [polygonObject
setOutlineColor:[UIColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0]];
NSLog(@"Set polygon outline color to blue: %@", outlineColorSuccess ? @"YES" : @"NO");
◆ setOutlineOrder:
| - (BOOL) setOutlineOrder: |
|
(int32_t) | order |
|
Method is used to specify the rendering order of the polygon’s outline.
- Parameters
-
| order | The rendering order value. Default: 0. |
- Returns
- true if the operation is successful, false otherwise.
Swift code snippet:
// Set polygon outline order
let outlineOrderSuccess = polygonMapObject.setOutlineOrder(1)
print("Set polygon outline order to 1: \(outlineOrderSuccess)")
Objective C code snippet:
NSLog(@"Set polygon outline order to 1: %@", outlineOrderSuccess ? @"YES" : @"NO");
◆ setOutlineWidth:
| - (BOOL) setOutlineWidth: |
|
(float) | width |
|
Method is used to specify the width of the polygon’s outline.
- Parameters
-
| width | Width of the outline in pixels. |
- Returns
- true if the operation is successful, false otherwise.
Swift code snippet:
// Set polygon outline width
let outlineWidthSuccess = polygonMapObject.setOutlineWidth(2.0)
print("Set polygon outline width to 2.0 pixels: \(outlineWidthSuccess)")
Objective C code snippet:
NSLog(@"Set polygon outline width to 2.0 pixels: %@", outlineWidthSuccess ? @"YES" : @"NO");
◆ setPolygon:
Method is used to specify the source polygon of the object.
- Parameters
-
- Returns
- true if success, false otherwise.
Swift code snippet:
// Set polygon geometry
let points = [
NCGlobalPoint(latitude: 50.0, longitude: 60.0),
NCGlobalPoint(latitude: 55.0, longitude: 65.0),
NCGlobalPoint(latitude: 60.0, longitude: 60.0),
NCGlobalPoint(latitude: 55.0, longitude: 55.0),
]
let polygon = NCLocationPolygon(points: points, sublocationId: 0)
let success = polygonMapObject.setPolygon(polygon)
print("Set polygon with \(points.count) points: \(success)")
Objective C code snippet:
NSArray<NCGlobalPoint *> *points = @[
];
NCLocationPolygon *polygon = [[
NCLocationPolygon alloc] initWithPoints:points sublocationId:@(0)];
BOOL success = [polygonObject
setPolygon:polygon];
NSLog(@"Set polygon with %lu points: %@", (unsigned long)points.count, success ? @"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");
◆ setTitleWithStyle:style:
| - (BOOL) setTitleWithStyle: |
|
(nonnull NSString *) | title |
| style: |
|
(nonnull NCTitleStyle *) | style |
Method is used to set the title and its style for the map object.
- Parameters
-
| title | The title to display on the location view. |
| style | Title style parameters TitleStyle. |
- Returns
- true if the operation is successful, false otherwise.
Swift code snippet:
// Set title with style
let titleStyleSuccess = circleMapObject.setTitleWithStyle("Styled Circle", style: titleStyle)
print("Set circle title with style: \(titleStyleSuccess)")
Objective C code snippet:
NSLog(@"Set circle title with style: %@", titleStyleSuccess ? @"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 149 of file NCPolygonMapObject.h.
The documentation for this class was generated from the following file: