latLngToPoint method

CustomPoint<double> latLngToPoint(
  1. LatLng latlng,
  2. double zoom
)

Converts a point on the sphere surface (with a certain zoom) in a map point.

Implementation

CustomPoint<double> latLngToPoint(LatLng latlng, double zoom) {
  try {
    final projectedPoint = projection.project(latlng);
    final scale = this.scale(zoom);
    return transformation.transform(projectedPoint, scale.toDouble());
  } catch (e) {
    return const CustomPoint(0, 0);
  }
}