invert method

  1. @override
(double, double) invert(
  1. double x,
  2. double y
)
override

Inverts screen coordinates to geographic longitude, latitude.

Implementation

@override
(double, double) invert(double x, double y) {
  final (rawX, rawY) = removeTransform(x, y);
  final cosLat0 = math.cos(toRadians(centerLat));

  final longitude = toDegrees(rawX / cosLat0) + centerLon;
  final latitude = toDegrees(-rawY);

  return (clampLongitude(longitude), clampLatitude(latitude));
}