Package org.mapfish.print.attribute.map
Enum Class ZoomLevelSnapStrategy
- All Implemented Interfaces:
Serializable
,Comparable<ZoomLevelSnapStrategy>
,Constable
Enumerates the different strategies for finding the closest zoom-level/scale.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
The results of a search.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFind the closest zoom level.Find the closest zoom level.Always choose the zoom-level that is just higher than the target value.Always choose the zoom-level that is just lower than the target value. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ZoomLevelSnapStrategy.SearchResult
search
(Scale scale, double tolerance, ZoomLevels zoomLevels) Search the provided zoomLevels for the scale that is the closest according to the current strategy.static ZoomLevelSnapStrategy
Returns the enum constant of this class with the specified name.static ZoomLevelSnapStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CLOSEST_LOWER_SCALE_ON_TIE
Find the closest zoom level. If the targetScale is directly between two zoomLevels then the smaller/higher resolution scale will be chosen. -
CLOSEST_HIGHER_SCALE_ON_TIE
Find the closest zoom level. If the targetScale is directly between two zoomLevels then the larger/lower resolution scale will be chosen. -
HIGHER_SCALE
Always choose the zoom-level that is just higher than the target value. -
LOWER_SCALE
Always choose the zoom-level that is just lower than the target value.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
search
protected abstract ZoomLevelSnapStrategy.SearchResult search(Scale scale, double tolerance, ZoomLevels zoomLevels) Search the provided zoomLevels for the scale that is the closest according to the current strategy.- Parameters:
scale
- the reference scaletolerance
- the amount from one of the zoomLevels to still be considered at the scale. This is important for all strategies other than CLOSEST in order to prevent the scale from jumping to a different version even when it is very close to one of the zoomLevels.zoomLevels
- the allowed zoomLevels.
-