centerOnMapRoutes method
- RouteDisplayMode? displayMode,
- Rectangle<
int> ? screenRect, - GemAnimation? animation,
Centers the map on all routes currently visible in the MapViewRoutesCollection.
Positions the map to display all routes that are currently marked as visible, automatically selecting the optimal zoom level to fit all visible route paths within the target screen rectangle. This is useful for showing all active routes without needing to specify each route explicitly.
Parameters
displayMode: Controls how routes are displayed (full paths, partial segments, etc.). Ifnull, uses default display mode. Defaults tonullscreenRect: Target screen rectangle in physical pixels where routes should fit, relative to the map view's top-left corner. Ifnull, uses the entire viewport. Defaults tonull. Useful for fitting within UI elements or adding marginsanimation: Animation settings for the centering operation. Ifnull, centering occurs instantly. Defaults tonull
See also:
- centerOnRoutes - Center on a specific list of routes
- centerOnRoute - Center on a single route
Implementation
void centerOnMapRoutes({
final RouteDisplayMode? displayMode,
final Rectangle<int>? screenRect,
final GemAnimation? animation,
}) {
objectMethod(
_pointerId,
'MapView',
'centerOnRoutes',
args: <String, Object>{
'routesList': -1,
if (displayMode != null) 'displayMode': displayMode.id,
if (screenRect != null)
'viewRc': RectType<int>.fromRectangle(screenRect),
if (animation != null) 'animation': animation,
},
);
}