Package com.massifmaps.utils
Class TileUtils
java.lang.Object
com.massifmaps.utils.TileUtils
A helper class for mapping coordinates to tiles and back.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MapTilecalculateClippedMapTile(MapPos mapPos, int zoom, Projection proj) Calculates the map tile corresponding to specified point and zoom level.static MapTilecalculateMapTile(MapPos mapPos, int zoom, Projection proj) Calculates the map tile corresponding to specified point and zoom level.static MapBoundscalculateMapTileBounds(MapTile mapTile, Projection proj) Calculates bounds for the given map tile.static MapPoscalculateMapTileOrigin(MapTile mapTile, Projection proj) Calculates origin coordinates for the given map tile.
-
Method Details
-
calculateMapTile
Calculates the map tile corresponding to specified point and zoom level.- Parameters:
mapPos- Coordinates for the point.zoom- Zoom level for the tile.proj- The projection to use for tile and point.- Returns:
- The corresponding map tile.
-
calculateClippedMapTile
Calculates the map tile corresponding to specified point and zoom level. If the resulting tile is outside the valid range, it will be clipped.- Parameters:
mapPos- Coordinates for the point.zoom- Zoom level for the tile.proj- The projection to use for tile and point.- Returns:
- The corresponding map tile.
-
calculateMapTileOrigin
Calculates origin coordinates for the given map tile.- Parameters:
mapTile- The map tile to use.proj- The projection to use for origin.- Returns:
- The corresponding tile origin.
-
calculateMapTileBounds
Calculates bounds for the given map tile.- Parameters:
mapTile- The map tile to use.proj- The projection to use for bounds.- Returns:
- The corresponding tile bounds.
-