public class Polyline extends Shape
Modifier and Type | Class and Description |
---|---|
static interface |
Polyline.OnAltitudeModeChangedListener
Deprecated.
|
static interface |
Polyline.OnHeightStyleChangedListener |
static interface |
Polyline.OnLabelsChangedListener |
static interface |
Polyline.OnLabelTextSizeChanged |
Shape.OnBasicLineStyleChangedListener, Shape.OnFillColorChangedListener, Shape.OnPointsChangedListener, Shape.OnStrokeColorChangedListener, Shape.OnStrokeWeightChangedListener, Shape.OnStyleChangedListener
MapItem.OnClickableChangedListener, MapItem.OnGroupChangedListener, MapItem.OnHeightChangedListener, MapItem.OnMetadataChangedListener, MapItem.OnTypeChangedListener, MapItem.OnVisibleChangedListener, MapItem.OnZOrderChangedListener
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<GeoPointMetaData> |
_points |
static double |
DEFAULT_MAX_LABEL_RENDER_RESOLUTION
Maximum label render resolution for a polyline that is inside the render window.
|
static double |
DEFAULT_MAX_LINE_RENDER_RESOLUTION
The maximum line render resolution for a Polyline.
|
static double |
DEFAULT_MIN_LABEL_RENDER_RESOLUTION
Minimum label render resolution for a polyline that is inside the render window.
|
static double |
DEFAULT_MIN_LINE_RENDER_RESOLUTION
The minimum line render resolution for a Polyline.
|
static int |
HEIGHT_EXTRUDE_CENTER_ALT
Methods for how to extrude the shape's height (mutually exclusive)
|
static int |
HEIGHT_EXTRUDE_DEFAULT
Methods for how to extrude the shape's height (mutually exclusive)
|
static int |
HEIGHT_EXTRUDE_MAX_ALT
Methods for how to extrude the shape's height (mutually exclusive)
|
static int |
HEIGHT_EXTRUDE_MIN_ALT
Methods for how to extrude the shape's height (mutually exclusive)
|
static int |
HEIGHT_EXTRUDE_PER_POINT
Methods for how to extrude the shape's height (mutually exclusive)
|
static int |
HEIGHT_STYLE_NONE
Height styles (bit masks)
|
static int |
HEIGHT_STYLE_OUTLINE
Height styles (bit masks)
|
static int |
HEIGHT_STYLE_OUTLINE_SIMPLE
Height styles (bit masks)
|
static int |
HEIGHT_STYLE_POLYGON
Height styles (bit masks)
|
static int |
HEIGHT_STYLE_TOP_ONLY
Height styles (bit masks)
|
protected MutableGeoBounds |
minimumBoundingBox |
static int |
PARTITION_SIZE |
static int |
STYLE_CLOSED_MASK
A line will be drawn from the last point to the first and the STYLE_SHAPE_FILLED_MASK will
take effect (if exists)
|
static int |
STYLE_OUTLINE_HALO_MASK
Adds a halo around the polyline with the same color that was used in the stroke.
|
static int |
STYLE_OUTLINE_STROKE_MASK
Adds a thin black outline on the stroke line which increases visual distinction.
|
BASIC_LINE_STYLE_DASHED, BASIC_LINE_STYLE_DOTTED, BASIC_LINE_STYLE_OUTLINED, BASIC_LINE_STYLE_SOLID, STYLE_FILLED_MASK, STYLE_STROKE_MASK
CLICKABLE_DEFAULT, EDITABLE_DEFAULT, EMPTY_TYPE, HIT_RATIO_DEFAULT, MOVABLE_DEFAULT, VISIBLE_DEFAULT, ZORDER_DEFAULT, ZORDER_HITTEST_COMPARATOR, ZORDER_RENDER_COMPARATOR
metadata
Constructor and Description |
---|
Polyline(long serialId,
MetaDataHolder metadata,
java.lang.String uid) |
Polyline(java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
void |
addHeightStyle(int heightStyleBit)
Add a single height style bit to this shape
Example:
HEIGHT_STYLE_OUTLINE |
void |
addOnHeightStyleChangedListener(Polyline.OnHeightStyleChangedListener l) |
void |
addOnLabelsChangedListener(Polyline.OnLabelsChangedListener listener) |
void |
addOnLabelTextSizeChangedListener(Polyline.OnLabelTextSizeChanged listener) |
void |
drawCanvas(CapturePP cap,
android.os.Bundle data)
Draw the item to the canvas
|
GeoBounds |
getBounds(MutableGeoBounds bounds)
The bounds of the shape
|
GeoPointMetaData |
getCenter()
Provides the center point for the Shape, or null if an error has occurred.
|
int |
getHeightExtrudeMode()
Get the height extrusion mode
See
setHeightExtrudeMode(int) |
int |
getHeightStyle()
Get the height rendering style for this shape
|
java.util.Map<java.lang.String,java.lang.Object> |
getLabels() |
int |
getLabelTextSize()
Gets the text size to use for the rendering label
convenience method for getting label size meta
|
android.graphics.Typeface |
getLabelTypeface() |
java.lang.String |
getLineLabel() |
GeoPointMetaData[] |
getMetaDataPoints()
Get the points property value
|
double |
getPerimeterOrLength()
Returns the perimeter of a shape if closed otherwise will return the length of
of the open shape from start to end.
|
GeoPoint[] |
getPoints()
Get the points property value
|
GeoPoint[] |
getPoints(GeoPoint[] points) |
GeoPointMetaData[] |
getPoints(GeoPointMetaData[] points)
Get the points property value
|
void |
getRelativeBounds(MutableGeoBounds bounds)
Returns the bounds relative to the center of the shape.
|
double |
getTotalDistance() |
protected void |
onHeightStyleChanged() |
protected void |
onLabelsChanged() |
protected void |
onLabelTextSizeChanged() |
protected void |
onMetadataChanged(java.lang.String key)
Invoked when the metadata property changes
|
protected void |
onPointsChanged() |
android.os.Bundle |
preDrawCanvas(CapturePP cap)
Save forwarded points to meta data holder
These will be used later in drawCanvas
|
void |
removeHeightStyle(int heightStyleBit)
Remove a single height style bit from this shape
|
void |
removeOnHeightStyleChangedListener(Polyline.OnHeightStyleChangedListener l) |
void |
removeOnLabelsChangedListener(Polyline.OnLabelsChangedListener listener) |
void |
removeOnLabelTextSizeChangedListner(Polyline.OnLabelTextSizeChanged listener) |
void |
setHeightExtrudeMode(int mode)
Set how the height is extruded off the shape
Mode can be one of the following:
HEIGHT_EXTRUDE_DEFAULT Extrude based on shape properties
HEIGHT_EXTRUDE_MIN_ALT Extrude off the minimum point elevation
HEIGHT_EXTRUDE_MAX_ALT Extrude off the maximum point elevation
HEIGHT_EXTRUDE_CENTER_ALT Extrude off the center point elevation
HEIGHT_EXTRUDE_PER_POINT Extrude off each point's elevation |
void |
setHeightStyle(int heightStyle)
Set the height rendering style for this shape
Example:
HEIGHT_STYLE_POLYGON | HEIGHT_STYLE_OUTLINE |
void |
setLabels(java.util.Map<java.lang.String,java.lang.Object> labels) |
void |
setLabelTextSize(int labelTextSize)
Sets the text size to use for the rendering label
convenience method for setting label size meta
|
void |
setLabelTextSize(int labelTextSize,
android.graphics.Typeface typeface)
Sets the text size and typeface to use for the rendering label
|
void |
setLabelTextTypeface(android.graphics.Typeface typeface)
Gets the text typeface to use for the rendering label
|
void |
setLineLabel(java.lang.String label)
Set the floating line label for this polyline
Not to be confused with individual segment labels
|
void |
setMaxLabelRenderResolution(double d)
Convenience method for setting the maximum label render resolution.
|
void |
setMaxRenderResolution(double d)
Convenience method for setting the maximum label render resolution.
|
void |
setMinLabelRenderResolution(double d)
Convenience method for setting the minimum label render resolution.
|
void |
setMinRenderResolution(double d)
Convenience method for setting the minimum label render resolution.
|
void |
setPoints(GeoPoint[] points)
Set the points for the polyline.
|
void |
setPoints(GeoPoint[] points,
int off,
int len)
Given an array of points points, set the sub array defined by offset and length
as the points for the Polyine.
|
void |
setPoints(GeoPointMetaData[] points)
Set the points for the polyline.
|
void |
setPoints(GeoPointMetaData[] points,
int off,
int len)
Given an array of metadata enhanced points, set the sub array defined by offset and length
as the points for the Polyine.
|
addOnBasicLineStyleChangedListener, addOnFillColorChangedListener, addOnPointsChangedListener, addOnStrokeColorChangedListener, addOnStrokeWeightChangedListener, addOnStyleChangedListener, addStyleBits, findTouchPoint, getArea, getBasicLineStyle, getClickPoint, getFillColor, getGeoPointMetaData, getIconColor, getStrokeColor, getStrokeStyle, getStrokeWeight, getStyle, getTitle, onBasicLineStyleChanged, onFillColorChanged, onStrokeColorChanged, onStrokeStyleChanged, onStrokeWeightChanged, onStyleChanged, removeOnBasicLineStyleChangedListener, removeOnFillColorChangedListener, removeOnPointsChangedListener, removeOnStrokeColorChangedListener, removeOnStrokeWeightChangedListener, removeOnStyleChangedListener, removeStyleBits, setBasicLineStyle, setColor, setColor, setFillAlpha, setFillColor, setStrokeColor, setStrokeStyle, setStrokeWeight, setStyle, setTitle, setTouchPoint, wrap180
addOnAltitudeModeChangedListener, addOnClickableChangedListener, addOnGroupChangedListener, addOnHeightChangedListener, addOnMetadataChangedListener, addOnMetadataChangedListener, addOnTypeChangedListener, addOnVisibleChangedListener, addOnZOrderChangedListener, computeDistance, copyMetaData, createSerialId, dispose, getAltitudeMode, getClickable, getEditable, getGroup, getHashtags, getHeight, getHitRadius, getIconDrawable, getMetaBoolean, getMetaString, getMovable, getRadialMenuPath, getRemarks, getRemarksKey, getSerialId, getTag, getType, getUID, getUniqueMapItemName, getURI, getVisible, getVisible, getZOrder, isTouchable, notifyMetadataChanged, onAdded, onAltitudeModeChanged, onClickableChanged, onGroupChanged, onHeightChanged, onRemoved, onTypeChanged, onVisibilityConditions, onVisibleChanged, onZOrderChanged, persist, refresh, removeFromGroup, removeMetaData, removeOnAltitudeModeChangedListener, removeOnClickableChangedListener, removeOnGroupChangedListener, removeOnHeightChangedListener, removeOnMetadataChangedListener, removeOnMetadataChangedListener, removeOnTypeChangedListener, removeOnVisibleChangedListener, removeOnZOrderChangedListener, setAltitudeMode, setClickable, setClickPoint, setEditable, setHashtags, setHeight, setMetaBoolean, setMetaData, setMetaDouble, setMetaIntArray, setMetaInteger, setMetaLong, setMetaMap, setMetaParcelable, setMetaSerializable, setMetaString, setMetaStringArrayList, setMovable, setRadialMenu, setRemarks, setTag, setTouchable, setType, setVisible, setVisible, setZOrder, testOrthoHit, toString
get, getMetaData, getMetaDouble, getMetaIntArray, getMetaInteger, getMetaLong, getMetaMap, getMetaParcelable, getMetaSerializable, getMetaStringArrayList, hasMetaValue, setMetaDataImpl, toggleMetaData
public static final double DEFAULT_MIN_LINE_RENDER_RESOLUTION
public static final double DEFAULT_MAX_LINE_RENDER_RESOLUTION
public static final double DEFAULT_MIN_LABEL_RENDER_RESOLUTION
public static final double DEFAULT_MAX_LABEL_RENDER_RESOLUTION
public static final int STYLE_CLOSED_MASK
public static final int STYLE_OUTLINE_STROKE_MASK
public static final int STYLE_OUTLINE_HALO_MASK
public static final int HEIGHT_STYLE_NONE
public static final int HEIGHT_STYLE_POLYGON
public static final int HEIGHT_STYLE_OUTLINE
public static final int HEIGHT_STYLE_OUTLINE_SIMPLE
public static final int HEIGHT_STYLE_TOP_ONLY
public static final int HEIGHT_EXTRUDE_DEFAULT
public static final int HEIGHT_EXTRUDE_MIN_ALT
public static final int HEIGHT_EXTRUDE_MAX_ALT
public static final int HEIGHT_EXTRUDE_CENTER_ALT
public static final int HEIGHT_EXTRUDE_PER_POINT
public static final int PARTITION_SIZE
protected final java.util.ArrayList<GeoPointMetaData> _points
protected final MutableGeoBounds minimumBoundingBox
public Polyline(java.lang.String uid)
public Polyline(long serialId, MetaDataHolder metadata, java.lang.String uid)
public GeoPointMetaData[] getPoints(GeoPointMetaData[] points)
points
- the array to use on return if large enough (or not null)public GeoPoint[] getPoints()
public GeoPoint[] getPoints(GeoPoint[] points)
public GeoPointMetaData[] getMetaDataPoints()
getMetaDataPoints
in class Shape
public void setPoints(GeoPointMetaData[] points)
points
- the array of pointsjava.lang.IllegalArgumentException
- if one of the points is not validpublic void setPoints(GeoPoint[] points)
points
- the array of points, cannot be null.java.lang.IllegalArgumentException
- if one of the points is not validpublic void setPoints(GeoPoint[] points, int off, int len)
points
- lat/lon/altoff
- the offset into the points arraylen
- the length to be used within the points array.java.lang.IllegalArgumentException
- if one of the points is not validpublic void setPoints(GeoPointMetaData[] points, int off, int len)
points
- metadata enhanced pointsoff
- the offset into the points arraylen
- the length to be used within the points array.java.lang.IllegalArgumentException
- if one of the points is not validprotected void onPointsChanged()
onPointsChanged
in class Shape
public GeoPointMetaData getCenter()
Shape
public double getTotalDistance()
public double getPerimeterOrLength()
Shape
getPerimeterOrLength
in class Shape
public void setLabels(java.util.Map<java.lang.String,java.lang.Object> labels)
public java.util.Map<java.lang.String,java.lang.Object> getLabels()
public void addOnLabelTextSizeChangedListener(Polyline.OnLabelTextSizeChanged listener)
public void removeOnLabelTextSizeChangedListner(Polyline.OnLabelTextSizeChanged listener)
public void addOnLabelsChangedListener(Polyline.OnLabelsChangedListener listener)
public void removeOnLabelsChangedListener(Polyline.OnLabelsChangedListener listener)
protected void onLabelsChanged()
protected void onLabelTextSizeChanged()
public void addOnHeightStyleChangedListener(Polyline.OnHeightStyleChangedListener l)
public void removeOnHeightStyleChangedListener(Polyline.OnHeightStyleChangedListener l)
protected void onHeightStyleChanged()
public void setHeightStyle(int heightStyle)
HEIGHT_STYLE_POLYGON
| HEIGHT_STYLE_OUTLINE
heightStyle
- Height style bit flagspublic int getHeightStyle()
public void addHeightStyle(int heightStyleBit)
HEIGHT_STYLE_OUTLINE
heightStyleBit
- Height style bitpublic void removeHeightStyle(int heightStyleBit)
heightStyleBit
- Height style bitpublic void setHeightExtrudeMode(int mode)
HEIGHT_EXTRUDE_DEFAULT
Extrude based on shape properties
HEIGHT_EXTRUDE_MIN_ALT
Extrude off the minimum point elevation
HEIGHT_EXTRUDE_MAX_ALT
Extrude off the maximum point elevation
HEIGHT_EXTRUDE_CENTER_ALT
Extrude off the center point elevation
HEIGHT_EXTRUDE_PER_POINT
Extrude off each point's elevationmode
- Extrusion modepublic int getHeightExtrudeMode()
setHeightExtrudeMode(int)
public GeoBounds getBounds(MutableGeoBounds bounds)
Shape
public void getRelativeBounds(MutableGeoBounds bounds)
bounds
- The bounds relative to the center of the shape.public void setLabelTextSize(int labelTextSize)
labelTextSize
- the int value size to use on the default formatpublic int getLabelTextSize()
public void setLabelTextSize(int labelTextSize, android.graphics.Typeface typeface)
labelTextSize
- the int value size to use on the default formattypeface
- the typeface graphic to use to draw the label textpublic void setLabelTextTypeface(android.graphics.Typeface typeface)
typeface
- the typeface graphic to use to draw the label textpublic android.graphics.Typeface getLabelTypeface()
public void setLineLabel(java.lang.String label)
label
- Line labelpublic java.lang.String getLineLabel()
protected void onMetadataChanged(java.lang.String key)
MapItem
onMetadataChanged
in class MapItem
key
- Metadata key that has been changedpublic android.os.Bundle preDrawCanvas(CapturePP cap)
Capturable
preDrawCanvas
in interface Capturable
preDrawCanvas
in class Shape
cap
- Capture instance (use forward() to convert)public void drawCanvas(CapturePP cap, android.os.Bundle data)
Capturable
drawCanvas
in interface Capturable
drawCanvas
in class Shape
cap
- Canvas to draw to (use getCanvas())data
- Point data saved in preDrawCanvaspublic void setMinLabelRenderResolution(double d)
d
- the double value set in resolution meters per pixel.public void setMaxLabelRenderResolution(double d)
d
- the double value set in resolution meters per pixel.public void setMinRenderResolution(double d)
d
- the double value set in resolution meters per pixel.public void setMaxRenderResolution(double d)
d
- the double value set in resolution meters per pixel.