Skip to content

Commit b98cdd2

Browse files
committed
Adjusted default MapOptions.cameraConstraint to prevent out-of-bounds viewing
Updated CHANGELOG
1 parent dfbe59c commit b98cdd2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Contains the following user-affecting changes:
2424
- 🟡 Replaced `Marker.anchor` with `Marker.alignment` that uses built-in `Alignment` object - [#1659](https://github.com/fleaflet/flutter_map/pull/1659)
2525
- 🟡 Replaced `Marker.builder` with non-builder `Marker.child` - [#1659](https://github.com/fleaflet/flutter_map/pull/1659)
2626
- 🟡 Changed `TileLayer.retinaMode` behaviour - [#1673](https://github.com/fleaflet/flutter_map/pull/1673) for [#1670](https://github.com/fleaflet/flutter_map/issues/1670)
27+
- 🟡 Changed some default arguments, including `TileLayer.panBuffer` and `MapOptions.cameraConstraint` - multiple PRs
2728
- 🔴 Removed `CustomPoint` in favour of extension methods on `Point<T>` - [#1585](https://github.com/fleaflet/flutter_map/pull/1585) for [#1522](https://github.com/fleaflet/flutter_map/issues/1522)
2829
- 🔴 Removed `MoveAndRotateResult` in favour of a `Record` in format of `({bool moveSuccess, bool rotateSuccess})` - [#1636](https://github.com/fleaflet/flutter_map/pull/1636)
2930
- 🔴 Removed `Anchor`, `AnchorPos`, and all anchor related terminology - [#1659](https://github.com/fleaflet/flutter_map/pull/1659)

lib/src/map/options/options.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ class MapOptions {
308308
_cameraConstraint ??
309309
(maxBounds != null
310310
? CameraConstraint.contain(bounds: maxBounds!)
311-
: const CameraConstraint.unconstrained());
311+
: CameraConstraint.contain(
312+
bounds:
313+
LatLngBounds(const LatLng(-90, -180), const LatLng(90, 180)),
314+
));
312315

313316
@override
314317
bool operator ==(Object other) =>

0 commit comments

Comments
 (0)