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
-
Method Summary
Modifier and TypeMethodDescriptiondrawTile
(int tileWidth, int tileHeight, long tileFeatureCount, FeatureIndexResults featureIndexResults) Draw a custom tiledrawUnindexedTile
(int tileWidth, int tileHeight, long totalFeatureCount, FeatureCursor allFeatureResults) Draw a custom tile when the number of features within the tile is unknown.Get the paint object used to draw the filled circlefloat
Get the circle padding percentage around the textGet the paint object used to draw the circleGet the paint object used to draw the textGet the tile border paint object used to draw a border around the tileGet the tile fill paint object used to color the entire tileboolean
Is the draw unindexed tiles option enabledvoid
setCircleFillPaint
(Paint circleFillPaint) Set the paint object used to draw the filled circlevoid
setCirclePaddingPercentage
(float circlePaddingPercentage) Set the circle padding percentage to pad around the text, value between 0.0 and 1.0void
setCirclePaint
(Paint circlePaint) Set the paint object used to draw the circlevoid
setDrawUnindexedTiles
(boolean drawUnindexedTiles) Set the draw unindexed tiles optionvoid
setTextPaint
(Paint textPaint) Set the paint object used to draw the textvoid
setTileBorderPaint
(Paint tileBorderPaint) Set the tile border paint object used to draw a border around the tilevoid
setTileFillPaint
(Paint tileFillPaint) Set the tile fill paint object used to color the entire tile
-
Constructor Details
-
NumberFeaturesTile
Constructor- Parameters:
context
- context
-
-
Method Details
-
getTextPaint
Get the paint object used to draw the text- Returns:
- text paint object
-
setTextPaint
Set the paint object used to draw the text- Parameters:
textPaint
- text paint
-
getCirclePaint
Get the paint object used to draw the circle- Returns:
- circle paint object
-
setCirclePaint
Set the paint object used to draw the circle- Parameters:
circlePaint
- circle paint
-
getCircleFillPaint
Get the paint object used to draw the filled circle- Returns:
- circle fill paint object
-
setCircleFillPaint
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
Get the tile border paint object used to draw a border around the tile- Returns:
- tile border paint
-
setTileBorderPaint
Set the tile border paint object used to draw a border around the tile- Parameters:
tileBorderPaint
- tile border paint
-
getTileFillPaint
Get the tile fill paint object used to color the entire tile- Returns:
- tile fill paint
-
setTileFillPaint
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:
drawTile
in 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:
drawUnindexedTile
in 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
-