Package org.mapfish.print.attribute.map
Class ZoomLevels
- java.lang.Object
-
- org.mapfish.print.attribute.map.ZoomLevels
-
- All Implemented Interfaces:
ConfigurationObject
public final class ZoomLevels extends java.lang.Object implements ConfigurationObject
Encapsulates a sorted set of scale denominators representing the allowed scales.The scales are sorted from largest to smallest and the index starts at 0, where 0 is the largest scale (most zoomed out).
[[examples=datasource_many_dynamictables_legend]]map: !map zoomLevels: !zoomLevels scales: [5000, 10000, 25000, 50000, 100000, 500000]
-
-
Constructor Summary
Constructors Constructor Description ZoomLevels()
default constructor for constructing by spring.ZoomLevels(double... scaleDenominators)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Scale
get(int index, DistanceUnit unit)
Get the scale at the given index.double[]
getScaleDenominators()
Return a copy of the zoom level scale denominators.int
hashCode()
void
setScales(double[] newScaleDenominators)
Set the scales (sorts from largest to smallest).int
size()
The number of zoom levels.java.lang.String
toString()
void
validate(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
validate that the configuration was correct.
-
-
-
Method Detail
-
setScales
public void setScales(double[] newScaleDenominators)
Set the scales (sorts from largest to smallest).- Parameters:
newScaleDenominators
- The scales (may be unsorted).
-
size
public int size()
The number of zoom levels.
-
get
public Scale get(int index, DistanceUnit unit)
Get the scale at the given index.- Parameters:
index
- the index of the zoom level to access.unit
- the unit.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
validate
public void validate(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
Description copied from interface:ConfigurationObject
validate that the configuration was correct.- Specified by:
validate
in interfaceConfigurationObject
- Parameters:
validationErrors
- a list to add any detected errors to.configuration
- the containing configuration
-
getScaleDenominators
public double[] getScaleDenominators()
Return a copy of the zoom level scale denominators. Scales are sorted greatest to least.
-
-