public class Projection
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
double |
calculateZoom(float minScale)
Calculates a zoom level based on minimum scale and current scale from MapView
|
LatLng |
fromScreenLocation(android.graphics.PointF point)
Returns the geographic location that corresponds to a screen location.
|
LatLng |
getLatLngForProjectedMeters(ProjectedMeters projectedMeters)
Returns the LatLng for a spherical Mercator projected meters.
|
double |
getMetersPerPixelAtLatitude(double latitude)
Returns the distance spanned by one pixel at the specified latitude and current zoom level.
|
ProjectedMeters |
getProjectedMetersForLatLng(LatLng latLng)
Returns the spherical Mercator projected meters for a LatLng.
|
VisibleRegion |
getVisibleRegion()
Gets a projection of the viewing frustum for converting between screen coordinates and
geo-latitude/longitude coordinates.
|
VisibleRegion |
getVisibleRegion(boolean ignorePadding)
Gets a projection of the viewing frustum for converting between screen coordinates and
geo-latitude/longitude coordinates.
|
void |
invalidateContentPadding() |
android.graphics.PointF |
toScreenLocation(LatLng location)
Returns a screen location that corresponds to a geographical coordinate (LatLng).
|
public void invalidateContentPadding()
@NonNull public ProjectedMeters getProjectedMetersForLatLng(@NonNull LatLng latLng)
@NonNull public LatLng getLatLngForProjectedMeters(@NonNull ProjectedMeters projectedMeters)
public double getMetersPerPixelAtLatitude(double latitude)
Returns the distance spanned by one pixel at the specified latitude and current zoom level.
The distance between pixels decreases as the latitude approaches the poles. This relationship parallels the relationship between longitudinal coordinates at different latitudes.latitude
- The latitude for which to return the value.@NonNull public LatLng fromScreenLocation(@NonNull android.graphics.PointF point)
point
- A Point on the screen in screen pixels.@NonNull public VisibleRegion getVisibleRegion()
This method ignores the content padding.
@NonNull public VisibleRegion getVisibleRegion(boolean ignorePadding)
ignorePadding
- True if the padding should be ignored,
false if the returned region should be reduced by the padding.@NonNull public android.graphics.PointF toScreenLocation(@NonNull LatLng location)
location
- A LatLng on the map to convert to a screen location.public double calculateZoom(float minScale)
minScale
- The minimum scale to calculate the zoom level.