org.mapfish.print.attribute.map.ZoomToFeatures Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of print-lib Show documentation
Show all versions of print-lib Show documentation
Library for generating PDFs and images from online webmapping services
package org.mapfish.print.attribute.map;
import org.mapfish.print.parser.HasDefaultValue;
/**
* Zoom the map to the features of a specific layer or all features of the map.
*/
public class ZoomToFeatures {
private static final int DEFAULT_ZOOM_TO_MIN_MARGIN = 10;
/**
* The zoom type. Possible values:
*
* extent
(default): Set the extent of the map so that all features
* are visible.
* center
: Set the center of the map to the center of the extent
* of the features.
*
*/
@HasDefaultValue
public ZoomType zoomType = ZoomType.EXTENT;
/**
* The name of the layer whose features will be used. If not set, the features of all vector layers will
* be used.
*/
@HasDefaultValue
public String layer;
/**
* The minimum scale that the map is zoomed to.
*/
@HasDefaultValue
public Double minScale;
/**
* The minimum margin (in px) from the features to the map border (default: 10).
*/
@HasDefaultValue
public Integer minMargin = DEFAULT_ZOOM_TO_MIN_MARGIN;
/**
* Make a copy.
*/
public final ZoomToFeatures copy() {
ZoomToFeatures obj = new ZoomToFeatures();
obj.zoomType = this.zoomType;
obj.minScale = this.minScale;
obj.minMargin = this.minMargin;
return obj;
}
/**
* The zoom type.
*/
public enum ZoomType {
/**
* Set the center of the map to the center of the extent of the features.
*/
CENTER,
/**
* Set the extent of the map so that all features are visible.
*/
EXTENT
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy