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 classFunction 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 TypeMethodDescriptiondoublegetCurrentStop(MBLayer layer) Gets the current stop of the layer.double[]getRangeForStop(Double stop, List<double[]> ranges) Finds the distinct range for the current stop.doublestatic DoublezoomBoundaryScaleDenominator(double zoomLevel) Returns the scale denominator to use as the boundary of a zoom range, such as a layer minzoom or maxzoom.static DoublezoomLevelToScaleDenominator(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)
-
zoomBoundaryScaleDenominator
Returns the scale denominator to use as the boundary of a zoom range, such as a layer minzoom or maxzoom. The boundary sits oneZoomLevelFunction.ZOOM_STEPtowards the lower zooms, so a request at that zoom level counts as being at or above it: a layer is drawn at its minzoom and hidden at its maxzoom. Without the step, small differences in how clients compute the scale put such requests on either side of the boundary. -
getStop
-