fleaflet / flutter_map

A versatile mapping package for Flutter. Simple and easy to learn, yet completely customizable and configurable, it's the best choice for mapping in your Flutter app.
https://pub.dev/packages/flutter_map
BSD 3-Clause "New" or "Revised" License
2.68k stars 848 forks source link

[BUG] Constraint and Fit inside bound with same value causes Red Screen #1920

Closed IcyTempest closed 2 weeks ago

IcyTempest commented 2 weeks ago

What is the bug?

Give When giving CameraConstraint.contain and CameraFit.insideBounds the same LatLngBounds. It causes errors, MapCamera is no longer within the cameraConstraint after an option change. Older version is fine (6.1.0)

Flutter map: 7.0.1 Flutter: 3.22.2

How can we reproduce it?

This happen immediately after first rendering of the screen. No value changes need to trigger this error. Just the same Bounds vvalue to the fit inside bounds and cameraConstraint contain.

Do you have a potential solution?

A temporary solution I found after abit more testing is that I have to include a initialCenter LatLng that is somwhere inside the contain coordinate to not trigger the assert.

Platforms

Android 14 (Pixel 5)

Severity

Fatal: Causes the application to crash

JaffaKetchup commented 2 weeks ago

Hi @IcyTempest, Thanks for the report. This is a duplicate of #1760, but includes some more useful info.