CartoType Android API 8.8-7-gb35e4dc71
for Java development on Android
|
Public Member Functions | |
Legend (Framework aFramework) | |
native void | clear () |
void | addMapObjectLine (int aObjectType, String aLayer, FeatureInfo aFeatureInfo, String aStringAttrib, String aLabel) |
native void | addTextLine (String aText) |
native void | addScaleLine (boolean aMetricUnits) |
native void | setMainStyleSheet (byte[] aData) |
native void | setExtraStyleSheet (byte[] aData) |
native void | setBackgroundColor (int aColor) |
native void | setBorder (int aColor, double aStrokeWidth, double aRadius, String aUnit) |
native void | setMarginWidth (double aMarginWidth, String aUnit) |
native void | setMinLineHeight (double aLineHeight, String aUnit) |
native void | setLabelWrapWidth (double aWrapWidth, String aUnit) |
native void | setFontFamily (String aFontFamily) |
native void | setFontSize (double aFontSize, String aUnit) |
native void | setTextColor (int aTextColor) |
native void | setDiagramColor (int aDiagramColor) |
void | setAlignment (Align aAlignment) |
native void | setPolygonRotation (double aDegrees) |
native boolean | hasTurnInstruction () |
native void | setTurnInstruction (String aText) |
native String | turnInstruction () |
The Legend class specifies legends or map keys showing sample map objects, with optional text lines and a scale.
Dimensions are specified with units, which may be "pt" (point), "pc" (pica), "cm" (centimetre), "mm" (millimetre), "in" (inch), or "px" (pixel). An empty or unrecognised unit is taken as "px".
To use a legend on a map, create a Legend object and pass it to Framework.setLegend().
com.cartotype.Legend.Legend | ( | Framework | aFramework | ) |
Creates a Legend object with the same fonts and style sheet as aFramework.
void com.cartotype.Legend.addMapObjectLine | ( | int | aObjectType, |
String | aLayer, | ||
FeatureInfo | aFeatureInfo, | ||
String | aStringAttrib, | ||
String | aLabel | ||
) |
Adds a line containing a map object, with an optional label to the left of it. If aFeatureInfo is null, uses the default feature info value (unknown non-route).
native void com.cartotype.Legend.addScaleLine | ( | boolean | aMetricUnits | ) |
Adds a scale bar line, using the current font family, font size, alignment, text color and minimum line height. If aMetricUnits is true kilometers and meters are used, otherwise miles and yards.
native void com.cartotype.Legend.addTextLine | ( | String | aText | ) |
Adds a line of text, using the current font family, font size, alignment, text color and minimum line height.
native void com.cartotype.Legend.clear | ( | ) |
Deletes all legend lines (map objects, text lines and scale bars).
native boolean com.cartotype.Legend.hasTurnInstruction | ( | ) |
Returns true if any of the lines of this legend object is a turn instruction.
void com.cartotype.Legend.setAlignment | ( | Align | aAlignment | ) |
Sets the alignment for labels and scale bars.
native void com.cartotype.Legend.setBackgroundColor | ( | int | aColor | ) |
Sets the background color. Transparent colors are allowed. Use Framework.Color() or the Framework color constants to create values for aTextColor.
native void com.cartotype.Legend.setBorder | ( | int | aColor, |
double | aStrokeWidth, | ||
double | aRadius, | ||
String | aUnit | ||
) |
Sets the border color and corner radius for the whole legend. Transparent border colors are allowed. Use Framework.Color() or the Framework color constants to create values for aTextColor.
native void com.cartotype.Legend.setDiagramColor | ( | int | aDiagramColor | ) |
Sets the diagram color, used for scale bars and turn diagrams, for subsequently added lines.
native void com.cartotype.Legend.setExtraStyleSheet | ( | byte[] | aData | ) |
Sets the extra style sheet.
The purpose of this function is to allow a caller such as a style sheet editor to create an extra style sheet containing a single layer, or a small number of layers, and draw a legend for that layer only.
native void com.cartotype.Legend.setFontFamily | ( | String | aFontFamily | ) |
Sets the font family for subsequently added lines.
native void com.cartotype.Legend.setFontSize | ( | double | aFontSize, |
String | aUnit | ||
) |
Sets the font size for subsequently added lines.
native void com.cartotype.Legend.setLabelWrapWidth | ( | double | aWrapWidth, |
String | aUnit | ||
) |
Sets the label wrap width for subsequently added lines. Values of zero or less prevent wrapping.
native void com.cartotype.Legend.setMainStyleSheet | ( | byte[] | aData | ) |
native void com.cartotype.Legend.setMarginWidth | ( | double | aMarginWidth, |
String | aUnit | ||
) |
Sets the margin width for the whole legend.
native void com.cartotype.Legend.setMinLineHeight | ( | double | aLineHeight, |
String | aUnit | ||
) |
Sets the minimum line height for subsequently added lines.
native void com.cartotype.Legend.setPolygonRotation | ( | double | aDegrees | ) |
Sets the amount in degrees by which rectangles drawn for polygon legend lines are rotated, for subsequently added lines.
native void com.cartotype.Legend.setTextColor | ( | int | aTextColor | ) |
Sets the text color for subsequently added lines. Use Framework.Color() or the Framework color constants to create values for aTextColor.
native void com.cartotype.Legend.setTurnInstruction | ( | String | aText | ) |
Sets the instruction to be displayed for the current turn, overriding automatically generated instructions. To revert to automatically generated instructions, call this function with empty text.
native String com.cartotype.Legend.turnInstruction | ( | ) |
Returns the instruction to be displayed for the current turn, overriding automatically generated instructions. Returns the empty string if automatically generated instructions are used and there is no overriding instruction.