Class MapBoxStyle

Object
MapBoxStyle

public class MapBoxStyle extends Object
MapBox Style facade offering utility methods for quickly working with JSON and converting to StyledLayerDescriptor.
Author:
Jody Garnett (Boundless)
  • Constructor Details

    • MapBoxStyle

      public MapBoxStyle()
  • Method Details

    • parse

      public static StyledLayerDescriptor parse(Reader reader) throws IOException, ParseException
      Read in the provided JSON as a StyledLayerDescriptor.
      Parameters:
      reader - JSON content
      Returns:
      generated style
      Throws:
      ParseException - Invalid JSON provided
      IOException - Problem reading definition from reader
    • parse

      public static StyledLayerDescriptor parse(InputStream stream) throws IOException, ParseException
      Read in the provided JSON as a StyledLayerDescriptor.
      Parameters:
      stream - JSON content
      Returns:
      generated style
      Throws:
      ParseException - Invalid JSON provided
      IOException - Problem reading definition from stream
    • validate

      public static List<Exception> validate(Reader reader)
      Validate ability to read json, and parse each layer.
      Parameters:
      reader - Reader for reading the style
      Returns:
      List of parse exceptions found. If this list is empty, the style is valid.