Class BitmapOverlayRasterTileDataSource

java.lang.Object
com.massifmaps.datasources.TileDataSource
com.massifmaps.datasources.BitmapOverlayRasterTileDataSource

public class BitmapOverlayRasterTileDataSource extends TileDataSource
Tile data source that uses given bitmap with two, three or four control points define a raster overlay.
Note: if two points are given, conformal transformation is calculated. If three points are given, affine transformation is calculated. In case of four points, perspective transformation is used.
  • Constructor Details

    • BitmapOverlayRasterTileDataSource

      public BitmapOverlayRasterTileDataSource(int minZoom, int maxZoom, Bitmap bitmap, Projection projection, MapPosVector mapPoses, ScreenPosVector bitmapPoses)
      Constructs a new bitmap overlay data source.
      Parameters:
      minZoom - The minimum zoom for generated tiles.
      maxZoom - The maximum zoom for generated tiles.
      bitmap - The bitmap to use as an overlay.
      projection - The projection definining coordinate system of the control points.
      mapPoses - The geographical control points. The list must contain either 2, 3 or 4 points.
      bitmapPoses - The pixel coordinates in the bitmap corresponding to geographical control points. The number of coordinates must be equal to the number of control points in mapPoses list.
      Throws:
      IllegalArgumentException - If the transformation can not be calculated.
  • Method Details

    • getDataExtent

      public MapBounds getDataExtent()
      Description copied from class: TileDataSource
      Returns the extent of the tiles in this data source.
      The bounds are in coordinate system of the projection of the data source.
      Overrides:
      getDataExtent in class TileDataSource
      Returns:
      The extent of the data source.
    • loadTile

      public TileData loadTile(MapTile mapTile)
      Description copied from class: TileDataSource
      Loads the specified tile.
      Note: the tile coordinate system used here is vertically flipped relative to layer tile coordinate system.
      Overrides:
      loadTile in class TileDataSource
      Parameters:
      mapTile - The tile to load.
      Returns:
      The tile data. If the tile is not available, null may be returned.