public class Projection extends Object implements IProjection, MapViewConstants
Modifier and Type | Field and Description |
---|---|
protected float |
mMultiTouchScale |
protected int |
mOffsetX |
protected int |
mOffsetY |
ANIMATION_DURATION_DEFAULT, ANIMATION_DURATION_LONG, ANIMATION_DURATION_SHORT, ANIMATION_SMOOTHNESS_DEFAULT, ANIMATION_SMOOTHNESS_HIGH, ANIMATION_SMOOTHNESS_LOW, DEBUGMODE, MAXIMUM_ZOOMLEVEL, MINIMUM_ZOOMLEVEL, NOT_SET
Constructor and Description |
---|
Projection(MapView mapView) |
Modifier and Type | Method and Description |
---|---|
protected Point |
adjustForDateLine(int x,
int y,
Point reuse) |
void |
detach() |
IGeoPoint |
fromPixels(int x,
int y)
Create a new GeoPoint from pixel coordinates relative to the top-left of the MapView that
provided this PixelConverter.
|
IGeoPoint |
fromPixels(int x,
int y,
GeoPoint reuse) |
IGeoPoint |
fromPixelsRotationSensitive(int x,
int y,
GeoPoint reuse) |
BoundingBox |
getBoundingBox() |
BoundingBoxE6 |
getBoundingBoxE6()
Deprecated.
|
Rect |
getIntrinsicScreenRect() |
Matrix |
getInvertedScaleRotateCanvasMatrix()
This will provide a Matrix that will revert the current map's scaling and rotation.
|
float |
getMapOrientation() |
IGeoPoint |
getNorthEast()
Get the coordinates of the most north-easterly visible point of the map.
|
Rect |
getScreenRect() |
IGeoPoint |
getSouthWest()
Get the coordinates of the most south-westerly visible point of the map.
|
int |
getZoomLevel() |
float |
metersToEquatorPixels(float meters)
Converts a distance in meters (along the equator) to one in (horizontal) pixels at the
current zoomlevel.
|
float |
metersToPixels(float meters)
Converts a distance in meters to one in (horizontal) pixels at the current zoomlevel and at
the current latitude at the center of the screen.
|
Point |
rotateAndScalePoint(int x,
int y,
Point reuse)
This will apply the current map's scaling and rotation for a point.
|
Point |
toMercatorPixels(int x,
int y,
Point reuse) |
Point |
toPixels(IGeoPoint in,
Point reuse)
|
Point |
toPixelsFromMercator(int x,
int y,
Point reuse) |
Point |
toPixelsFromProjected(Point in,
Point reuse)
Performs the second computationally light part of the projection.
|
Point |
toProjectedPixels(double latitude,
double longitude,
Point reuse)
Performs only the first computationally heavy part of the projection.
|
Point |
toProjectedPixels(GeoPoint geoPoint,
Point reuse)
A wrapper for
toProjectedPixels(int, int, Point) |
Point |
toProjectedPixels(int latituteE6,
int longitudeE6,
Point reuse)
Performs only the first computationally heavy part of the projection.
|
Point |
unrotateAndScalePoint(int x,
int y,
Point reuse)
This will revert the current map's scaling and rotation for a point.
|
protected final int mOffsetX
protected final int mOffsetY
protected final float mMultiTouchScale
Projection(MapView mapView)
public int getZoomLevel()
public BoundingBox getBoundingBox()
@Deprecated public BoundingBoxE6 getBoundingBoxE6()
public Rect getScreenRect()
public Rect getIntrinsicScreenRect()
public float getMapOrientation()
public IGeoPoint fromPixels(int x, int y)
IProjection
fromPixels
in interface IProjection
public IGeoPoint fromPixelsRotationSensitive(int x, int y, GeoPoint reuse)
public Point toPixels(IGeoPoint in, Point reuse)
IProjection
IGeoPoint
to onscreen pixel coordinates, relative to the top-left
of the MapView
that provided this Projection.toPixels
in interface IProjection
in
- The latitude/longitude pair to convert.reuse
- A pre-existing object to use for the output; if null, a new Point will be
allocated and returned.protected Point adjustForDateLine(int x, int y, Point reuse)
public Point toProjectedPixels(GeoPoint geoPoint, Point reuse)
toProjectedPixels(int, int, Point)
public Point toProjectedPixels(int latituteE6, int longitudeE6, Point reuse)
toPixelsFromProjected(Point, Point)
to get the final position.latituteE6
- the latitute of the pointlongitudeE6
- the longitude of the pointreuse
- just pass null if you do not have a Point to be 'recycled'.public Point toProjectedPixels(double latitude, double longitude, Point reuse)
toPixelsFromProjected(Point, Point)
to get the final position.latitude
- the latitute of the pointlongitude
- the longitude of the pointreuse
- just pass null if you do not have a Point to be 'recycled'.public Point toPixelsFromProjected(Point in, Point reuse)
in
- the Point calculated by the toProjectedPixels(int, int, Point)
reuse
- just pass null if you do not have a Point to be 'recycled'.toProjectedPixels(int, int, Point)
.public Point toPixelsFromMercator(int x, int y, Point reuse)
public Point toMercatorPixels(int x, int y, Point reuse)
public float metersToEquatorPixels(float meters)
IProjection
metersToEquatorPixels
in interface IProjection
meters
- the distance in meterspublic float metersToPixels(float meters)
meters
- the distance in meterspublic IGeoPoint getNorthEast()
IProjection
getNorthEast
in interface IProjection
public IGeoPoint getSouthWest()
IProjection
getSouthWest
in interface IProjection
public Matrix getInvertedScaleRotateCanvasMatrix()
public Point unrotateAndScalePoint(int x, int y, Point reuse)
public Point rotateAndScalePoint(int x, int y, Point reuse)
public void detach()