public class Route extends EditablePolyline
Modifier and Type | Class and Description |
---|---|
static class |
Route.ControlPointMapItem
A lighter weight PointMapItem capable of sharing metadata across the entire route.
|
static interface |
Route.OnRouteDirectionChangedListener |
static interface |
Route.OnRouteMethodChangedListener |
static interface |
Route.OnRouteOrderChangedListener |
static interface |
Route.OnRoutePointsChangedListener
Route changed listener
|
static interface |
Route.OnRouteTypeChangedListener |
class |
Route.RouteAddSegment |
static class |
Route.RouteDirection |
static class |
Route.RouteMethod |
static class |
Route.RouteOrder |
class |
Route.RouteSetCueAction |
class |
Route.RouteSetPointName |
static class |
Route.RouteType |
EditablePolyline.ActionProviderInterface, EditablePolyline.ExchangePointAction, EditablePolyline.InsertPointAction, EditablePolyline.MovePointAction, EditablePolyline.OnEditableChangedListener, EditablePolyline.RemoveMarkerAction, EditablePolyline.RemovePointAction
Polyline.OnAltitudeModeChangedListener, Polyline.OnHeightStyleChangedListener, Polyline.OnLabelsChangedListener, 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 |
---|---|
static java.lang.String |
CONTROLPOINT_TYPE |
static int |
DEFAULT_ROUTE_COLOR |
static double |
DEFAULT_STROKE_WEIGHT |
static double |
EDITABLE_STROKE_WEIGHT |
static double |
NAVIGATING_STROKE_WEIGHT |
static java.lang.String |
WAYPOINT_TYPE |
_actionProvider, _shapeMarker, context, controlPoints, indexToMarker, indexToMarker2, mapView, markerToIndex
_points, DEFAULT_MAX_LABEL_RENDER_RESOLUTION, DEFAULT_MAX_LINE_RENDER_RESOLUTION, DEFAULT_MIN_LABEL_RENDER_RESOLUTION, DEFAULT_MIN_LINE_RENDER_RESOLUTION, HEIGHT_EXTRUDE_CENTER_ALT, HEIGHT_EXTRUDE_DEFAULT, HEIGHT_EXTRUDE_MAX_ALT, HEIGHT_EXTRUDE_MIN_ALT, HEIGHT_EXTRUDE_PER_POINT, HEIGHT_STYLE_NONE, HEIGHT_STYLE_OUTLINE, HEIGHT_STYLE_OUTLINE_SIMPLE, HEIGHT_STYLE_POLYGON, HEIGHT_STYLE_TOP_ONLY, minimumBoundingBox, PARTITION_SIZE, STYLE_CLOSED_MASK, STYLE_OUTLINE_HALO_MASK, STYLE_OUTLINE_STROKE_MASK
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
Modifier | Constructor and Description |
---|---|
protected |
Route(MapView mapView,
long serialId,
MetaDataHolder metadata,
java.lang.String uid) |
|
Route(MapView mapView,
java.lang.String routeName,
int color,
java.lang.String prefix,
java.lang.String uid) |
|
Route(MapView mapView,
java.lang.String routeName,
int color,
java.lang.String prefix,
java.lang.String uid,
boolean addGrouplessWaypointsToGroup) |
Modifier and Type | Method and Description |
---|---|
boolean |
addMarkers(int index,
java.util.List<PointMapItem> items)
Given a list of PointMapItems, add them using a bulk add method.
|
boolean |
addMarkers(int index,
PointMapItem[] items)
Optimized method for bulk-adding markers to a Route
|
void |
addOnRouteDirectionChangedListener(Route.OnRouteDirectionChangedListener listener)
Add a route direction changed listener
|
void |
addOnRouteMethodChangedListener(Route.OnRouteMethodChangedListener listener)
Add a route method changed listener
|
void |
addOnRouteOrderChangedListener(Route.OnRouteOrderChangedListener listener)
Add a route order changed listener
|
void |
addOnRoutePointsChangedListener(Route.OnRoutePointsChangedListener listener)
Add a route points changed listener
|
void |
addOnRouteTypeChangedListener(Route.OnRouteTypeChangedListener listener)
Add a route type changed listener
|
boolean |
addPoint(GeoPointMetaData point) |
boolean |
addPoint(int index,
GeoPointMetaData point) |
void |
clearPoints() |
static boolean |
compare(Route route1,
Route route2)
Compares two routes to determine if they're identical.
|
static PointMapItem |
createControlPoint(GeoPoint geoPoint)
Creates a ControlPoint marker with a random uid.
|
static PointMapItem |
createControlPoint(GeoPoint geoPoint,
java.lang.String uid)
Creates a ControlPoint marker with an assigned uid.
|
static Marker |
createWayPoint(GeoPointMetaData geoPoint,
java.lang.String uid)
Creates a waypoint marker.
|
PointMapItem[] |
getContactPoints() |
protected java.lang.String |
getCornerMenu()
Provides a shape menu to be used when the shape corner is touched.
|
NavigationCue |
getCueForPoint(java.lang.String uid)
Gets the cue associated with the point with the given UID.
|
java.lang.String |
getFirstWaypointName() |
java.lang.String |
getLastWaypointName() |
protected java.lang.String |
getLineMenu()
Provides a shape menu to be used when the shape line is touched.
|
double |
getMaximumDistance(PointMapItem refPoint)
Finds the farthest point distance, within this route, to the reference point.
|
double |
getMinimumDistance(PointMapItem refPoint)
Finds the closest point distance, within this route, to the reference point.
|
java.util.Map<java.lang.String,NavigationCue> |
getNavigationCues()
Gets a copy of the map associating cues with route points by UID.
|
PointMapItem |
getNextWaypoint(int index)
Get the next waypoint after the given index
|
java.lang.String |
getNextWaypointName() |
int |
getNumWaypoint() |
java.lang.String |
getPlanningMethod() |
java.lang.String |
getPrefix() |
java.util.List<java.lang.String[]> |
getRouteDetails()
Returns a list of arrays that describe the route details where the array is as described:
[0] - callsign (set last)
[1] - distance in miles
[2] - distance in kilometers
[3] - elevation change
[4] - uid
|
Route.RouteDirection |
getRouteDirection() |
Route.RouteMethod |
getRouteMethod() |
Route.RouteOrder |
getRouteOrder() |
Route.RouteType |
getRouteType() |
protected java.lang.String |
getShapeMenu()
Provides a shape menu to be used when the shape is touched.
|
java.lang.String |
getTransportationType() |
java.lang.String |
getWaypointUID(int waypointNumber) |
boolean |
isClosed() |
boolean |
isReversedDir() |
static boolean |
isRouteDirection(java.lang.String direction) |
static boolean |
isRouteMethod(java.lang.String method) |
static boolean |
isRouteOrder(java.lang.String order) |
static boolean |
isRouteType(java.lang.String type) |
void |
onPointsChanged() |
protected void |
onRoutePointsChanged()
Notifies listeners that a point's changed
|
void |
refresh(MapEventDispatcher d,
android.os.Bundle b,
java.lang.Class<?> clazz)
Dispatches a refresh event for the MapItem.
|
boolean |
removeMarker(int index) |
boolean |
removeMarker(PointMapItem item) |
protected PointMapItem |
removeMarkerNoSync(int index) |
NavigationCue |
removeNavigationCueForPoint(java.lang.String uid)
Clears all navigation cues associated with the point with the given UID.
|
void |
removeOnRouteDirectionChangedListener(Route.OnRouteDirectionChangedListener listener)
Remove a route Direction changed listener
|
void |
removeOnRouteMethodChangedListener(Route.OnRouteMethodChangedListener listener)
Remove a route Method changed listener
|
void |
removeOnRouteOrderChangedListener(Route.OnRouteOrderChangedListener listener)
Remove a route Order changed listener
|
void |
removeOnRoutePointsChangedListener(Route.OnRoutePointsChangedListener listener)
Remove a route points changed listener
|
void |
removeOnRouteTypeChangedListener(Route.OnRouteTypeChangedListener listener)
Remove a route Type changed listener
|
void |
removePoint(int index) |
java.util.List<PointMapItem> |
removePoints(int start,
int end)
Remove multiple points from route
|
void |
setClosed(boolean closed) |
void |
setEditable(boolean editable)
Styles this route to indicate that it's the currently editable route, and also makes it's
invisible handles visible so they can be interacted with.
|
void |
setFillColor(int color)
Set the fillColor property value
|
void |
setMarker(int pointIndex,
PointMapItem item) |
protected void |
setMarkerNoSync(int index,
PointMapItem item) |
void |
setNavigating(boolean state)
During navigation only show the navigation flag.
|
void |
setNavigationCueForPoint(java.lang.String uid,
NavigationCue cue)
Associates a NavigationCue for a point in the route with the given UID.
|
void |
setNavigationCues(java.util.Map<java.lang.String,NavigationCue> cues) |
void |
setPlanningMethod(java.lang.String method)
See enum PlanningMethod
|
boolean |
setPoint(int index,
GeoPointMetaData point,
boolean skipIfEquals)
Set a point in this polyline
|
java.lang.String |
setPrefix(java.lang.String value) |
void |
setRouteDirection(java.lang.String direction)
See enum RouteDirection.
|
void |
setRouteMethod(java.lang.String method)
See enum RouteMethod
|
void |
setRouteOrder(java.lang.String order)
See enum RouteOrder
|
void |
setRouteType(java.lang.String type)
See enum RouteType
|
void |
setTitle(java.lang.String title)
Set the title of this map item (display name)
|
void |
setTransportationType(java.lang.String transportationType) |
void |
setZOrder(double zOrder)
Set the ascending order of the MapItem.
|
protected CotEvent |
toCot()
Produce a CoT message that represents the Route
|
protected GPXExportWrapper |
toGpx() |
protected Folder |
toKml() |
protected KMZFolder |
toKmz() |
addListeners, addMarker, addMarker, addOnEditableChangedListener, addPointNoSync, clear, clearPointsImpl, clearWithoutNotify, createKmlGeometry, createOuterPlacemark, delete, determineIfFilled, drawCanvas, getActionProvider, getAnchorItem, getAvgAltitude, getCenter, getColor, getEditable, getFilled, getIndexOfMarker, getIndexOfPoint, getLineStyle, getMarker, getMarker, getMaxAltitude, getMinAltitude, getNumPoints, getPoint, getPointMapItem, getPointMapItemArray, getPointMapItems, getShapeMarker, getTitle, getUIDKey, getUndoable, hasMarker, hideLabels, isBulkOperation, isSupported, kmlDataList, kmlFolderName, moveClosedSet, onItemAdded, onItemRemoved, onVisibleChanged, onZOrderChanged, preDrawCanvas, removeListeners, removeMarker, removeMarker, removeOnEditableChangedListener, resetAlpha, reverse, setAbsoluteKMLElev, setAlpha, setBulkOperation, setClickable, setColor, setFilled, setLineStyle, setLocked, setPoint, setPoints, setShapeMarker, setStrokeColor, setStrokeWeight, setUndoable, shouldDisplayVertices, testLinesHit, testLinesHit, testPointsHit, toObjectOf
addHeightStyle, addOnHeightStyleChangedListener, addOnLabelsChangedListener, addOnLabelTextSizeChangedListener, getBounds, getHeightExtrudeMode, getHeightStyle, getLabels, getLabelTextSize, getLabelTypeface, getLineLabel, getMetaDataPoints, getPerimeterOrLength, getPoints, getPoints, getPoints, getRelativeBounds, getTotalDistance, onHeightStyleChanged, onLabelsChanged, onLabelTextSizeChanged, onMetadataChanged, removeHeightStyle, removeOnHeightStyleChangedListener, removeOnLabelsChangedListener, removeOnLabelTextSizeChangedListner, setHeightExtrudeMode, setHeightStyle, setLabels, setLabelTextSize, setLabelTextSize, setLabelTextTypeface, setLineLabel, setMaxLabelRenderResolution, setMaxRenderResolution, setMinLabelRenderResolution, setMinRenderResolution, setPoints, setPoints, setPoints, setPoints
addOnBasicLineStyleChangedListener, addOnFillColorChangedListener, addOnPointsChangedListener, addOnStrokeColorChangedListener, addOnStrokeWeightChangedListener, addOnStyleChangedListener, addStyleBits, findTouchPoint, getArea, getBasicLineStyle, getClickPoint, getFillColor, getGeoPointMetaData, getIconColor, getStrokeColor, getStrokeStyle, getStrokeWeight, getStyle, onBasicLineStyleChanged, onFillColorChanged, onStrokeColorChanged, onStrokeStyleChanged, onStrokeWeightChanged, onStyleChanged, removeOnBasicLineStyleChangedListener, removeOnFillColorChangedListener, removeOnPointsChangedListener, removeOnStrokeColorChangedListener, removeOnStrokeWeightChangedListener, removeOnStyleChangedListener, removeStyleBits, setBasicLineStyle, setColor, setFillAlpha, setStrokeStyle, setStyle, setTouchPoint, wrap180
addOnAltitudeModeChangedListener, addOnClickableChangedListener, addOnGroupChangedListener, addOnHeightChangedListener, addOnMetadataChangedListener, addOnMetadataChangedListener, addOnTypeChangedListener, addOnVisibleChangedListener, addOnZOrderChangedListener, computeDistance, copyMetaData, createSerialId, dispose, getAltitudeMode, getClickable, 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, onZOrderChanged, persist, removeFromGroup, removeMetaData, removeOnAltitudeModeChangedListener, removeOnClickableChangedListener, removeOnGroupChangedListener, removeOnHeightChangedListener, removeOnMetadataChangedListener, removeOnMetadataChangedListener, removeOnTypeChangedListener, removeOnVisibleChangedListener, removeOnZOrderChangedListener, setAltitudeMode, setClickPoint, setHashtags, setHeight, setMetaBoolean, setMetaData, setMetaDouble, setMetaIntArray, setMetaInteger, setMetaLong, setMetaMap, setMetaParcelable, setMetaSerializable, setMetaString, setMetaStringArrayList, setMovable, setRadialMenu, setRemarks, setTag, setTouchable, setType, setVisible, setVisible, testOrthoHit, toString
get, getMetaData, getMetaDouble, getMetaIntArray, getMetaInteger, getMetaLong, getMetaMap, getMetaParcelable, getMetaSerializable, getMetaStringArrayList, hasMetaValue, setMetaDataImpl, toggleMetaData
public static final java.lang.String WAYPOINT_TYPE
public static final java.lang.String CONTROLPOINT_TYPE
public static final double DEFAULT_STROKE_WEIGHT
public static final double EDITABLE_STROKE_WEIGHT
public static final double NAVIGATING_STROKE_WEIGHT
public static final int DEFAULT_ROUTE_COLOR
protected Route(MapView mapView, long serialId, MetaDataHolder metadata, java.lang.String uid)
public Route(MapView mapView, java.lang.String routeName, int color, java.lang.String prefix, java.lang.String uid, boolean addGrouplessWaypointsToGroup)
public Route(MapView mapView, java.lang.String routeName, int color, java.lang.String prefix, java.lang.String uid)
public void setFillColor(int color)
Shape
setFillColor
in class EditablePolyline
color
- An argb packed Color
public void setClosed(boolean closed)
setClosed
in class EditablePolyline
public boolean isClosed()
isClosed
in class EditablePolyline
public void setZOrder(double zOrder)
MapItem
setZOrder
in class EditablePolyline
public void refresh(MapEventDispatcher d, android.os.Bundle b, java.lang.Class<?> clazz)
MapItem
refresh
in class MapItem
d
- The event dispatcherb
- An optional bundle of extras to be sent with the event; may be
null
See MapEvent.ITEM_REFRESH
public java.lang.String getPrefix()
public java.lang.String setPrefix(java.lang.String value)
public void addOnRoutePointsChangedListener(Route.OnRoutePointsChangedListener listener)
listener
- the listenerpublic void removeOnRoutePointsChangedListener(Route.OnRoutePointsChangedListener listener)
listener
- the listenerpublic void addOnRouteMethodChangedListener(Route.OnRouteMethodChangedListener listener)
listener
- the listenerpublic void addOnRouteDirectionChangedListener(Route.OnRouteDirectionChangedListener listener)
listener
- the listenerpublic void addOnRouteTypeChangedListener(Route.OnRouteTypeChangedListener listener)
listener
- the listenerpublic void addOnRouteOrderChangedListener(Route.OnRouteOrderChangedListener listener)
listener
- the listenerpublic void setEditable(boolean editable)
EditablePolyline
setEditable
in class EditablePolyline
editable
- Whether editable styling should be enabled or disabled.public void setNavigating(boolean state)
public void removeOnRouteMethodChangedListener(Route.OnRouteMethodChangedListener listener)
listener
- the listenerpublic void removeOnRouteDirectionChangedListener(Route.OnRouteDirectionChangedListener listener)
listener
- the listenerpublic void removeOnRouteTypeChangedListener(Route.OnRouteTypeChangedListener listener)
listener
- the listenerpublic void removeOnRouteOrderChangedListener(Route.OnRouteOrderChangedListener listener)
listener
- the listenerprotected void onRoutePointsChanged()
public PointMapItem getNextWaypoint(int index)
index
- Current waypoint indexpublic void removePoint(int index)
removePoint
in class EditablePolyline
public boolean removeMarker(PointMapItem item)
removeMarker
in class EditablePolyline
public boolean removeMarker(int index)
removeMarker
in class EditablePolyline
protected PointMapItem removeMarkerNoSync(int index)
removeMarkerNoSync
in class EditablePolyline
public void clearPoints()
clearPoints
in class EditablePolyline
public boolean addPoint(GeoPointMetaData point)
addPoint
in class EditablePolyline
public boolean addPoint(int index, GeoPointMetaData point)
addPoint
in class EditablePolyline
public boolean addMarkers(int index, PointMapItem[] items)
addMarkers
in class EditablePolyline
index
- Starting indexitems
- List of markers to addpublic boolean addMarkers(int index, java.util.List<PointMapItem> items)
index
- the index where to start the insertion which must be greater than or equal to zero.items
- the array of point map items to add.public java.util.List<PointMapItem> removePoints(int start, int end)
start
- Start index (must be >= 0)end
- End index (exclusive; must be <= point count)public void onPointsChanged()
onPointsChanged
in class EditablePolyline
public void setNavigationCueForPoint(java.lang.String uid, NavigationCue cue)
uid
- UID of the point map item on the route to associate the cue withcue
- Cue to associate with pointpublic void setNavigationCues(java.util.Map<java.lang.String,NavigationCue> cues)
public NavigationCue removeNavigationCueForPoint(java.lang.String uid)
uid
- UID of the point to clearpublic NavigationCue getCueForPoint(java.lang.String uid)
uid
- UID of pointpublic java.util.Map<java.lang.String,NavigationCue> getNavigationCues()
protected void setMarkerNoSync(int index, PointMapItem item)
setMarkerNoSync
in class EditablePolyline
public boolean setPoint(int index, GeoPointMetaData point, boolean skipIfEquals)
EditablePolyline
setPoint
in class EditablePolyline
index
- Point indexpoint
- Point locationskipIfEquals
- True to skip operation if the point hasn't changedprotected java.lang.String getCornerMenu()
EditablePolyline
getCornerMenu
in class EditablePolyline
protected java.lang.String getLineMenu()
EditablePolyline
getLineMenu
in class EditablePolyline
protected java.lang.String getShapeMenu()
EditablePolyline
getShapeMenu
in class EditablePolyline
public void setMarker(int pointIndex, PointMapItem item)
setMarker
in class EditablePolyline
public void setTitle(java.lang.String title)
MapItem
setTitle
in class EditablePolyline
title
- Item titlepublic java.lang.String getTransportationType()
public void setTransportationType(java.lang.String transportationType)
public int getNumWaypoint()
public static boolean isRouteMethod(java.lang.String method)
public void setRouteMethod(java.lang.String method)
public Route.RouteMethod getRouteMethod()
public static boolean isRouteDirection(java.lang.String direction)
public void setRouteDirection(java.lang.String direction)
public Route.RouteDirection getRouteDirection()
public boolean isReversedDir()
public static boolean isRouteType(java.lang.String type)
public void setRouteType(java.lang.String type)
public Route.RouteType getRouteType()
public void setPlanningMethod(java.lang.String method)
public java.lang.String getPlanningMethod()
public static boolean isRouteOrder(java.lang.String order)
public void setRouteOrder(java.lang.String order)
public Route.RouteOrder getRouteOrder()
public java.lang.String getLastWaypointName()
public java.lang.String getFirstWaypointName()
public java.lang.String getNextWaypointName()
public java.lang.String getWaypointUID(int waypointNumber)
public java.util.List<java.lang.String[]> getRouteDetails()
public double getMinimumDistance(PointMapItem refPoint)
refPoint
- The reference point.public double getMaximumDistance(PointMapItem refPoint)
refPoint
- The reference point.public static boolean compare(Route route1, Route route2)
route1
- The first route to compare.route2
- The second route to compare.public static Marker createWayPoint(GeoPointMetaData geoPoint, java.lang.String uid)
geoPoint
- public static PointMapItem createControlPoint(GeoPoint geoPoint)
geoPoint
- public static PointMapItem createControlPoint(GeoPoint geoPoint, java.lang.String uid)
geoPoint
- uid
- protected CotEvent toCot()
EditablePolyline
toCot
in class EditablePolyline
protected Folder toKml()
toKml
in class EditablePolyline
protected KMZFolder toKmz()
toKmz
in class EditablePolyline
protected GPXExportWrapper toGpx()
toGpx
in class EditablePolyline
public PointMapItem[] getContactPoints()