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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncoordinatesToMapPoint(MapCoordinates coordinates, double zoomLevel) Returns aMapPointconverted from the given coordinates and zoom level.mapPointToCoordinates(MapPoint mapPoint, double zoomLevel) ReturnsMapCoordinatesconverted from the point coordinates and zoom level.final doublemetersPerPixel(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 aMapPointconverted from the given coordinates and zoom level..- Specified by:
coordinatesToMapPointin interfaceProjection- Parameters:
coordinates- the coordinates to convertzoomLevel- the zoom level- Returns:
- a
MapPointconverted from the given coordinates and zoom level
-
mapPointToCoordinates
ReturnsMapCoordinatesconverted from the point coordinates and zoom level..- Specified by:
mapPointToCoordinatesin interfaceProjection- Parameters:
mapPoint- the pointzoomLevel- the zoom level- Returns:
MapCoordinatesconverted from the point coordinates and zoom level
-
metersPerPixel
Returns the map scale (expressed in meters per pixel) at the given zoom level..- Specified by:
metersPerPixelin interfaceProjection- Parameters:
coordinates- coordinateszoomLevel- the zoom level- Returns:
- the map scale (expressed in meters per pixel) at the given zoom level
-