Class MGRSTileProvider

java.lang.Object
mil.nga.mgrs.tile.MGRSTileProvider
All Implemented Interfaces:
TileProvider

public class MGRSTileProvider extends Object implements TileProvider
MGRS Tile Provider
  • Constructor Details

    • MGRSTileProvider

      public MGRSTileProvider(Context context)
      Constructor
      Parameters:
      context - app context
    • MGRSTileProvider

      public MGRSTileProvider(Context context, GridType... types)
      Constructor
      Parameters:
      context - app context
      types - grids types to enable
    • MGRSTileProvider

      public MGRSTileProvider(Context context, Collection<GridType> types)
      Constructor
      Parameters:
      context - app context
      types - grids types to enable
    • MGRSTileProvider

      public MGRSTileProvider(Context context, Grids grids)
      Constructor
      Parameters:
      context - app context
      grids - grids
    • MGRSTileProvider

      public MGRSTileProvider(int tileLength)
      Constructor
      Parameters:
      tileLength - tile width and height
    • MGRSTileProvider

      public MGRSTileProvider(int tileLength, GridType... types)
      Constructor
      Parameters:
      tileLength - tile width and height
      types - grids types to enable
    • MGRSTileProvider

      public MGRSTileProvider(int tileLength, Collection<GridType> types)
      Constructor
      Parameters:
      tileLength - tile width and height
      types - grids types to enable
    • MGRSTileProvider

      public MGRSTileProvider(int tileLength, Grids grids)
      Constructor
      Parameters:
      tileLength - tile width and height
      grids - grids
    • MGRSTileProvider

      public MGRSTileProvider(int tileWidth, int tileHeight)
      Constructor
      Parameters:
      tileWidth - tile width
      tileHeight - tile height
    • MGRSTileProvider

      public MGRSTileProvider(int tileWidth, int tileHeight, GridType... types)
      Constructor
      Parameters:
      tileWidth - tile width
      tileHeight - tile height
      types - grids types to enable
    • MGRSTileProvider

      public MGRSTileProvider(int tileWidth, int tileHeight, Collection<GridType> types)
      Constructor
      Parameters:
      tileWidth - tile width
      tileHeight - tile height
      types - grids types to enable
    • MGRSTileProvider

      public MGRSTileProvider(int tileWidth, int tileHeight, Grids grids)
      Constructor
      Parameters:
      tileWidth - tile width
      tileHeight - tile height
      grids - grids
  • Method Details

    • create

      public static MGRSTileProvider create(Context context)
      Create a tile provider with all grids
      Parameters:
      context - app context
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(Context context, GridType... types)
      Create a tile provider with grid types
      Parameters:
      context - app context
      types - grids types to enable
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(Context context, Collection<GridType> types)
      Create a tile provider with grid types
      Parameters:
      context - app context
      types - grids types to enable
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(Context context, Grids grids)
      Create a tile provider with grids
      Parameters:
      context - app context
      grids - grids
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(int tileLength)
      Create a tile provider with all grids
      Parameters:
      tileLength - tile width and height
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(int tileLength, GridType... types)
      Create a tile provider with grid types
      Parameters:
      tileLength - tile width and height
      types - grids types to enable
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(int tileLength, Collection<GridType> types)
      Create a tile provider with grid types
      Parameters:
      tileLength - tile width and height
      types - grids types to enable
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(int tileLength, Grids grids)
      Create a tile provider with grids
      Parameters:
      tileLength - tile width and height
      grids - grids
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(int tileWidth, int tileHeight)
      Create a tile provider with all grids
      Parameters:
      tileWidth - tile width
      tileHeight - tile height
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(int tileWidth, int tileHeight, GridType... types)
      Create a tile provider with grid types
      Parameters:
      tileWidth - tile width
      tileHeight - tile height
      types - grids types to enable
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(int tileWidth, int tileHeight, Collection<GridType> types)
      Create a tile provider with grid types
      Parameters:
      tileWidth - tile width
      tileHeight - tile height
      types - grids types to enable
      Returns:
      tile provider
    • create

      public static MGRSTileProvider create(int tileWidth, int tileHeight, Grids grids)
      Create a tile provider with grids
      Parameters:
      tileWidth - tile width
      tileHeight - tile height
      grids - grids
      Returns:
      tile provider
    • createGZD

      public static MGRSTileProvider createGZD(Context context)
      Create a tile provider with Grid Zone Designator grids
      Parameters:
      context - app context
      Returns:
      tile provider
    • createGZD

      public static MGRSTileProvider createGZD(int tileLength)
      Create a tile provider with Grid Zone Designator grids
      Parameters:
      tileLength - tile length
      Returns:
      tile provider
    • createGZD

      public static MGRSTileProvider createGZD(int tileWidth, int tileHeight)
      Create a tile provider with Grid Zone Designator grids
      Parameters:
      tileWidth - tile width
      tileHeight - tile height
      Returns:
      tile provider
    • getTileWidth

      public int getTileWidth()
      Get the tile width
      Returns:
      tile width
    • setTileWidth

      public void setTileWidth(int tileWidth)
      Set the tile width
      Parameters:
      tileWidth - tile width
    • getTileHeight

      public int getTileHeight()
      Get the tile height
      Returns:
      tile height
    • setTileHeight

      public void setTileHeight(int tileHeight)
      Set the tile height
      Parameters:
      tileHeight - tile height
    • getGrids

      public Grids getGrids()
      Get the grids
      Returns:
      grids
    • setGrids

      public void setGrids(Grids grids)
      Set the grids
      Parameters:
      grids - grids
    • getGrid

      public Grid getGrid(GridType type)
      Get the grid
      Parameters:
      type - grid type
      Returns:
      grid
    • getCoordinate

      public String getCoordinate(LatLng latLng)
      Get the Military Grid Reference System coordinate for the location in one meter precision
      Parameters:
      latLng - location
      Returns:
      MGRS coordinate
    • getCoordinate

      public String getCoordinate(LatLng latLng, int zoom)
      Get the Military Grid Reference System coordinate for the location in the zoom level precision
      Parameters:
      latLng - location
      zoom - zoom level precision
      Returns:
      MGRS coordinate
    • getCoordinate

      public String getCoordinate(LatLng latLng, GridType type)
      Get the Military Grid Reference System coordinate for the location in the grid type precision
      Parameters:
      latLng - location
      type - grid type precision
      Returns:
      MGRS coordinate
    • getMGRS

      public MGRS getMGRS(LatLng latLng)
      Get the Military Grid Reference System for the location
      Parameters:
      latLng - location
      Returns:
      MGRS
    • getPrecision

      public GridType getPrecision(int zoom)
      Get the grid precision for the zoom level
      Parameters:
      zoom - zoom level
      Returns:
      grid type precision
    • getTile

      public Tile getTile(int x, int y, int zoom)
      Specified by:
      getTile in interface TileProvider
    • drawTile

      public Bitmap drawTile(int x, int y, int zoom)
      Draw the tile
      Parameters:
      x - x coordinate
      y - y coordinate
      zoom - zoom level
      Returns:
      bitmap