Class FillExtrusionMBLayer
Example of line JSON:
{ 'id': 'room-extrusion', 'type': 'fill-extrusion', 'source': { 'type': 'geojson', 'data': 'https://www.mapbox.com/mapbox-gl-js/assets/data/indoor-3d-map.geojson' }, 'paint': { 'fill-extrusion-color': { 'property': 'color', 'type': 'identity'}, 'fill-extrusion-height': { 'property': 'height','type': 'identity'}, 'fill-extrusion-base': { 'property': 'base_height','type': 'identity'}, 'fill-extrusion-opacity': 0.5 } }Responsible for accessing wrapped json as expressions (for use in transformer).
- Author:
- jody
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class MBLayer
MBLayer.Visibility
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SemanticType
Access fill-extrusion-base as literal or function expressionAccess fill-extrusion-color as literal or function expression, defaults to black.Access fill-extrusion-height as literal or function expressionAccess fill-extrusion-opacity as literal or function expressionAccess fill-extrusion-translate as Point(Optional) Units in meters.(Optional).(Optional) Units in meters.(Optional) Defaults to 1.(Optional) Name of image in sprite to use for drawing images on extruded fills.int[]
(Optional) Units in pixels.(Optional) One of map, viewport.getType()
Rendering type of this layer.transformInternal
(MBStyle styleContext) TransformFillExtrusionMBLayer
to GeoTools FeatureTypeStyle.Methods inherited from class MBLayer
create, equals, filter, getFilter, getId, getJson, getLayout, getMaxZoom, getMetadata, getMinZoom, getPaint, getRef, getSource, getSourceLayer, getVisibility, hashCode, layout, paint, toString, transform, transform, visibility
-
Constructor Details
-
FillExtrusionMBLayer
public FillExtrusionMBLayer(JSONObject json)
-
-
Method Details
-
defaultSemanticType
-
getFillExtrusionOpacity
(Optional) Defaults to 1.The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.
- Returns:
- The opacity of the fill extrusion layer.
- Throws:
MBFormatException
- JSON provided inconsistent with specification
-
fillExtrusionOpacity
Access fill-extrusion-opacity as literal or function expression- Returns:
- The opacity of the fill extrusion layer.
- Throws:
MBFormatException
- JSON provided inconsistent with specification
-
getFillExtrusionColor
(Optional). Defaults to #000000. Disabled by fill-extrusion-pattern.The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root light settings.
If this color is specified as rgba with an alpha component, the alpha component will be ignored; use fill-extrusion-opacity to set layer opacity.
- Returns:
- The color of the extruded fill.
- Throws:
MBFormatException
-
fillExtrusionColor
Access fill-extrusion-color as literal or function expression, defaults to black.- Returns:
- The color of the extruded fill.
- Throws:
MBFormatException
-
getFillExtrusionTranslate
(Optional) Units in pixels. Defaults to 0,0.The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.
- Returns:
- The geometry's offset, in pixels.
- Throws:
MBFormatException
-
fillExtrusionTranslate
Access fill-extrusion-translate as Point- Returns:
- The geometry's offset, in pixels.
-
getFillExtrusionTranslateAnchor
(Optional) One of map, viewport. Defaults to map. Requires fill-extrusion-translate.Controls the translation reference point.
FillExtrusionMBLayer.TranslateAnchor.MAP
: The fill extrusion is translated relative to the map.FillExtrusionMBLayer.TranslateAnchor.VIEWPORT
: The fill extrusion is translated relative to the viewport.Defaults to
FillExtrusionMBLayer.TranslateAnchor.MAP
.- Returns:
- The translation reference point
-
getFillExtrusionPattern
(Optional) Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).- Returns:
- The name of the image sprite, or null if not defined.
- Throws:
MBFormatException
-
getFillExtrusionHeight
(Optional) Units in meters. Defaults to 0. The height with which to extrude this layer.- Returns:
- The height with which to extrude this layer.
- Throws:
MBFormatException
-
fillExtrusionHeight
Access fill-extrusion-height as literal or function expression- Returns:
- The height with which to extrude this layer.
- Throws:
MBFormatException
- JSON provided inconsistent with specification
-
getFillExtrusionBase
(Optional) Units in meters. Defaults to 0. Requires fill-extrusion-height.The height with which to extrude the base of this layer. Must be less than or equal to fill-extrusion-height.
- Returns:
- The height with which to extrude the base of this layer
- Throws:
MBFormatException
-
fillExtrusionBase
Access fill-extrusion-base as literal or function expression- Returns:
- The height with which to extrude the base of this layer
- Throws:
MBFormatException
- JSON provided inconsistent with specification
-
transformInternal
TransformFillExtrusionMBLayer
to GeoTools FeatureTypeStyle.- Specified by:
transformInternal
in classMBLayer
- Parameters:
styleContext
- The MBStyle to which this layer belongs, used as a context for things like resolving sprite and glyph names to full urls.
-
getType
Rendering type of this layer.
-