getOptimalHighlightCenterViewport method

RectType<int> getOptimalHighlightCenterViewport({
  1. RectType<int>? screenRect,
})

Gets the optimal highlight center viewport given the user custom input.

The returned viewport is adjusted so all highlight information will be visible

The user can use this as the input to centerOnArea

Parameters

  • IN routes Route list to be shown.
  • IN screenRect viewport rectangle where highlight should be centered. If empty, the whole viewport will be used.

Returns

  • The adjusted viewport. The coordinates are relative to view parent screen

Throws

  • An exception if it fails.

Implementation

RectType<int> getOptimalHighlightCenterViewport({
  RectType<int>? screenRect,
}) {
  screenRect ??= RectType<int>(x: 0, y: 0, width: 0, height: 0);

  final OperationResult resultString = objectMethod(
    _pointerId,
    'MapView',
    'getOptimalHighlightCenterViewport',
    args: screenRect,
  );

  return RectType<int>.fromJson(resultString['result']);
}