Class MBObjectStops


  • public class MBObjectStops
    extends Object
    This class provides the ability to find all the zoom levels within a MapBox Style and returns a reduced list of only the layers and properties containing Base and Stops values. This class is only used with "zoom" and "zoom-and-property" and excludes the use of "property".
    Author:
    David Vick (Boundless)
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MBObjectStops.LayerStops
      Function stops representation.
    • Constructor Summary

      Constructors 
      Constructor Description
      MBObjectStops​(MBLayer layer)
      Data structure for pre-processing a MBLayer determining whether the layer contains zoom and zoom-and-property functions and if so, getting the distinct stops for each, building a list of MBLayers (one for each stop) and setting ranges that are used to set min/max scale denominators for each MBLayer.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getCurrentStop​(MBLayer layer)
      Gets the current stop of the layer.
      double[] getRangeForStop​(Double stop, List<double[]> ranges)
      Finds the distinct range for the current stop.
      double getStop​(MBLayer layer)  
      static Double zoomLevelToScaleDenominator​(double zoomLevel)
      Take a web mercator zoom level, and return the equivalent scale denominator (at the equator).
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MBObjectStops

        public MBObjectStops​(MBLayer layer)
        Data structure for pre-processing a MBLayer determining whether the layer contains zoom and zoom-and-property functions and if so, getting the distinct stops for each, building a list of MBLayers (one for each stop) and setting ranges that are used to set min/max scale denominators for each MBLayer.
        Parameters:
        layer - Layer being processed for stops
    • Method Detail

      • getCurrentStop

        public double getCurrentStop​(MBLayer layer)
        Gets the current stop of the layer. This would be the bottom of the range i.e 0 for {0, 20}
        Parameters:
        layer - Layer being processed
        Returns:
        Current zoom-level stop
      • getRangeForStop

        public double[] getRangeForStop​(Double stop,
                                        List<double[]> ranges)
        Finds the distinct range for the current stop.
        Parameters:
        stop - Current stop
        ranges - Available ranges
        Returns:
        distinct range for current stop
      • zoomLevelToScaleDenominator

        public static Double zoomLevelToScaleDenominator​(double zoomLevel)
        Take a web mercator zoom level, and return the equivalent scale denominator (at the equator).

        Converting to a scale denominator at the equator is consistent with the conversion elsewhere in GeoTools, e.g., in the GeoTools YSLD ZoomContextFinder.

        Parameters:
        zoomLevel - The zoom level
        Returns:
        The equivalent scale denominator (at the equator)
      • getStop

        public double getStop​(MBLayer layer)