centerOnRoutes method

void centerOnRoutes({
  1. List<Route>? routes,
  2. RouteDisplayMode displayMode = RouteDisplayMode.full,
  3. RectType<int>? screenRect,
  4. GemAnimation? animation,
})

Center on the given routes collection.

All routes from the list will be visible on the map. The zoom level is automatically selected.

Parameters

  • IN routesList Route list to be shown. If no routes are provided then centering is done on the visible routes from MapViewRoutesCollection.
  • IN displayMode Route display mode.
  • IN screenRect Screen viewport rectangle where routes 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 centerOnRoutes({
  final List<Route>? routes,
  final RouteDisplayMode displayMode = RouteDisplayMode.full,
  final RectType<int>? screenRect,
  final GemAnimation? animation,
}) {
  objectMethod(
    _pointerId,
    'MapView',
    'centerOnRoutes',
    args: <String, dynamic>{
      'routesList':
          (routes != null) ? RouteList.fromList(routes).pointerId : -1,
      'displayMode': displayMode.id,
      if (screenRect != null) 'viewRc': screenRect,
      if (animation != null) 'animation': animation,
    },
  );
}