Skip to content

[BUG] Exception "MapCamera is no longer within the cameraConstraint after an option change" when using particular camera setups #1760

@dumabg

Description

@dumabg

Current recommended workaround:
Ensure initialCenter and initialZoom are configured in such a way that, if cameraConstraint & initialCameraFit were undefined, the map view would fit inside the desired camera constraint & fit.


What is the bug?

A FlutterMap with a cameraConstraint CameraConstraint.contain(bounds: widget.bounds) gives the assert error "MapCamera is no longer within the cameraConstraint after an option change"

How can we reproduce it?

Put a ValueListenableBuilder and a FlutterMap with a cameraConstraint. Change the ValueListenableBuilder value to trigger a new repaint.

Do you have a potential solution?

I've comment the assert and seems that it works

Platforms

Android

Severity

Erroneous: Prevents normal functioning and causes errors in the console

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions