public class Projection
extends java.lang.Object
Modifier and Type | Method | 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.
|
void |
fromScreenLocations(double[] input,
double[] output) |
Returns the geographic locations that corresponds to screen locations.
|
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.
|
void |
getVisibleCoordinateBounds(double[] bounds) |
Gets a projection of the viewing frustum for converting between screen coordinates and
geo-latitude/longitude coordinate bounds.
|
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() |
Deprecated.
unused
|
android.graphics.PointF |
toScreenLocation(LatLng location) |
Returns a screen location that corresponds to a geographical coordinate (LatLng).
|
void |
toScreenLocations(double[] input,
double[] output) |
Returns a screen locations that corresponds to a geographical coordinates.
|
@Deprecated 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.public void fromScreenLocations(@NonNull double[] input, @NonNull double[] output)
input
- an array of input values representing screen coordinatesoutput
- an array of output values representing geographic locations@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.public void getVisibleCoordinateBounds(@NonNull double[] bounds)
This method ignores the content padding.
bounds
- an array of 4 output values representing bounds(in the order of latNorth,
lonEast, latSouth, lonWest).@NonNull public android.graphics.PointF toScreenLocation(@NonNull LatLng location)
location
- A LatLng on the map to convert to a screen location.public void toScreenLocations(@NonNull double[] input, @NonNull double[] output)
input
- an array of input values representing geographic locationsoutput
- an array of output values representing screen coordinatespublic double calculateZoom(float minScale)
minScale
- The minimum scale to calculate the zoom level.