Class FillExtrusionMBLayer


  • public class FillExtrusionMBLayer
    extends MBLayer
    MBLayer wrapper for "fill extrusion" representing extruded (3D) polygon.

    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
    • Constructor Detail

      • FillExtrusionMBLayer

        public FillExtrusionMBLayer​(JSONObject json)
    • Method Detail

      • defaultSemanticType

        protected SemanticType defaultSemanticType()
      • getFillExtrusionOpacity

        public Number getFillExtrusionOpacity()
                                       throws MBFormatException
        (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

        public Expression fillExtrusionOpacity()
                                        throws MBFormatException
        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

        public Color getFillExtrusionColor()
                                    throws MBFormatException
        (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

        public Expression fillExtrusionColor()
                                      throws MBFormatException
        Access fill-extrusion-color as literal or function expression, defaults to black.
        Returns:
        The color of the extruded fill.
        Throws:
        MBFormatException
      • getFillExtrusionTranslate

        public int[] getFillExtrusionTranslate()
                                        throws MBFormatException
        (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

        public Point fillExtrusionTranslate()
        Access fill-extrusion-translate as Point
        Returns:
        The geometry's offset, in pixels.
      • getFillExtrusionPattern

        public Expression getFillExtrusionPattern()
                                           throws MBFormatException
        (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

        public Number getFillExtrusionHeight()
                                      throws MBFormatException
        (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

        public Expression fillExtrusionHeight()
                                       throws MBFormatException
        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

        public Number getFillExtrusionBase()
                                    throws MBFormatException
        (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

        public Expression fillExtrusionBase()
                                     throws MBFormatException
        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

        public List<FeatureTypeStyle> transformInternal​(MBStyle styleContext)
        Transform FillExtrusionMBLayer to GeoTools FeatureTypeStyle.
        Specified by:
        transformInternal in class MBLayer
        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

        public String getType()
        Rendering type of this layer.
        Specified by:
        getType in class MBLayer
        Returns:
        TYPE