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(android.content.Context context)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    android.graphics.Bitmap
    drawTile(int tileWidth, int tileHeight, long tileFeatureCount, FeatureIndexResults featureIndexResults)
    Draw a custom tile
    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.
    android.graphics.Paint
    Get the paint object used to draw the filled circle
    float
    Get the circle padding percentage around the text
    android.graphics.Paint
    Get the paint object used to draw the circle
    android.graphics.Paint
    Get the paint object used to draw the text
    android.graphics.Paint
    Get the tile border paint object used to draw a border around the tile
    android.graphics.Paint
    Get the tile fill paint object used to color the entire tile
    boolean
    Is the draw unindexed tiles option enabled
    void
    setCircleFillPaint(android.graphics.Paint circleFillPaint)
    Set the paint object used to draw the filled circle
    void
    setCirclePaddingPercentage(float circlePaddingPercentage)
    Set the circle padding percentage to pad around the text, value between 0.0 and 1.0
    void
    setCirclePaint(android.graphics.Paint circlePaint)
    Set the paint object used to draw the circle
    void
    setDrawUnindexedTiles(boolean drawUnindexedTiles)
    Set the draw unindexed tiles option
    void
    setTextPaint(android.graphics.Paint textPaint)
    Set the paint object used to draw the text
    void
    setTileBorderPaint(android.graphics.Paint tileBorderPaint)
    Set the tile border paint object used to draw a border around the tile
    void
    setTileFillPaint(android.graphics.Paint tileFillPaint)
    Set the tile fill paint object used to color the entire tile

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      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 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:
      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