public class TileCoordinateConverter extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private MapView |
mapView |
private TileSourceDisplaySettings |
settings |
private TileSource |
tileSource |
| Constructor and Description |
|---|
TileCoordinateConverter(MapView mapView,
TileSource tileSource,
TileSourceDisplaySettings settings)
Create a new coordinate converter for the map view.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.geom.Point2D |
getPixelForTile(int x,
int y,
int zoom)
Gets the top left position of the tile inside the map view.
|
java.awt.geom.Point2D |
getPixelForTile(Tile tile)
Gets the top left position of the tile inside the map view.
|
Projecting |
getProjecting()
Gets the projecting instance to use to convert between latlon and eastnorth coordinates.
|
java.awt.geom.Rectangle2D |
getRectangleForTile(Tile tile)
Gets the position of the tile inside the map view.
|
double |
getScaleFactor(int zoom)
Returns average number of screen pixels per tile pixel for current mapview
|
TileAnchor |
getScreenAnchorForTile(Tile tile)
Get
TileAnchor for a tile in screen pixel coordinates. |
TileXY |
getTileforPixel(int sx,
int sy,
int zoom)
Convert screen pixel coordinate to tile position at certain zoom level.
|
java.awt.Shape |
getTileShapeScreen(Tile tile)
Returns a shape that approximates the outline of the tile in screen coordinates.
|
private MapViewState.MapViewPoint |
pos(ICoordinate ll) |
private MapViewState.MapViewPoint |
pos(IProjected p) |
boolean |
requiresReprojection()
Return true if tiles need to be reprojected from server projection to display projection.
|
IProjected |
shiftDisplayToServer(EastNorth en)
Apply reverse shift to EastNorth coordinate.
|
private final TileSourceDisplaySettings settings
private final TileSource tileSource
public TileCoordinateConverter(MapView mapView, TileSource tileSource, TileSourceDisplaySettings settings)
mapView - The map view.tileSource - The tile source to use when converting coordinates.settings - displacement settings.java.lang.NullPointerException - if one argument is nullprivate MapViewState.MapViewPoint pos(ICoordinate ll)
private MapViewState.MapViewPoint pos(IProjected p)
public IProjected shiftDisplayToServer(EastNorth en)
en - EastNorth coordinate representing a pixel on screenpublic Projecting getProjecting()
Projecting instance.public java.awt.geom.Point2D getPixelForTile(int x, int y, int zoom)
x - x tile indexy - y tile indexzoom - zoom levelpublic java.awt.geom.Point2D getPixelForTile(Tile tile)
tile - The tilepublic TileXY getTileforPixel(int sx, int sy, int zoom)
sx - x coordinate (screen pixel)sy - y coordinate (screen pixel)zoom - zoom levelpublic java.awt.geom.Rectangle2D getRectangleForTile(Tile tile)
tile - The tilepublic java.awt.Shape getTileShapeScreen(Tile tile)
tile - the tilepublic double getScaleFactor(int zoom)
zoom - zoom levelpublic TileAnchor getScreenAnchorForTile(Tile tile)
TileAnchor for a tile in screen pixel coordinates.tile - the tilepublic boolean requiresReprojection()