Package org.geotools.ysld.parse
Class RatioZoomContext
- Object
-
- MedialZoomContext
-
- ContinuousZoomContext
-
- 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
-
-
Field Summary
-
Fields inherited from interface ZoomContext
HINT_ID
-
-
Constructor Summary
Constructors Constructor Description RatioZoomContext(double initialScale, double ratio)
Create a zoom context where zoom level 0 has a scale denominator ofinitial
, and each subsequent level isratio
times that.RatioZoomContext(int initialLevel, double initialScale, double ratio)
Create a zoom context where zoom levelinitialLevel
has a scale denominator ofinitial
, and each subsequent level isratio
times that.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
getMedialScale(int level)
Get a scale between the given zoom level and the nextprotected double
getScaleDenominator(double level)
Find the reciprocal of the scale at a specified zoom level in this context.boolean
isInRange(int level)
Is the given level within the range for which the context has clearly defined scales.-
Methods inherited from class ContinuousZoomContext
getScaleDenominator
-
Methods inherited from class MedialZoomContext
getRange
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ZoomContext
getRange, getScaleDenominator
-
-
-
-
Constructor Detail
-
RatioZoomContext
public RatioZoomContext(double initialScale, double ratio)
Create a zoom context where zoom level 0 has a scale denominator ofinitial
, and each subsequent level isratio
times that.- Parameters:
initialScale
- scale denominator at level 0ratio
- ratio between zoom levels
-
RatioZoomContext
public RatioZoomContext(int initialLevel, double initialScale, double ratio)
Create a zoom context where zoom levelinitialLevel
has a scale denominator ofinitial
, and each subsequent level isratio
times that.- Parameters:
initialLevel
- Level to use as initialinitialScale
- scale denominator at levelinitialLevel
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 classContinuousZoomContext
- Parameters:
level
- The level- Returns:
- The scale denominator
-
getMedialScale
protected double getMedialScale(int level)
Description copied from class:ContinuousZoomContext
Get a scale between the given zoom level and the next- Overrides:
getMedialScale
in classContinuousZoomContext
-
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 interfaceZoomContext
-
-