Class NumberFeaturesTile
- java.lang.Object
-
- mil.nga.geopackage.tiles.features.custom.NumberFeaturesTile
-
- All Implemented Interfaces:
CustomFeaturesTile
public class NumberFeaturesTile extends Object implements CustomFeaturesTile
Draws a tile indicating the number of features that exist within the tile, visible when zoomed in closer. The number is drawn in the center of the tile and by default is surrounded by a colored circle with border. By default a tile border is drawn and the tile is colored (transparently most likely). The paint objects for each draw type can be modified to or set to null (except for the text paint object).- Since:
- 1.1.0
-
-
Constructor Summary
Constructors Constructor Description NumberFeaturesTile(Context context)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitmapdrawTile(int tileWidth, int tileHeight, long tileFeatureCount, FeatureIndexResults featureIndexResults)Draw a custom tileBitmapdrawUnindexedTile(int tileWidth, int tileHeight, long totalFeatureCount, FeatureCursor allFeatureResults)Draw a custom tile when the number of features within the tile is unknown.PaintgetCircleFillPaint()Get the paint object used to draw the filled circlefloatgetCirclePaddingPercentage()Get the circle padding percentage around the textPaintgetCirclePaint()Get the paint object used to draw the circlePaintgetTextPaint()Get the paint object used to draw the textPaintgetTileBorderPaint()Get the tile border paint object used to draw a border around the tilePaintgetTileFillPaint()Get the tile fill paint object used to color the entire tilebooleanisDrawUnindexedTiles()Is the draw unindexed tiles option enabledvoidsetCircleFillPaint(Paint circleFillPaint)Set the paint object used to draw the filled circlevoidsetCirclePaddingPercentage(float circlePaddingPercentage)Set the circle padding percentage to pad around the text, value between 0.0 and 1.0voidsetCirclePaint(Paint circlePaint)Set the paint object used to draw the circlevoidsetDrawUnindexedTiles(boolean drawUnindexedTiles)Set the draw unindexed tiles optionvoidsetTextPaint(Paint textPaint)Set the paint object used to draw the textvoidsetTileBorderPaint(Paint tileBorderPaint)Set the tile border paint object used to draw a border around the tilevoidsetTileFillPaint(Paint tileFillPaint)Set the tile fill paint object used to color the entire tile
-
-
-
Constructor Detail
-
NumberFeaturesTile
public NumberFeaturesTile(Context context)
Constructor- Parameters:
context- context
-
-
Method Detail
-
getTextPaint
public Paint getTextPaint()
Get the paint object used to draw the text- Returns:
- text paint object
-
setTextPaint
public void setTextPaint(Paint textPaint)
Set the paint object used to draw the text- Parameters:
textPaint- text paint
-
getCirclePaint
public Paint getCirclePaint()
Get the paint object used to draw the circle- Returns:
- circle paint object
-
setCirclePaint
public void setCirclePaint(Paint circlePaint)
Set the paint object used to draw the circle- Parameters:
circlePaint- circle paint
-
getCircleFillPaint
public Paint getCircleFillPaint()
Get the paint object used to draw the filled circle- Returns:
- circle fill paint object
-
setCircleFillPaint
public void setCircleFillPaint(Paint circleFillPaint)
Set the paint object used to draw the filled circle- Parameters:
circleFillPaint- circle fill paint
-
getCirclePaddingPercentage
public float getCirclePaddingPercentage()
Get the circle padding percentage around the text- Returns:
- circle padding percentage, 0.0 to 1.0
-
setCirclePaddingPercentage
public void setCirclePaddingPercentage(float circlePaddingPercentage)
Set the circle padding percentage to pad around the text, value between 0.0 and 1.0- Parameters:
circlePaddingPercentage- circle padding percentage
-
getTileBorderPaint
public Paint getTileBorderPaint()
Get the tile border paint object used to draw a border around the tile- Returns:
- tile border paint
-
setTileBorderPaint
public void setTileBorderPaint(Paint tileBorderPaint)
Set the tile border paint object used to draw a border around the tile- Parameters:
tileBorderPaint- tile border paint
-
getTileFillPaint
public Paint getTileFillPaint()
Get the tile fill paint object used to color the entire tile- Returns:
- tile fill paint
-
setTileFillPaint
public void setTileFillPaint(Paint tileFillPaint)
Set the tile fill paint object used to color the entire tile- Parameters:
tileFillPaint- tile fill paint
-
isDrawUnindexedTiles
public boolean isDrawUnindexedTiles()
Is the draw unindexed tiles option enabled- Returns:
- true if drawing unindexed tiles
-
setDrawUnindexedTiles
public void setDrawUnindexedTiles(boolean drawUnindexedTiles)
Set the draw unindexed tiles option- Parameters:
drawUnindexedTiles- draw unindexed tiles flag
-
drawTile
public Bitmap drawTile(int tileWidth, int tileHeight, long tileFeatureCount, FeatureIndexResults featureIndexResults)
Draw a custom tile- Specified by:
drawTilein interfaceCustomFeaturesTile- Parameters:
tileWidth- tile width to drawtileHeight- tile height to drawtileFeatureCount- count of features in the requested tilefeatureIndexResults- results as feature index results- Returns:
- custom bitmap, or null
-
drawUnindexedTile
public Bitmap drawUnindexedTile(int tileWidth, int tileHeight, long totalFeatureCount, FeatureCursor allFeatureResults)
Draw a custom tile when the number of features within the tile is unknown. This is called when a feature table is not indexed and more total features exist than the max per tile.- Specified by:
drawUnindexedTilein interfaceCustomFeaturesTile- Parameters:
tileWidth- tile width to drawtileHeight- tile height to drawtotalFeatureCount- count of total features in the feature tableallFeatureResults- results in a feature cursor- Returns:
- custom bitmap, or null
-
-