Package org.geotools.mbstyle.function
Class ZoomLevelFunction
Object
ExpressionAbstract
DefaultExpression
FunctionExpressionImpl
ZoomLevelFunction
- All Implemented Interfaces:
Expression
,Function
,FunctionExpression
,Factory
Function that takes a scale denominator and a srid and outputs the zoom level.
Example 2:
Note: EPSG:3857 is currently the only supported srid, and zoom levels are assumed to be at the equator.
Example:
ff.function("zoomLevel", ff.function("env", ff.literal("wms_scale_denominator")), ff.literal("EPSG:3857") );The above function would evaluate to the zoomLevel that corresponds to the current environment's wms_scale_denominator, for EPSG:3857.
Example 2:
ff.function("zoomLevel", ff.literal(136494.693347), ff.literal("EPSG:3857") );The above function would evaluate to a zoomLevel of 12.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
Scale denominator of the root tile.static final String
Name of the system variable controllingROOT_TILE_PIXELS
static final FunctionName
static final int
Number of pixels in the side of the root tile.Fields inherited from class FunctionExpressionImpl
fallback, functionName, name, params
Fields inherited from interface Expression
NIL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSubclass should override, default implementation returns null.int
Methods inherited from class FunctionExpressionImpl
accept, equals, functionName, getExpression, getFallbackValue, getFunctionName, getImplementationHints, getName, getParameters, hashCode, setFallbackValue, setParameters, toString
Methods inherited from class DefaultExpression
isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression
Methods inherited from class ExpressionAbstract
evaluate
Methods inherited from interface Expression
evaluate
-
Field Details
-
NAME
-
MBSTYLE_ROOT_TILE_PIXELS_KEY
Name of the system variable controllingROOT_TILE_PIXELS
- See Also:
-
ROOT_TILE_PIXELS
public static final int ROOT_TILE_PIXELSNumber of pixels in the side of the root tile. Assumes 512 if not otherwise configured. -
EPSG_3857_O_SCALE
public static final double EPSG_3857_O_SCALEScale denominator of the root tile. Changes based on the ROOT_TILE_PIXELS value.
-
-
Constructor Details
-
ZoomLevelFunction
public ZoomLevelFunction()
-
-
Method Details
-
getArgCount
public int getArgCount() -
evaluate
Description copied from class:ExpressionAbstract
Subclass should override, default implementation returns null.- Specified by:
evaluate
in interfaceExpression
- Overrides:
evaluate
in classFunctionExpressionImpl
- Returns:
- default implementation returns null
-