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.
|
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.
|
void |
invalidateContentPadding(int[] userLocationViewPadding) |
PointF |
toScreenLocation(LatLng location)
Returns a screen location that corresponds to a geographical coordinate (LatLng).
|
public void invalidateContentPadding(int[] userLocationViewPadding)
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 VisibleRegion getVisibleRegion()
public PointF toScreenLocation(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.© 2015–2017 Mapbox. All rights reserved.