setSlippyZoomLevel method
Sets the map zoom level using slippy tile-based zoom scale.
Changes the zoom level based on the standard web map tile system (slippy tiles) where each level represents a doubling of map resolution. The zoom level must be between 0 and maxSlippyZoomLevel.
The reference point for zooming depends on the current state: when follow position mode is active, uses the tracked position; otherwise uses the specified screen position or screen center if none is provided.
Parameters
zoomLevel: Target slippy tile zoom level, must be between 0 and maxSlippyZoomLevelduration: Animation duration in milliseconds. Use0for instant zoom. Defaults to0screenPosition: Screen coordinates in physical pixels that should remain fixed during zoom, relative to the map view's top-left corner. Ifnull, uses screen center (or tracked position if follow mode is active). Defaults tonull
Returns
- The previous slippy zoom level
See also:
- slippyZoomLevel - Get the current slippy tile zoom level
- setZoomLevel - Set zoom using standard zoom level
- maxSlippyZoomLevel - Get maximum slippy tile zoom level
Implementation
double setSlippyZoomLevel(
final double zoomLevel, {
final int duration = 0,
final Point<int>? screenPosition,
}) {
final OperationResult resultString = objectMethod(
_pointerId,
'MapView',
'setSlippyZoomLevel',
args: <String, Object>{
'zoomLevel': zoomLevel,
'duration': duration,
if (screenPosition != null) 'xy': XyType<int>.fromPoint(screenPosition),
},
);
return resultString['result'];
}