public class ScaleBarOverlay extends SafeDrawOverlay implements GeoConstants
Overlay.Snappable
Modifier and Type | Field and Description |
---|---|
protected android.graphics.Picture |
scaleBarPicture |
int |
screenHeight |
int |
screenWidth |
float |
xdpi |
float |
ydpi |
mResourceProxy, mScale, SHADOW_X_SKEW, SHADOW_Y_SCALE
EQUATORCIRCUMFENCE, FEET_PER_METER, METERS_PER_NAUTICAL_MILE, METERS_PER_STATUTE_MILE, RADIUS_EARTH_METERS
DEBUGMODE, DEFAULT_ZOOMLEVEL_MINIMAP_DIFFERENCE, NOT_SET
Constructor and Description |
---|
ScaleBarOverlay(android.content.Context context) |
ScaleBarOverlay(android.content.Context context,
ResourceProxy pResourceProxy) |
Modifier and Type | Method and Description |
---|---|
void |
disableScaleBar() |
void |
drawLatitudeScale(boolean latitude)
Latitudinal / horizontal scale bar flag
|
void |
drawLongitudeScale(boolean longitude)
Longitudinal / vertical scale bar flag
|
void |
drawSafe(ISafeCanvas c,
MapView mapView,
boolean shadow) |
void |
enableScaleBar() |
android.graphics.Paint |
getBarPaint()
Return's the paint used to draw the bar
|
android.graphics.Paint |
getTextPaint()
Returns the paint used to draw the text
|
protected String |
scaleBarLengthText(int meters,
boolean imperial,
boolean nautical) |
void |
setBackgroundPaint(android.graphics.Paint pBgPaint)
Sets the background paint.
|
void |
setBarPaint(android.graphics.Paint pBarPaint)
Sets the paint for drawing the bar
|
void |
setCentred(boolean centred)
Flag to draw the bar centered around the set offset coordinates or to the right/bottom of the coordinates (default)
|
void |
setEnableAdjustLength(boolean adjustLength)
If enabled, the bar will automatically adjust the length to reflect a round number (starting
with 1, 2 or 5).
|
void |
setImperial()
Sets the length to be shown in imperial units (mi/ft)
|
void |
setLineWidth(float width)
Sets the bar's line width.
|
void |
setMaxLength(float pMaxLengthInCm)
Sets the maximum bar length.
|
void |
setMetric()
Sets the length to be shown in metric units (km/m)
|
void |
setMinZoom(int zoom)
Sets the minimum zoom level for the scale bar to be drawn.
|
void |
setNautical()
Sets the length to be shown in nautical units (nm/ft)
|
void |
setScaleBarOffset(float x,
float y)
Sets the scale bar screen offset for the bar.
|
void |
setTextPaint(android.graphics.Paint pTextPaint)
Sets the paint for drawing the text
|
void |
setTextSize(float size)
Sets the text size.
|
draw, isUsingSafeCanvas, setUseSafeCanvas
drawAt, getSafeMenuId, getSafeMenuIdSequence, isEnabled, onDetach, onDoubleTap, onDoubleTapEvent, onDown, onFling, onKeyDown, onKeyUp, onLongPress, onScroll, onShowPress, onSingleTapConfirmed, onSingleTapUp, onTouchEvent, onTrackballEvent, setEnabled
protected final android.graphics.Picture scaleBarPicture
public float xdpi
public float ydpi
public int screenWidth
public int screenHeight
public ScaleBarOverlay(android.content.Context context)
public ScaleBarOverlay(android.content.Context context, ResourceProxy pResourceProxy)
public void setMinZoom(int zoom)
minimum
- zoom levelpublic void setScaleBarOffset(float x, float y)
x
- x screen offsety
- z screen offsetpublic void setLineWidth(float width)
width
- the new line widthpublic void setTextSize(float size)
size
- the new text sizepublic void setImperial()
public void setNautical()
public void setMetric()
public void drawLatitudeScale(boolean latitude)
latitude
- public void drawLongitudeScale(boolean longitude)
longitude
- public void setCentred(boolean centred)
centred
- set true to centre the bar around the given screen coordinatespublic android.graphics.Paint getBarPaint()
public void setBarPaint(android.graphics.Paint pBarPaint)
pBarPaint
- bar drawing paintpublic android.graphics.Paint getTextPaint()
public void setTextPaint(android.graphics.Paint pTextPaint)
pTextPaint
- text drawing paintpublic void setBackgroundPaint(android.graphics.Paint pBgPaint)
pBgPaint
- the paint for colouring the bar backgroundpublic void setEnableAdjustLength(boolean adjustLength)
public void setMaxLength(float pMaxLengthInCm)
pMaxLengthInCm
- maximum length of the bar in the screen in cm. Default is 2.54 (=1 inch)public void drawSafe(ISafeCanvas c, MapView mapView, boolean shadow)
drawSafe
in class SafeDrawOverlay
public void disableScaleBar()
public void enableScaleBar()
protected String scaleBarLengthText(int meters, boolean imperial, boolean nautical)
Copyright © 2014. All Rights Reserved.