mirror of
https://github.com/immich-app/immich.git
synced 2026-03-22 14:19:26 +03:00
maplibre is a ground-up rewrite of maplibre_gl with a more modern and ergonomic API. It should fix a few bugs we've seen with maps, and perform better.
24 lines
682 B
Dart
24 lines
682 B
Dart
import 'package:maplibre/maplibre.dart';
|
|
|
|
extension WithinBounds on LngLatBounds {
|
|
/// Checks whether [point] is inside bounds
|
|
bool contains(Geographic point) {
|
|
return containsBounds(
|
|
LngLatBounds(
|
|
longitudeWest: point.lon,
|
|
longitudeEast: point.lon,
|
|
latitudeSouth: point.lat,
|
|
latitudeNorth: point.lat,
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Checks whether [bounds] is contained inside bounds
|
|
bool containsBounds(LngLatBounds bounds) {
|
|
return (bounds.latitudeSouth >= latitudeSouth) &&
|
|
(bounds.latitudeNorth <= latitudeNorth) &&
|
|
(bounds.longitudeWest >= longitudeWest) &&
|
|
(bounds.longitudeEast <= longitudeEast);
|
|
}
|
|
}
|