Loading...
Searching...
No Matches
PickListener Class Referenceabstract

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

Public Member Functions

void onMapObjectPickComplete (MapObjectPickResult mapObjectPickResult, math.Point< double > screenPosition)
 Receive the result from LocationWindow pickMapObjectAt method.
 
void onMapFeaturePickComplete (Map< String, String > mapFeaturePickResult, math.Point< double > 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 25 of file pick_listener.dart.

Member Function Documentation

◆ onMapFeaturePickComplete()

void PickListener.onMapFeaturePickComplete ( Map< String, String > mapFeaturePickResult,
math.Point< double > 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.

Dart code snippet:

@override
void onMapFeaturePickComplete(Map<String, String>? mapFeaturePickResult, math.Point<double> screenPosition) {
if (mapFeaturePickResult != null) {
print("Map feature picked at screen position (${screenPosition.x}, ${screenPosition.y})");
print(" Feature properties: $mapFeaturePickResult");
} else {
print("No map feature found at screen position (${screenPosition.x}, ${screenPosition.y})");
}
}

◆ onMapObjectPickComplete()

void PickListener.onMapObjectPickComplete ( MapObjectPickResult mapObjectPickResult,
math.Point< double > 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.

Dart code snippet:

@override
void onMapObjectPickComplete(MapObjectPickResult? mapObjectPickResult, math.Point<double> screenPosition) {
if (mapObjectPickResult != null) {
// [dart_MapObjectPickResult_getPoint]
LocationPoint point = mapObjectPickResult.point;
print("Map object picked at screen position (${screenPosition.x}, ${screenPosition.y})");
print(" Object location: (${point.x}, ${point.y})");
// [dart_MapObjectPickResult_getPoint]
// [dart_MapObjectPickResult_getMapObject]
MapObject mapObject = mapObjectPickResult.mapObject;
print(" Object type: ${mapObject.runtimeType}");
// [dart_MapObjectPickResult_getMapObject]
} else {
print("No map object found at screen position (${screenPosition.x}, ${screenPosition.y})");
}
}

The documentation for this class was generated from the following file: