Class RatioZoomContext

  • All Implemented Interfaces:
    ZoomContext

    public class RatioZoomContext
    extends ContinuousZoomContext
    implements ZoomContext
    ZoomContext defined by an initial scale and a ratio between levels.
    Author:
    Kevin Smith, Boundless
    • Constructor Detail

      • RatioZoomContext

        public RatioZoomContext​(double initialScale,
                                double ratio)
        Create a zoom context where zoom level 0 has a scale denominator of initial, and each subsequent level is ratio times that.
        Parameters:
        initialScale - scale denominator at level 0
        ratio - ratio between zoom levels
      • RatioZoomContext

        public RatioZoomContext​(int initialLevel,
                                double initialScale,
                                double ratio)
        Create a zoom context where zoom level initialLevel has a scale denominator of initial, and each subsequent level is ratio times that.
        Parameters:
        initialLevel - Level to use as initial
        initialScale - scale denominator at level initialLevel
        ratio - ratio between the scale at consecutive zoom levels. Zoom level z+1 has a scale ratio times that of z and a scale denominator 1/ratio times that of z.
    • Method Detail

      • getScaleDenominator

        protected double getScaleDenominator​(double level)
        Description copied from class: ContinuousZoomContext
        Find the reciprocal of the scale at a specified zoom level in this context.
        Specified by:
        getScaleDenominator in class ContinuousZoomContext
        Parameters:
        level - The level
        Returns:
        The scale denominator
      • isInRange

        public boolean isInRange​(int level)
        Description copied from interface: ZoomContext
        Is the given level within the range for which the context has clearly defined scales.
        Specified by:
        isInRange in interface ZoomContext