latLngToOffset method

  1. @override
Offset latLngToOffset(
  1. LatLng latlng,
  2. double zoom
)
override

Similar to latLngToXY but converts the XY coordinates to an Offset.

Implementation

@override
Offset latLngToOffset(LatLng latlng, double zoom) {
  final (x, y) = _transformation.transform(
    SphericalMercator.projectLng(latlng.longitude),
    SphericalMercator.projectLat(latlng.latitude),
    scale(zoom),
  );
  return Offset(x, y);
}