setCursorScreenPosition method
Set the cursor screen position.
Use this function to trigger a map view selection (POI, landmark, overlay, route, path, marker) at the given screen coordinates. The current view selection can be queried via cursorSelectionRoutes, cursorSelectionLandmarks, cursorSelectionStreets, cursorSelectionOverlayItems, cursorSelectionMarkers methods.
This method needs to be awaited.
Parameters
- IN screenPosition position relative to the parent screen. The coordinates are relative to the parent view screen
Throws
- An exception if it fails.
Implementation
Future<void> setCursorScreenPosition(final Point<int> screenPosition) async {
// This method needs to be async
await GemKitPlatform.instance.getChannel(mapId: mapId).invokeMethod<String>(
'callObjectMethod',
jsonEncode(<String, dynamic>{
'id': _pointerId,
'class': 'MapView',
'method': 'setCursorScreenPosition',
'args': XyType<int>(x: screenPosition.x, y: screenPosition.y),
}),
);
}