viewport property

ViewportState? viewport
final

The initial camera position and behavior of the map.

Use viewport to specify how the camera is positioned when the map is first displayed. By providing a ViewportState subclass, you can control the camera's initial focus, such as centering on a specific location or following the user's position.

If viewport is not provided, the map uses its default camera settings.

Example:

MapWidget(
  viewport: CameraViewportState(
    center: Point(coordinates: Position(-117.918976, 33.812092)),
    zoom: 15.0,
  ),
);

Implementation

final ViewportState? viewport;