wrapLatLng method

  1. @override
LatLng wrapLatLng(
  1. LatLng latlng
)
override

Returns a LatLng where lat and lng has been wrapped according to the CRS's wrapLat and wrapLng properties, if they are outside the CRS's bounds.

Implementation

@override
LatLng wrapLatLng(LatLng latlng) {
  double? latitude = projection != null && projection!.hasLatBounds
      ? projection!.wrapLat(latlng.lat)
      : latlng.lat;

  double? longitude = projection != null && projection!.hasLngBounds
      ? projection!.wrapLng(latlng.lng)
      : latlng.lng;

  return LatLng(latitude, longitude);
}