/** * Get the minimum scale for which this layer should be visible (maximum zoom out). * * @return minimum scale (pix/map unit) * @deprecated use {@link #getMinimumScale()} */ @Deprecated public double getViewScaleMin() { return minimumScale.getPixelPerUnit(); }
/** * Get the maximum scale for which this layer should be visible (maximum zoom in). * * @return maximum scale (pix/map unit) * @deprecated use {@link #getMaximumScale()} */ @Deprecated public double getViewScaleMax() { return maximumScale.getPixelPerUnit(); }
/** * Get the list of supported resolutions for the layer. Each resolution is specified in map units per pixel. * * @return list of supported resolutions * @deprecated use {@link #getZoomLevels()} */ @Deprecated public List<Double> getResolutions() { List<Double> resolutions = new ArrayList<Double>(); for (ScaleInfo scale : getZoomLevels()) { resolutions.add(1. / scale.getPixelPerUnit()); } return resolutions; }
protected RangeConfig getRangeConfigForCurrentScale(ViewConfig viewConfig, double scale) { for (RangeConfig config : viewConfig.getRangeConfigs()) { double scaleMax = config.getMaximumScale().getPixelPerUnit(); double scaleMin = config.getMinimumScale().getPixelPerUnit(); if (scale <= scaleMax && scale >= scaleMin) { return config; } } return null; }
/** * Returns the maximum scale (maximum zoom in) of this map. The minimum scale is indirectly determined from the * maximum bounds. As a better alternative for this value, use {@link #getScaleConfiguration}. * * @return the maximum scale (pixels/unit) * @deprecated use {@link #getScaleConfiguration} */ @Deprecated public float getMaximumScale() { return (float) getScaleConfiguration().getMaximumScale().getPixelPerUnit(); }
protected FreeForAllZoomStrategy(ClientMapInfo mapInfo, Bbox maxBounds) { ScaleConfigurationInfo scaleConfigurationInfo = mapInfo.getScaleConfiguration(); maximumScale = scaleConfigurationInfo.getMaximumScale().getPixelPerUnit(); this.maxBounds = maxBounds; }
@Override public boolean isShowing() { if (markedAsVisible) { if (viewPort.getScale() >= layerInfo.getMinimumScale().getPixelPerUnit() && viewPort.getScale() <= layerInfo.getMaximumScale().getPixelPerUnit()) { return true; } } return false; } }
protected FixedStepZoomStrategy(ClientMapInfo mapInfo, Bbox maxBounds) { super(mapInfo, maxBounds); // Check for the existence of resolutions: if (mapInfo.getScaleConfiguration().getZoomLevels() == null || mapInfo.getScaleConfiguration().getZoomLevels().size() == 0) { throw new IllegalArgumentException("When using the FixedStepZoomStrategy, make sure that" + " the map configuration has defined at least one zoom level."); } // Get the full set of resolutions: scales = new ArrayList<Double>(); for (ScaleInfo scale : mapInfo.getScaleConfiguration().getZoomLevels()) { scales.add(scale.getPixelPerUnit()); } }
public TileServiceState(GeoService geoService, RasterLayerInfo layerInfo) { try { crs = geoService.getCrs2(layerInfo.getCrs()); } catch (LayerException e) { throw new IllegalStateException(e); } maxBounds = new Envelope(layerInfo.getMaxExtent().getX(), layerInfo.getMaxExtent().getMaxX(), layerInfo .getMaxExtent().getY(), layerInfo.getMaxExtent().getMaxY()); resolutions = new ArrayList<Double>(); if (layerInfo.getZoomLevels() != null) { for (ScaleInfo scale : layerInfo.getZoomLevels()) { resolutions.add(1. / scale.getPixelPerUnit()); } // Sort in decreasing order !!! Collections.sort(resolutions); Collections.reverse(resolutions); } tileWidth = layerInfo.getTileWidth(); tileHeight = layerInfo.getTileHeight(); }
/** * Copy constructor. Creates a deep copy of the specified {@link ScaleInfo} object. * * @param other the scale info to copy * @since 1.11.0 */ public ScaleInfo(ScaleInfo other) { setDenominator(other.getDenominator()); setNumerator(other.getNumerator()); setPixelPerUnit(other.getPixelPerUnit()); // must copy all state setPixelPerUnitBased(other.isPixelPerUnitBased()); }