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 double
static 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.int
Returns 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:
getZoomLevel
in interfaceProjection
- Returns:
- the zoom level
-
getAddress
Returns the address of a Tile containing the provided point.- Specified by:
getAddress
in 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:
getPixelAddress
in 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:
getGeoPosition
in interfaceProjection
- Parameters:
x
- the X coordinatey
- the Y coordinate- Returns:
- a GeoLocation
-