/** Finish configuration. */ @PostConstruct protected void postConstruct() { if (null == zoomToPointScale) { zoomToPointScale = new ScaleInfo(maximumScale); } }
/** * Set the minimum scale for which this layer should be visible (maximum zoom out). * * @param viewScaleMin * scale (pix/map unit) * @deprecated use {@link #setMinimumScale(ScaleInfo)}} */ @Deprecated public void setViewScaleMin(double viewScaleMin) { setMinimumScale(new ScaleInfo(viewScaleMin)); }
/** * Set the maximum scale for which this layer should be visible (maximum zoom in). * * @param viewScaleMax * scale (pix/map unit) * @deprecated use {@link #setMaximumScale(ScaleInfo)} */ @Deprecated public void setViewScaleMax(double viewScaleMax) { setMaximumScale(new ScaleInfo(viewScaleMax)); }
/** * Set the list of supported resolutions. Each resolution is specified in map units per pixel. * * @param resolutions * resolutions * @deprecated use {@link #setZoomLevels()} */ @Deprecated public void setResolutions(List<Double> resolutions) { getZoomLevels().clear(); for (Double resolution : resolutions) { getZoomLevels().add(new ScaleInfo(1. / resolution)); } }
/** * Set maximum scale (maximum zoom in) of this map. As a better alternative for this value, use * {@link #getScaleConfiguration}. * * @param maximumScale * the maximum scale (pixels/unit) * @deprecated use {@link #setScaleConfiguration} */ @Deprecated public void setMaximumScale(float maximumScale) { getScaleConfiguration().setMaximumScale(new ScaleInfo((double) maximumScale)); }
/** * Transforms a TMS tile-set description object into a Geomajas {@link ScaleInfo} object. * * @param tileSet * The tile set description. * @return The default Geomajas scale object. */ public ScaleInfo asScaleInfo(TileSet tileSet) { ScaleInfo scaleInfo = new ScaleInfo(); scaleInfo.setPixelPerUnit(1 / tileSet.getUnitsPerPixel()); return scaleInfo; } }
public static ScaleInfo stringToScale(String value) { NumberFormat numberFormat = NumberFormat.getFormat("###,###"); String[] scale2 = value.split(":"); ScaleInfo si; if (scale2.length == 1) { si = new ScaleInfo(1D, numberFormat.parse(scale2[0].trim())); } else { si = new ScaleInfo(numberFormat.parse(scale2[0].trim()), numberFormat.parse(scale2[1].trim())); } si.setPixelPerUnit(si.getNumerator() / si.getDenominator() * PPM); return si; }