Package org.mapfish.print.attribute.map
Class ZoomLevels
java.lang.Object
org.mapfish.print.attribute.map.ZoomLevels
- All Implemented Interfaces:
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).
map: !map
zoomLevels: !zoomLevels
scales: [5000, 10000, 25000, 50000, 100000, 500000]
[[examples=datasource_many_dynamictables_legend]]-
Constructor Summary
ConstructorsConstructorDescriptiondefault constructor for constructing by spring.ZoomLevels
(double... scaleDenominators) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
get
(int index, DistanceUnit unit) Get the scale at the given index.double[]
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.toString()
void
validate
(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.
-
Constructor Details
-
ZoomLevels
public ZoomLevels(double... scaleDenominators) Constructor.- Parameters:
scaleDenominators
- do not need to be sorted or unique.
-
ZoomLevels
public ZoomLevels()default constructor for constructing by spring.
-
-
Method Details
-
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
Get the scale at the given index.- Parameters:
index
- the index of the zoom level to access.unit
- the unit.
-
toString
-
equals
-
hashCode
public int hashCode() -
validate
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.
-