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 longitude = toDegrees(rawX) + centerLon;
  final latitude = toDegrees(2 * math.atan(math.exp(-rawY)) - math.pi / 2);

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