cursorScreenPosition property

Point<int> get cursorScreenPosition

Retrieves the cursor's current position in screen coordinates.

Returns a Point<int> representing the cursor's position in physical pixels, measured relative to the map view's top-left corner (parent screen coordinates). By default, the cursor is positioned at the center of the viewport (viewportCenter).

The cursor position determines the reference point for map selection operations. When calling selection methods like cursorSelectionLandmarks, cursorSelectionRoutes, or cursorSelectionMarkers, the SDK identifies map elements at the cursor's location. Update the cursor position using setCursorScreenPosition before performing selections.

The cursor position also affects centering operations. When centerOnCoordinates or similar methods are called without a screenPosition parameter, the map centers the target coordinates at the cursor's current position.

See also:

Implementation

Point<int> get cursorScreenPosition {
  final OperationResult val = objectMethod(
    _pointerId,
    'MapView',
    'getCursorScreenPosition',
  );
  final XyType<int> retVal = XyType<int>.fromJson(val['result']);
  return retVal.toPoint();
}