Package it.tidalwave.mapviewer.spi
Class MercatorProjection
java.lang.Object
it.tidalwave.mapviewer.spi.MercatorProjection
- All Implemented Interfaces:
Projection
An implementation of the Mercator Projection.
- Author:
- Fabrizio Giudici
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncoordinatesToMapPoint
(MapCoordinates coordinates, double zoomLevel) Returns aMapPoint
converted from the given coordinates and zoom level.mapPointToCoordinates
(MapPoint mapPoint, double zoomLevel) ReturnsMapCoordinates
converted from the point coordinates and zoom level.final double
metersPerPixel
(MapCoordinates coordinates, double zoomLevel) Returns the map scale (expressed in meters per pixel) at the given zoom level.
-
Constructor Details
-
MercatorProjection
public MercatorProjection()
-
-
Method Details
-
coordinatesToMapPoint
@Nonnull public MapPoint coordinatesToMapPoint(@Nonnull MapCoordinates coordinates, double zoomLevel) Returns aMapPoint
converted from the given coordinates and zoom level..- Specified by:
coordinatesToMapPoint
in interfaceProjection
- Parameters:
coordinates
- the coordinates to convertzoomLevel
- the zoom level- Returns:
- a
MapPoint
converted from the given coordinates and zoom level
-
mapPointToCoordinates
ReturnsMapCoordinates
converted from the point coordinates and zoom level..- Specified by:
mapPointToCoordinates
in interfaceProjection
- Parameters:
mapPoint
- the pointzoomLevel
- the zoom level- Returns:
MapCoordinates
converted from the point coordinates and zoom level
-
metersPerPixel
Returns the map scale (expressed in meters per pixel) at the given zoom level..- Specified by:
metersPerPixel
in interfaceProjection
- Parameters:
coordinates
- coordinateszoomLevel
- the zoom level- Returns:
- the map scale (expressed in meters per pixel) at the given zoom level
-