offsetToCrs method
Calculate the LatLng
coordinates for a given Offset and an optional
zoom level. If zoom
is not provided the current zoom level of the
MapCamera gets used.
Implementation
LatLng offsetToCrs(Offset offset, [double? zoom]) {
final focalStartPt = project(center, zoom ?? this.zoom);
final point =
(offset.toPoint() - (nonRotatedSize / 2.0)).rotate(rotationRad);
final newCenterPt = focalStartPt + point;
return unproject(newCenterPt, zoom ?? this.zoom);
}