zoomToAround method

MapPosition zoomToAround(
  1. double latitude,
  2. double longitude,
  3. int newZoomLevel
)

Zooms to a specific level around a given latitude and longitude.

Implementation

MapPosition zoomToAround(double latitude, double longitude, int newZoomLevel) {
  final clampedZoom = max(newZoomLevel, 0);
  return MapPosition._(
    latitude: latitude,
    longitude: longitude,
    zoomlevel: clampedZoom,
    indoorLevel: indoorLevel,
    rotation: _rotation,
    rotationRadian: _rotationRadian,
    scale: 1,
    focalPoint: null,
    projection: PixelProjection(clampedZoom),
  );
}