canShowPosition method

  1. @override
Future<bool> canShowPosition(
  1. int zoomLevel,
  2. List<LatLng> position
)
override

Implementation

@override
Future<bool> canShowPosition(int zoomLevel, List<LatLng> position) async {
  final bound = controller.getBounds();
  final ne = bound.getNorthEast();
  final sw = bound.getSouthWest();
  return !position.any((point) =>
      point.latitude > ne.getLat() ||
      point.latitude < sw.getLat() ||
      point.longitude > ne.getLng() ||
      point.longitude < sw.getLng());
}