public class FillExtrusionMBLayer extends MBLayer
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).
Modifier and Type | Class and Description |
---|---|
static class |
FillExtrusionMBLayer.TranslateAnchor |
MBLayer.Visibility
Constructor and Description |
---|
FillExtrusionMBLayer(JSONObject json) |
Modifier and Type | Method and Description |
---|---|
protected SemanticType |
defaultSemanticType()
Default
SemanticType to use when generating MBLayer.getFilter() . |
Expression |
fillExtrusionBase()
Access fill-extrusion-base as literal or function expression
|
Expression |
fillExtrusionColor()
Access fill-extrusion-color as literal or function expression, defaults to black.
|
Expression |
fillExtrusionHeight()
Access fill-extrusion-height as literal or function expression
|
Expression |
fillExtrusionOpacity()
Access fill-extrusion-opacity as literal or function expression
|
Point |
fillExtrusionTranslate()
Access fill-extrusion-translate as Point
|
Number |
getFillExtrusionBase()
(Optional) Units in meters.
|
Color |
getFillExtrusionColor()
(Optional).
|
Number |
getFillExtrusionHeight()
(Optional) Units in meters.
|
Number |
getFillExtrusionOpacity()
(Optional) Defaults to 1.
|
Expression |
getFillExtrusionPattern()
(Optional) Name of image in sprite to use for drawing images on extruded fills.
|
int[] |
getFillExtrusionTranslate()
(Optional) Units in pixels.
|
FillExtrusionMBLayer.TranslateAnchor |
getFillExtrusionTranslateAnchor()
(Optional) One of map, viewport.
|
String |
getType()
Rendering type of this layer.
|
List<FeatureTypeStyle> |
transformInternal(MBStyle styleContext)
Transform
FillExtrusionMBLayer to GeoTools FeatureTypeStyle. |
create, equals, filter, getFilter, getId, getJson, getLayout, getMaxZoom, getMetadata, getMinZoom, getPaint, getRef, getSource, getSourceLayer, getVisibility, hashCode, layout, paint, toString, transform, transform, visibility
protected SemanticType defaultSemanticType()
MBLayer
SemanticType
to use when generating MBLayer.getFilter()
.
Use ANY to match all geometry, or fill in LINE, POINT, POLYGON if needed.
public Number getFillExtrusionOpacity() throws MBFormatException
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.
MBFormatException
- JSON provided inconsistent with specificationpublic Expression fillExtrusionOpacity() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificationpublic Color getFillExtrusionColor() throws MBFormatException
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.
MBFormatException
public Expression fillExtrusionColor() throws MBFormatException
MBFormatException
public int[] getFillExtrusionTranslate() throws MBFormatException
The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.
MBFormatException
public Point fillExtrusionTranslate()
public FillExtrusionMBLayer.TranslateAnchor getFillExtrusionTranslateAnchor()
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
.
public Expression getFillExtrusionPattern() throws MBFormatException
MBFormatException
public Number getFillExtrusionHeight() throws MBFormatException
MBFormatException
public Expression fillExtrusionHeight() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificationpublic Number getFillExtrusionBase() throws MBFormatException
The height with which to extrude the base of this layer. Must be less than or equal to fill-extrusion-height.
MBFormatException
public Expression fillExtrusionBase() throws MBFormatException
MBFormatException
- JSON provided inconsistent with specificationpublic List<FeatureTypeStyle> transformInternal(MBStyle styleContext)
FillExtrusionMBLayer
to GeoTools FeatureTypeStyle.transformInternal
in class MBLayer
styleContext
- The MBStyle to which this layer belongs, used as a context for things
like resolving sprite and glyph names to full urls.Copyright © 1996–2023 Geotools. All rights reserved.