Package org.geotools.mbstyle.parse
Class MBObjectStops
Object
MBObjectStops
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 ClassesModifier and TypeClassDescriptionstatic class
Function stops representation. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMBObjectStops
(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
Modifier and TypeMethodDescriptiondouble
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
static Double
zoomLevelToScaleDenominator
(double zoomLevel) Take a web mercator zoom level, and return the equivalent scale denominator (at the equator).
-
Field Details
-
ls
-
stops
-
layersForStop
-
ranges
-
-
Constructor Details
-
MBObjectStops
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 Details
-
getCurrentStop
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
Finds the distinct range for the current stop.- Parameters:
stop
- Current stopranges
- Available ranges- Returns:
- distinct range for current stop
-
zoomLevelToScaleDenominator
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
-