Loading...
Searching...
No Matches

Class is used to handle for picking objects on the location view. More...

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

Inherits <NSObject>.

Instance Methods

(void) - onMapObjectPickComplete:screenPosition:
 Receive the result from LocationWindow pickMapObjectAt method.
 
(void) - onMapFeaturePickComplete:screenPosition:
 Receive the result from LocationWindow pickMapFeatureAt
 

Detailed Description

Class is used to handle for picking objects on the location view.

Referenced from LocationWindow.

Definition at line 21 of file NCPickListener.h.

Method Documentation

◆ onMapFeaturePickComplete:screenPosition:

- (void) onMapFeaturePickComplete: (nonnull NSDictionary< NSString *, NSString * > *) mapFeaturePickResult
screenPosition: (CGPoint) screenPosition 

Receive the result from LocationWindow pickMapFeatureAt

Parameters
mapFeaturePickResultdictionary of properties of the picked feature or nil if no objects was found.
screenPositionposition 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
mapObjectPickResultMapObjectPickResult instance or nil if no objects was found.
screenPositionposition 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) {
// [objc_MapObjectPickResult_getPoint]
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);
// [objc_MapObjectPickResult_getPoint]
// [objc_MapObjectPickResult_getMapObject]
NCMapObject *mapObject = mapObjectPickResult.mapObject;
NSLog(@" Object type: %@", NSStringFromClass([mapObject class]));
// [objc_MapObjectPickResult_getMapObject]
} 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: