-
public interface IProjectionAn interface that resembles the Google Maps API Projection interface and is implemented by the osmdroid org.osmdroid.views.Projection class.
-
-
Method Summary
Modifier and Type Method Description abstract PointtoPixels(IGeoPoint in, Point out)Converts the given IGeoPoint to onscreen pixel coordinates, relative to the top-leftof the org.osmdroid.views.MapView that provided this Projection. abstract IGeoPointfromPixels(int x, int y)Create a new GeoPoint from pixel coordinates relative to the top-left of the MapView thatprovided this PixelConverter. abstract floatmetersToEquatorPixels(float meters)Converts a distance in meters (along the equator) to one in (horizontal) pixels at thecurrent zoomlevel. abstract IGeoPointgetNorthEast()Get the coordinates of the most north-easterly visible point of the map. abstract IGeoPointgetSouthWest()Get the coordinates of the most south-westerly visible point of the map. -
-
Method Detail
-
toPixels
abstract Point toPixels(IGeoPoint in, Point out)
Converts the given IGeoPoint to onscreen pixel coordinates, relative to the top-leftof the org.osmdroid.views.MapView that provided this Projection.
- Parameters:
in- The latitude/longitude pair to convert.out- A pre-existing object to use for the output; if null, a new Point will beallocated and returned.
-
fromPixels
abstract IGeoPoint fromPixels(int x, int y)
Create a new GeoPoint from pixel coordinates relative to the top-left of the MapView thatprovided this PixelConverter.
-
metersToEquatorPixels
abstract float metersToEquatorPixels(float meters)
Converts a distance in meters (along the equator) to one in (horizontal) pixels at thecurrent zoomlevel. In the default Mercator projection, the actual number of pixels for agiven distance will get higher as you move away from the equator.
- Parameters:
meters- the distance in meters
-
getNorthEast
abstract IGeoPoint getNorthEast()
Get the coordinates of the most north-easterly visible point of the map.
-
getSouthWest
abstract IGeoPoint getSouthWest()
Get the coordinates of the most south-westerly visible point of the map.
-
-
-
-