Class NumberFeaturesTile
java.lang.Object
mil.nga.geopackage.tiles.features.custom.NumberFeaturesTile
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionandroid.graphics.BitmapdrawTile(int tileWidth, int tileHeight, long tileFeatureCount, FeatureIndexResults featureIndexResults) Draw a custom tileandroid.graphics.BitmapdrawUnindexedTile(int tileWidth, int tileHeight, long totalFeatureCount, FeatureCursor allFeatureResults) Draw a custom tile when the number of features within the tile is unknown.android.graphics.PaintGet the paint object used to draw the filled circlefloatGet the circle padding percentage around the textandroid.graphics.PaintGet the paint object used to draw the circleandroid.graphics.PaintGet the paint object used to draw the textandroid.graphics.PaintGet the tile border paint object used to draw a border around the tileandroid.graphics.PaintGet the tile fill paint object used to color the entire tilebooleanIs the draw unindexed tiles option enabledvoidsetCircleFillPaint(android.graphics.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(android.graphics.Paint circlePaint) Set the paint object used to draw the circlevoidsetDrawUnindexedTiles(boolean drawUnindexedTiles) Set the draw unindexed tiles optionvoidsetTextPaint(android.graphics.Paint textPaint) Set the paint object used to draw the textvoidsetTileBorderPaint(android.graphics.Paint tileBorderPaint) Set the tile border paint object used to draw a border around the tilevoidsetTileFillPaint(android.graphics.Paint tileFillPaint) Set the tile fill paint object used to color the entire tile
-
Constructor Details
-
NumberFeaturesTile
public NumberFeaturesTile(android.content.Context context) Constructor- Parameters:
context- context
-
-
Method Details
-
getTextPaint
public android.graphics.Paint getTextPaint()Get the paint object used to draw the text- Returns:
- text paint object
-
setTextPaint
public void setTextPaint(android.graphics.Paint textPaint) Set the paint object used to draw the text- Parameters:
textPaint- text paint
-
getCirclePaint
public android.graphics.Paint getCirclePaint()Get the paint object used to draw the circle- Returns:
- circle paint object
-
setCirclePaint
public void setCirclePaint(android.graphics.Paint circlePaint) Set the paint object used to draw the circle- Parameters:
circlePaint- circle paint
-
getCircleFillPaint
public android.graphics.Paint getCircleFillPaint()Get the paint object used to draw the filled circle- Returns:
- circle fill paint object
-
setCircleFillPaint
public void setCircleFillPaint(android.graphics.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 android.graphics.Paint getTileBorderPaint()Get the tile border paint object used to draw a border around the tile- Returns:
- tile border paint
-
setTileBorderPaint
public void setTileBorderPaint(android.graphics.Paint tileBorderPaint) Set the tile border paint object used to draw a border around the tile- Parameters:
tileBorderPaint- tile border paint
-
getTileFillPaint
public android.graphics.Paint getTileFillPaint()Get the tile fill paint object used to color the entire tile- Returns:
- tile fill paint
-
setTileFillPaint
public void setTileFillPaint(android.graphics.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 android.graphics.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 android.graphics.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
-