Class is used to handle for picking objects on the location view.
More...
#include <com/navigine/idl/objc/NCPickListener.h>
Inherits <NSObject>.
Class is used to handle for picking objects on the location view.
Referenced from LocationWindow.
Definition at line 21 of file NCPickListener.h.
◆ onMapFeaturePickComplete:screenPosition:
| - (void) onMapFeaturePickComplete: |
|
(nonnull NSDictionary< NSString *, NSString * > *) | mapFeaturePickResult |
| screenPosition: |
|
(CGPoint) | screenPosition |
Receive the result from LocationWindow pickMapFeatureAt
- Parameters
-
| mapFeaturePickResult | dictionary of properties of the picked feature or nil if no objects was found. |
| screenPosition | position where the object was picked in pixels. |
Swift code snippet:
func onMapFeaturePickComplete(mapFeaturePickResult: [String: String]?, screenPosition: NCPoint) {
if let result = mapFeaturePickResult {
print("Map feature picked at screen position (\(screenPosition.x), \(screenPosition.y))")
print(" Feature properties: \(result)")
} else {
print("No map feature found at screen position (\(screenPosition.x), \(screenPosition.y))")
}
}
Objective C code snippet:
- (void)onMapFeaturePickCompleteWithMapFeaturePickResult:(NSDictionary<NSString *, NSString *> *)mapFeaturePickResult screenPosition:(NCPoint *)screenPosition {
if (mapFeaturePickResult != nil) {
NSLog(
@"Map feature picked at screen position (%.1f, %.1f)", screenPosition.
x, screenPosition.
y);
NSLog(@" Feature properties: %@", mapFeaturePickResult);
} else {
NSLog(
@"No map feature found at screen position (%.1f, %.1f)", screenPosition.
x, screenPosition.
y);
}
}
◆ onMapObjectPickComplete:screenPosition:
| - (void) onMapObjectPickComplete: |
|
(nullable NCMapObjectPickResult *) | mapObjectPickResult |
| screenPosition: |
|
(CGPoint) | screenPosition |
Receive the result from LocationWindow pickMapObjectAt method.
- Parameters
-
| mapObjectPickResult | MapObjectPickResult instance or nil if no objects was found. |
| screenPosition | position where the object was picked in pixels. |
Swift code snippet:
func onMapObjectPickComplete(mapObjectPickResult: NCMapObjectPickResult?, screenPosition: NCPoint) {
if let result = mapObjectPickResult {
// [swift_MapObjectPickResult_getPoint]
let point = result.point
print("Map object picked at screen position (\(screenPosition.x), \(screenPosition.y))")
print(" Object location: (\(point.x), \(point.y))")
// [swift_MapObjectPickResult_getPoint]
// [swift_MapObjectPickResult_getMapObject]
let mapObject = result.mapObject
print(" Object type: \(type(of: mapObject))")
// [swift_MapObjectPickResult_getMapObject]
} else {
print("No map object found at screen position (\(screenPosition.x), \(screenPosition.y))")
}
}
Objective C code snippet:
- (void)onMapObjectPickCompleteWithMapObjectPickResult:(NCMapObjectPickResult *)mapObjectPickResult screenPosition:(NCPoint *)screenPosition {
if (mapObjectPickResult != nil) {
NCLocationPoint *point = mapObjectPickResult.
point;
NSLog(
@"Map object picked at screen position (%.1f, %.1f)", screenPosition.
x, screenPosition.
y);
NSLog(@" Object location: (%.1f, %.1f)", point.x, point.y);
NCMapObject *mapObject = mapObjectPickResult.
mapObject;
NSLog(@" Object type: %@", NSStringFromClass([mapObject class]));
} else {
NSLog(
@"No map object found at screen position (%.1f, %.1f)", screenPosition.
x, screenPosition.
y);
}
}
The documentation for this protocol was generated from the following file: