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 Details

    • NumberFeaturesTile

      public NumberFeaturesTile(Context context)
      Constructor
      Parameters:
      context - context
  • Method Details

    • 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:
      drawTile in interface CustomFeaturesTile
      Parameters:
      tileWidth - tile width to draw
      tileHeight - tile height to draw
      tileFeatureCount - count of features in the requested tile
      featureIndexResults - 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 interface CustomFeaturesTile
      Parameters:
      tileWidth - tile width to draw
      tileHeight - tile height to draw
      totalFeatureCount - count of total features in the feature table
      allFeatureResults - results in a feature cursor
      Returns:
      custom bitmap, or null