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 doubleScale denominator of the root tile.static final StringName of the system variable controllingROOT_TILE_PIXELSstatic final FunctionNamestatic final intNumber of pixels in the side of the root tile.Fields inherited from class FunctionExpressionImpl
fallback, functionName, name, paramsFields inherited from interface Expression
NIL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSubclass should override, default implementation returns null.intMethods inherited from class FunctionExpressionImpl
accept, equals, functionName, getExpression, getFallbackValue, getFunctionName, getImplementationHints, getName, getParameters, hashCode, setFallbackValue, setParameters, toStringMethods inherited from class DefaultExpression
isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpressionMethods inherited from class ExpressionAbstract
evaluateMethods 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:ExpressionAbstractSubclass should override, default implementation returns null.- Specified by:
evaluatein interfaceExpression- Overrides:
evaluatein classFunctionExpressionImpl- Returns:
- default implementation returns null
-