focusViewport property

Rectangle<int> get focusViewport

Get the map view focus viewport.

The focus viewport is the portion of the view that contains the maximum map details. Coordinates are relative to the view's parent screen. The default value is the entire view viewport.

Returns

The focus viewport as a Rectangle<int>.

Implementation

Rectangle<int> get focusViewport {
  final OperationResult resultString = objectMethod(
    _pointerId,
    'MapViewPreferences',
    'getFocusViewport',
    dependencyId: _mapPointerId,
  );

  final Rectangle<int> rect = Rectangle<int>(
    resultString['result']['x'] ?? 0,
    resultString['result']['y'] ?? 0,
    resultString['result']['width'] ?? 0,
    resultString['result']['height'] ?? 0,
  );

  return rect;
}
set focusViewport (Rectangle<int> view)

Set the map view focus viewport.

The focus viewport defines the screen region where the SDK should prioritize rendering maximum map detail. Coordinates are relative to the view's parent screen. This is useful when part of your UI overlays the map—set the focus viewport to the visible area to ensure optimal detail there. If view is an empty viewport, the focus resets to the whole view.

Parameters

  • view: (Rectangle<int>) The focus viewport rectangle.

See also:

Implementation

set focusViewport(final Rectangle<int> view) {
  objectMethod(
    _pointerId,
    'MapViewPreferences',
    'setFocusViewport',
    args: RectType<int>.fromRectangle(view),
    dependencyId: _mapPointerId,
  );
}