centerOnRoute method

void centerOnRoute(
  1. Route route, {
  2. RectType<int>? screenRect,
  3. GemAnimation? animation,
})

Center on the given route.

The zoom level is automatically selected so that the entire route is visible on the map.

Parameters

  • IN route Route to be shown.
  • IN screenRect Screen rectangle where area should be centered. The coordinates are relative to view parent screen.
  • IN animation Specifies the animation to be used by the operation.

Throws

  • An exception if it fails.

Implementation

void centerOnRoute(
  final Route route, {
  final RectType<int>? screenRect,
  final GemAnimation? animation,
}) {
  objectMethod(
    _pointerId,
    'MapView',
    'centerOnRoute',
    args: <String, dynamic>{
      'route': route.pointerId,
      if (screenRect != null) 'rc': screenRect,
      if (animation != null) 'animation': animation,
    },
  );
}