Package org.oscim.layers.tile.buildings
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.oscim.layers.Layer
Layer.EnableHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected final ExtrusionRendererstatic final intprotected final VectorTileLayerstatic booleanUse Fast Approximate Anti-Aliasing (FXAA) and Screen Space Ambient Occlusion (SSAO).static booleanUse real time calculations to pre-process data.static booleanLet vanish extrusions / meshes which are covered by others. -
Constructor Summary
ConstructorsConstructorDescriptionBuildingLayer(Map map, VectorTileLayer tileLayer) BuildingLayer(Map map, VectorTileLayer tileLayer, boolean mesh, boolean shadow) BuildingLayer(Map map, VectorTileLayer tileLayer, int zoomMin, int zoomMax, boolean mesh, boolean shadow) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd zoom limit to tile manager to load these tiles.voidCalled on loader thread when tile loading is completedstatic ExtrusionBucketsGet the ExtrusionRenderer for customization.protected StringgetKeyOrDefault(String key) protected StringgetTransformedValue(MapElement element, String key) Get the forward transformed value from tile source tag via the library tag key.protected StringgetValue(MapElement element, String key) Get the tile source tag value via the library tag key.booleanprocess(MapTile tile, RenderBuckets buckets, MapElement element, RenderStyle style, int level) TileLoaderThemeHookprotected voidprocessElement(MapElement element, ExtrusionStyle extrusion, MapTile tile) Process map element.protected voidprocessElements(MapTile tile) Process all stored map elements (here only buildings).voidRemove zoom limit from tile manager.Methods inherited from class org.oscim.layers.Layer
getRenderer, isEnabled, map, onDetach, setEnabled, setEnableHandler
-
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_AAUse Fast Approximate Anti-Aliasing (FXAA) and Screen Space Ambient Occlusion (SSAO). -
RAW_DATA
public static boolean RAW_DATAUse real time calculations to pre-process data. -
TRANSLUCENT
public static boolean TRANSLUCENTLet 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
-
mExtrusionRenderer
-
mTileLayer
-
-
Constructor Details
-
BuildingLayer
-
BuildingLayer
-
BuildingLayer
public BuildingLayer(Map map, VectorTileLayer tileLayer, int zoomMin, int zoomMax, boolean mesh, boolean shadow) - Parameters:
map- The map data to addtileLayer- The vector tile layer which contains the tiles and the map elementszoomMin- The minimum zoom at which the layer appearszoomMax- The maximum zoom at which the layer appearsmesh- Declare if using mesh or polygon renderershadow- Declare if using shadow renderer
-
-
Method Details
-
addZoomLimit
public void addZoomLimit()Description copied from interface:ZoomLimiter.IZoomLimiterAdd zoom limit to tile manager to load these tiles.- Specified by:
addZoomLimitin interfaceZoomLimiter.IZoomLimiter
-
removeZoomLimit
public void removeZoomLimit()Description copied from interface:ZoomLimiter.IZoomLimiterRemove zoom limit from tile manager.- Specified by:
removeZoomLimitin interfaceZoomLimiter.IZoomLimiter
-
process
public boolean process(MapTile tile, RenderBuckets buckets, MapElement element, RenderStyle style, int level) TileLoaderThemeHook- Specified by:
processin interfaceVectorTileLayer.TileLoaderThemeHook
-
processElement
Process map element.- Parameters:
element- the map elementextrusion- the style of map elementtile- the tile which contains map element
-
processElements
Process all stored map elements (here only buildings).- Parameters:
tile- the tile which contains stored map elements
-
get
- Parameters:
tile- the MapTile- Returns:
- ExtrusionBuckets of the tile
-
getExtrusionRenderer
Get the ExtrusionRenderer for customization. -
getKeyOrDefault
- Returns:
- the tile source tag key or library tag key as fallback
-
getTransformedValue
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
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
Description copied from interface:VectorTileLayer.TileLoaderThemeHookCalled on loader thread when tile loading is completed- Specified by:
completein interfaceVectorTileLayer.TileLoaderThemeHook
-