@Api(allMethods=true) public class ScaleInfo extends Object implements IsInfo
| Modifier and Type | Field and Description |
|---|---|
static double |
MAXIMUM_PIXEL_PER_UNIT
A maximum pixelPerUnit value which is suitable for all purposes but avoids infinity and is in float range.
|
static double |
MINIMUM_PIXEL_PER_UNIT
A minimum pixelPerUnit value which is suitable for all purposes but avoids zero and is in float range.
|
static double |
PIXEL_PER_METER
Default conversion factor between map unit and pixel size (based on meter and 96 DPI).
|
| Constructor and Description |
|---|
ScaleInfo()
Default constructor for GWT serialization.
|
ScaleInfo(double pixelPerUnit)
Constructs a scale info object with the specified scale value.
|
ScaleInfo(double numerator,
double denominator)
Constructs a scale info object with the specified numerator and denominator values.
|
ScaleInfo(ScaleInfo other)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getConversionFactor()
Get the conversion factor between map units and pixel size.
|
double |
getDenominator()
Returns the denominator for a relative scale.
|
double |
getNumerator()
Returns the numerator for a relative scale.
|
double |
getPixelPerUnit()
Returns the scale value in pixel per map unit.
|
boolean |
isPixelPerUnitBased()
Returns whether this scale is based on pixel per unit.
|
void |
setConversionFactor(double conversionFactor)
Deprecated.
fixed to default (96 DPI) to avoid conflict with
ClientApplicationInfo.getScreenDpi() |
void |
setDenominator(double denominator)
Sets the denominator for a relative scale.
|
void |
setNumerator(double numerator)
Sets the numerator for a relative scale.
|
void |
setPixelPerUnit(double pixelPerUnit)
Sets the scale value in pixel per map unit.
|
void |
setPixelPerUnitBased(boolean pixelPerUnitBased)
Set this scale to be based on pixel per unit.
|
public static final double PIXEL_PER_METER
public static final double MINIMUM_PIXEL_PER_UNIT
public static final double MAXIMUM_PIXEL_PER_UNIT
public ScaleInfo()
public ScaleInfo(double pixelPerUnit)
pixelPerUnit - the scale value in pixel per map unit)public ScaleInfo(double numerator,
double denominator)
numerator - typically value is 1 or > 1 for large scalesdenominator - typically values are 100, 1000, ... or 1 for large scalespublic double getPixelPerUnit()
public void setPixelPerUnit(double pixelPerUnit)
pixelPerUnit - the scale value (pix/map unit)public boolean isPixelPerUnitBased()
pixelPerUnit
instead of nominator/denominator.public void setPixelPerUnitBased(boolean pixelPerUnitBased)
pixelPerUnit instead of
nominator/denominator.pixelPerUnitBased - true if based on pixelPerUnitpublic double getNumerator()
public void setNumerator(double numerator)
numerator - the numerator for a relative scalepublic double getDenominator()
public void setDenominator(double denominator)
denominator - the denominator for a relative scalepublic double getConversionFactor()
@Deprecated public void setConversionFactor(double conversionFactor)
ClientApplicationInfo.getScreenDpi()PIXEL_PER_METER.conversionFactor - the conversion factorCopyright © 2015 Geosparc. All Rights Reserved.