resetMapSelection method
Resets the cursor to its default position at the viewport center.
Sets the cursor screen position to the center of the current viewport, clearing any previous cursor placement. This restores the default state where map centering operations target the viewport center.
This asynchronous method must be awaited to ensure the cursor update completes before subsequent operations.
See also:
- setCursorScreenPosition - Set cursor to a specific position
- viewportCenter - Current viewport center coordinates
- cursorScreenPosition - Current cursor position
Implementation
Future<void> resetMapSelection() async {
await setCursorScreenPosition(
Point<int>((viewport.width / 2).round(), (viewport.height / 2).round()),
);
}