public class Projection extends 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(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
|
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()
public ProjectedMeters getProjectedMetersForLatLng(LatLng latLng)
public LatLng getLatLngForProjectedMeters(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.public LatLng fromScreenLocation(PointF point)
point
- A Point on the screen in screen pixels.public void fromScreenLocations(double[] input, double[] output)
input
- an array of input values representing screen coordinatesoutput
- an array of output values representing geographic locationspublic VisibleRegion getVisibleRegion()
This method ignores the content padding.
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(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).public PointF toScreenLocation(LatLng location)
location
- A LatLng on the map to convert to a screen location.public void toScreenLocations(double[] input, 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.© 2015–2019 Mapbox. All rights reserved.