latlngToPoint method

  1. @override
UPoint latlngToPoint(
  1. LatLng? position,
  2. double? zoom
)
override

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

Implementation

@override
UPoint latlngToPoint(LatLng? position, double? zoom) {
  try {
    UPoint projectedPoint = projection.project(position);
    double? scale = this.scale(zoom);
    Transformation transformation = _getTransformationByZoom(zoom);

    return transformation.transform(projectedPoint, scale);
  } catch (e) {
    return const UPoint(0.0, 0.0);
  }
}