latLngToPoint method

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

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

Implementation

@override
CustomPoint latLngToPoint(LatLng latlng, double zoom) {
  try {
    var projectedPoint = projection.project(latlng);
    var scale = this.scale(zoom);
    var transformation = _getTransformationByZoom(zoom);

    return transformation.transform(projectedPoint, scale.toDouble());
  } catch (e) {
    return CustomPoint(0.0, 0.0);
  }
}