Class BuildingLayer

java.lang.Object
org.oscim.layers.Layer
org.oscim.layers.tile.buildings.BuildingLayer
All Implemented Interfaces:
VectorTileLayer.TileLoaderThemeHook, ZoomLimiter.IZoomLimiter
Direct Known Subclasses:
S3DBLayer

public class BuildingLayer extends Layer implements VectorTileLayer.TileLoaderThemeHook, ZoomLimiter.IZoomLimiter
  • Field Details

    • BUILDING_LEVEL_HEIGHT

      protected static final int BUILDING_LEVEL_HEIGHT
      See Also:
    • MIN_ZOOM

      public static final int MIN_ZOOM
      See Also:
    • POST_AA

      public static boolean POST_AA
      Use Fast Approximate Anti-Aliasing (FXAA) and Screen Space Ambient Occlusion (SSAO).
    • RAW_DATA

      public static boolean RAW_DATA
      Use real time calculations to pre-process data.
    • TRANSLUCENT

      public static boolean TRANSLUCENT
      Let vanish extrusions / meshes which are covered by others. RenderBucket.EXTRUSION: roofs are always translucent.

      To better notice the difference, reduce the alpha value of extrusion colors in themes.

    • mBuildings

      protected Map<Integer,List<org.oscim.layers.tile.buildings.BuildingLayer.BuildingElement>> mBuildings
    • mExtrusionRenderer

      protected final ExtrusionRenderer mExtrusionRenderer
    • mTileLayer

      protected final VectorTileLayer mTileLayer
  • Constructor Details

    • BuildingLayer

      public BuildingLayer(Map map, VectorTileLayer tileLayer)
    • BuildingLayer

      public BuildingLayer(Map map, VectorTileLayer tileLayer, boolean mesh, boolean shadow)
    • BuildingLayer

      public BuildingLayer(Map map, VectorTileLayer tileLayer, int zoomMin, int zoomMax, boolean mesh, boolean shadow)
      Parameters:
      map - The map data to add
      tileLayer - The vector tile layer which contains the tiles and the map elements
      zoomMin - The minimum zoom at which the layer appears
      zoomMax - The maximum zoom at which the layer appears
      mesh - Declare if using mesh or polygon renderer
      shadow - Declare if using shadow renderer
  • Method Details

    • addZoomLimit

      public void addZoomLimit()
      Description copied from interface: ZoomLimiter.IZoomLimiter
      Add zoom limit to tile manager to load these tiles.
      Specified by:
      addZoomLimit in interface ZoomLimiter.IZoomLimiter
    • removeZoomLimit

      public void removeZoomLimit()
      Description copied from interface: ZoomLimiter.IZoomLimiter
      Remove zoom limit from tile manager.
      Specified by:
      removeZoomLimit in interface ZoomLimiter.IZoomLimiter
    • process

      public boolean process(MapTile tile, RenderBuckets buckets, MapElement element, RenderStyle style, int level)
      TileLoaderThemeHook
      Specified by:
      process in interface VectorTileLayer.TileLoaderThemeHook
    • processElement

      protected void processElement(MapElement element, ExtrusionStyle extrusion, MapTile tile)
      Process map element.
      Parameters:
      element - the map element
      extrusion - the style of map element
      tile - the tile which contains map element
    • processElements

      protected void processElements(MapTile tile)
      Process all stored map elements (here only buildings).
      Parameters:
      tile - the tile which contains stored map elements
    • get

      public static ExtrusionBuckets get(MapTile tile)
      Parameters:
      tile - the MapTile
      Returns:
      ExtrusionBuckets of the tile
    • getExtrusionRenderer

      public ExtrusionRenderer getExtrusionRenderer()
      Get the ExtrusionRenderer for customization.
    • getKeyOrDefault

      protected String getKeyOrDefault(String key)
      Returns:
      the tile source tag key or library tag key as fallback
    • getTransformedValue

      protected String getTransformedValue(MapElement element, String key)
      Get the forward transformed value from tile source tag via the library tag key.
      Parameters:
      key - the library tag key
      Returns:
      the tile source tag value transformed to library tag value
    • getValue

      protected String getValue(MapElement element, String key)
      Get the tile source tag value via the library tag key.
      Parameters:
      key - the library tag key
      Returns:
      the tile source tag value of specified library tag key
    • complete

      public void complete(MapTile tile, boolean success)
      Description copied from interface: VectorTileLayer.TileLoaderThemeHook
      Called on loader thread when tile loading is completed
      Specified by:
      complete in interface VectorTileLayer.TileLoaderThemeHook