Class BoundedOverlay
- java.lang.Object
-
- mil.nga.geopackage.map.tiles.overlay.BoundedOverlay
-
- All Implemented Interfaces:
TileProvider
- Direct Known Subclasses:
CompositeOverlay,FeatureOverlay,GeoPackageOverlay,XYZGeoPackageOverlay
public abstract class BoundedOverlay extends Object implements TileProvider
Abstract overlay which provides bounding returned tiles by zoom levels and/or a bounding box- Since:
- 1.2.5
-
-
Field Summary
Fields Modifier and Type Field Description protected BoundingBoxwebMercatorBoundingBoxWeb mercator bounding box-
Fields inherited from interface com.google.android.gms.maps.model.TileProvider
NO_TILE
-
-
Constructor Summary
Constructors Constructor Description BoundedOverlay()Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BoundingBoxgetBoundingBox(Projection projection)Get the bounding box as the provided projectionIntegergetMaxZoom()Get the max zoomIntegergetMinZoom()Get the min zoomTilegetTile(int x, int y, int zoom)BoundingBoxgetWebMercatorBoundingBox()Get the web mercator bounding boxprotected BoundingBoxgetWebMercatorBoundingBox(BoundingBox requestWebMercatorBoundingBox)Get the bounded overlay web mercator bounding box expanded as needed by the requested bounding box dimensionsbooleanhasTile(int x, int y, int zoom)Determine if there is a tile for the x, y, and zoomprotected abstract booleanhasTileToRetrieve(int x, int y, int zoom)Check if there is a tile to retrievebooleanisWithinBoundingBox(int x, int y, int zoom)Check if the tile request is within the desired tile boundsbooleanisWithinBounds(int x, int y, int zoom)Is the tile within the zoom and bounding box boundsbooleanisWithinZoom(float zoom)Check if the zoom is within the overlay zoom rangeprotected abstract TileretrieveTile(int x, int y, int zoom)Retrieve the tilevoidsetBoundingBox(BoundingBox boundingBox, Projection projection)Set the bounding box, provided as the indicated projectionvoidsetMaxZoom(Integer maxZoom)Set the max zoomvoidsetMinZoom(Integer minZoom)Set the min zoom
-
-
-
Field Detail
-
webMercatorBoundingBox
protected BoundingBox webMercatorBoundingBox
Web mercator bounding box
-
-
Method Detail
-
getMinZoom
public Integer getMinZoom()
Get the min zoom- Returns:
- min zoom
-
setMinZoom
public void setMinZoom(Integer minZoom)
Set the min zoom- Parameters:
minZoom- min zoom
-
getMaxZoom
public Integer getMaxZoom()
Get the max zoom- Returns:
- max zoom
-
setMaxZoom
public void setMaxZoom(Integer maxZoom)
Set the max zoom- Parameters:
maxZoom- max zoom
-
setBoundingBox
public void setBoundingBox(BoundingBox boundingBox, Projection projection)
Set the bounding box, provided as the indicated projection- Parameters:
boundingBox- bounding boxprojection- projection
-
getWebMercatorBoundingBox
public BoundingBox getWebMercatorBoundingBox()
Get the web mercator bounding box- Returns:
- bounding box
-
getBoundingBox
public BoundingBox getBoundingBox(Projection projection)
Get the bounding box as the provided projection- Parameters:
projection- projection- Returns:
- bounding box
-
getWebMercatorBoundingBox
protected BoundingBox getWebMercatorBoundingBox(BoundingBox requestWebMercatorBoundingBox)
Get the bounded overlay web mercator bounding box expanded as needed by the requested bounding box dimensions- Parameters:
requestWebMercatorBoundingBox- requested web mercator bounding box- Returns:
- web mercator bounding box
-
getTile
public Tile getTile(int x, int y, int zoom)
- Specified by:
getTilein interfaceTileProvider
-
hasTile
public boolean hasTile(int x, int y, int zoom)Determine if there is a tile for the x, y, and zoom- Parameters:
x- x coordinatey- y coordinatezoom- zoom value- Returns:
- true if there is a tile
- Since:
- 1.2.6
-
hasTileToRetrieve
protected abstract boolean hasTileToRetrieve(int x, int y, int zoom)Check if there is a tile to retrieve- Parameters:
x- x coordinatey- y coordinatezoom- zoom value- Returns:
- true if there is a tile
-
retrieveTile
protected abstract Tile retrieveTile(int x, int y, int zoom)
Retrieve the tile- Parameters:
x- x coordinatey- y coordinatezoom- zoom value- Returns:
- tile
-
isWithinBounds
public boolean isWithinBounds(int x, int y, int zoom)Is the tile within the zoom and bounding box bounds- Parameters:
x- x coordinatey- y coordinatezoom- zoom value- Returns:
- true if within bounds
-
isWithinZoom
public boolean isWithinZoom(float zoom)
Check if the zoom is within the overlay zoom range- Parameters:
zoom- zoom value- Returns:
- true if within zoom
-
isWithinBoundingBox
public boolean isWithinBoundingBox(int x, int y, int zoom)Check if the tile request is within the desired tile bounds- Parameters:
x- x coordinatey- y coordinatezoom- zoom value- Returns:
- true if within bounds
-
-