|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.maryanovsky.map.client.widgets.scale.EarthScale
public class EarthScale
Implements ScaleWidget.Scale
for maps of the planet earth. The earth
is modelled as a perfect sphere of its actual equatorial radius. This scale
is therefore imprecise, especially at locations far from the equator (but
it's good enough for most uses).
Field Summary | |
---|---|
static double |
EARTH_RADIUS_METERS
The equatorial radius of the earth in meters. |
Constructor Summary | |
---|---|
EarthScale(int preferredSize,
double[] sizes,
String[] sizeNames)
Creates a new EarthScale with the specified preferred pixel size,
array of possible sizes and their names. |
Method Summary | |
---|---|
static double |
getArcLength(LatLng loc1,
LatLng loc2)
Returns the angle of the shortest arc between the two specified locations, on a sphere of the given radius. |
static EarthScale |
getEnglishImperialInstance(int preferredSize)
Returns an instance of EarthScale which displays imperial sizes
in English. |
static EarthScale |
getEnglishMetricInstance(int preferredSize)
Returns an instance of EarthScale which displays metric sizes in
English. |
static double |
getMetersPerPixel(MapWidget mapWidget)
Returns the number of meters in a pixel displayed by the specified MapWidget . |
int |
getSizePixels(MapWidget mapWidget)
Returns the size of the displayed scale, in pixels, or 0
if the scale should not be displayed. |
String |
getSizeText(MapWidget mapWidget)
Returns the value displayed on the scale widget, or null
if the scale value should not be displayed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double EARTH_RADIUS_METERS
Constructor Detail |
---|
public EarthScale(int preferredSize, double[] sizes, String[] sizeNames)
EarthScale
with the specified preferred pixel size,
array of possible sizes and their names.
preferredSize
- The preferred size of the scale, in pixels.sizes
- The possible displayed sizes, in meters, in increasing
order.sizeNames
- The names of the possible displayed sizes, in the same
order as sizes.Method Detail |
---|
public static EarthScale getEnglishMetricInstance(int preferredSize)
EarthScale
which displays metric sizes in
English.
preferredSize
- The preferred size of the scale, in pixels.public static EarthScale getEnglishImperialInstance(int preferredSize)
EarthScale
which displays imperial sizes
in English.
preferredSize
- The preferred size of the scale, in pixels.public int getSizePixels(MapWidget mapWidget)
0
if the scale should not be displayed.
getSizePixels
in interface ScaleWidget.Scale
public String getSizeText(MapWidget mapWidget)
null
if the scale value should not be displayed.
getSizeText
in interface ScaleWidget.Scale
public static double getMetersPerPixel(MapWidget mapWidget)
MapWidget
. Returns 0 if unable to determine.
public static double getArcLength(LatLng loc1, LatLng loc2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |