Class MercatorProjection
java.lang.Object
org.deltava.util.tile.MercatorProjection
- All Implemented Interfaces:
Projection
A utility class for translating canvas coordinates to latitude and longitude using the Microsoft Virtual
Earth and Google Maps modified Mercator projection.
- Since:
- 5.0
- Version:
- 7.0
- Author:
- Luke
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doublestatic final double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAddress(GeoLocation loc) Returns the address of a Tile containing the provided point.getGeoPosition(int x, int y) Returns the latitude/longitude of a pixel on the global canvas.Returns the pixel address of the provided point on the global canvas.intReturns the zoom level.
-
Field Details
-
MAX_LATITUDE
public static final double MAX_LATITUDE- See Also:
-
MIN_LATITUDE
public static final double MIN_LATITUDE- See Also:
-
-
Constructor Details
-
MercatorProjection
public MercatorProjection(int zoom) Initializes the projection.- Parameters:
zoom- the zoom level
-
-
Method Details
-
getZoomLevel
public int getZoomLevel()Returns the zoom level.- Specified by:
getZoomLevelin interfaceProjection- Returns:
- the zoom level
-
getAddress
Returns the address of a Tile containing the provided point.- Specified by:
getAddressin interfaceProjection- Parameters:
loc- the GeoLocation- Returns:
- the TileAddress of the Tile containing this point at the current zoom level
-
getPixelAddress
Returns the pixel address of the provided point on the global canvas.- Specified by:
getPixelAddressin interfaceProjection- Parameters:
loc- the GeoLocation- Returns:
- a Point with the pixel coordinates
-
getGeoPosition
Returns the latitude/longitude of a pixel on the global canvas.- Specified by:
getGeoPositionin interfaceProjection- Parameters:
x- the X coordinatey- the Y coordinate- Returns:
- a GeoLocation
-