viewport property

ViewportState? viewport
final

The camera position and behavior of the map.

Use viewport to specify how the camera is positioned when the map is displayed. By providing a ViewportState subclass, you can control the camera's 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.

When a viewportController is provided, the controller's state takes precedence over viewport once ViewportController.moveTo has been called.

Implementation

final ViewportState? viewport;