public class Tile
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
long |
mapSize
the map size implied by zoom level and tileSize, to avoid multiple computations.
|
int |
tileSize |
int |
tileX
The X number of this tile.
|
int |
tileY
The Y number of this tile.
|
byte |
zoomLevel
The zoom level of this tile.
|
Constructor and Description |
---|
Tile(int tileX,
int tileY,
byte zoomLevel,
int tileSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
Tile |
getAbove()
Returns the tile above this tile.
|
Tile |
getAboveLeft()
Returns the tile above left
|
Tile |
getAboveRight()
Returns the tile above right
|
Tile |
getBelow()
Returns the tile below this tile.
|
Tile |
getBelowLeft()
Returns the tile below left
|
Tile |
getBelowRight()
Returns the tile below right
|
Rectangle |
getBoundaryAbsolute()
Extend of this tile in absolute coordinates.
|
static Rectangle |
getBoundaryAbsolute(Tile upperLeft,
Tile lowerRight)
Extend of the area defined by the two tiles in absolute coordinates.
|
Rectangle |
getBoundaryRelative()
Extend of this tile in relative (tile) coordinates.
|
BoundingBox |
getBoundingBox()
Gets the geographic extend of this Tile as a BoundingBox.
|
static BoundingBox |
getBoundingBox(Tile upperLeft,
Tile lowerRight)
Return the BoundingBox of a rectangle of tiles defined by upper left and lower right tile.
|
Tile |
getLeft()
Returns the tile to the left of this tile.
|
static int |
getMaxTileNumber(byte zoomLevel) |
java.util.Set<Tile> |
getNeighbours()
Returns a set of the eight neighbours of this tile.
|
Point |
getOrigin()
Returns the top-left point of this tile in absolute coordinates.
|
Tile |
getParent() |
Tile |
getRight()
Returns the tile to the right of this tile.
|
int |
getShiftX(Tile otherTile) |
int |
getShiftY(Tile otherTile) |
int |
hashCode() |
static boolean |
tileAreasOverlap(Tile upperLeft,
Tile lowerRight,
Tile upperLeftOther,
Tile lowerRightOther)
Returns true if two tile areas, defined by upper left and lower right tiles, overlap.
|
java.lang.String |
toString() |
public final long mapSize
public final int tileSize
public final int tileX
public final int tileY
public final byte zoomLevel
public Tile(int tileX, int tileY, byte zoomLevel, int tileSize)
tileX
- the X number of the tile.tileY
- the Y number of the tile.zoomLevel
- the zoom level of the tile.java.lang.IllegalArgumentException
- if any of the parameters is invalid.public static BoundingBox getBoundingBox(Tile upperLeft, Tile lowerRight)
upperLeft
- tile in upper left corner.lowerRight
- tile in lower right corner.public static Rectangle getBoundaryAbsolute(Tile upperLeft, Tile lowerRight)
upperLeft
- tile in upper left corner of area.lowerRight
- tile in lower right corner of area.public static boolean tileAreasOverlap(Tile upperLeft, Tile lowerRight, Tile upperLeftOther, Tile lowerRightOther)
upperLeft
- tile in upper left corner of area 1.lowerRight
- tile in lower right corner of area 1.upperLeftOther
- tile in upper left corner of area 2.lowerRightOther
- tile in lower right corner of area 2.public static int getMaxTileNumber(byte zoomLevel)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public BoundingBox getBoundingBox()
public java.util.Set<Tile> getNeighbours()
public Rectangle getBoundaryAbsolute()
public Rectangle getBoundaryRelative()
public Point getOrigin()
public Tile getLeft()
public Tile getRight()
public Tile getAbove()
public Tile getBelow()
public Tile getAboveLeft()
public Tile getAboveRight()
public Tile getBelowLeft()
public Tile getBelowRight()
public Tile getParent()
public int getShiftX(Tile otherTile)
public int getShiftY(Tile otherTile)
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object