public class Polyline extends OverlayWithIW
Modifier and Type | Class and Description |
---|---|
static interface |
Polyline.OnClickListener |
Overlay.Snappable
Modifier and Type | Field and Description |
---|---|
protected static InfoWindow |
mDefaultInfoWindow |
protected Polyline.OnClickListener |
mOnClickListener |
mInfoWindow, mRelatedObject, mSnippet, mSubDescription, mTitle
mBounds, SHADOW_X_SKEW, SHADOW_Y_SCALE
DEFAULT_ZOOMLEVEL_MINIMAP_DIFFERENCE, NOT_SET
Constructor and Description |
---|
Polyline()
highly suggested that you provide context, if MapView is not provided or is null
info window popups will not function unless you handle it yourself
|
Polyline(MapView mapView)
highly suggested that you provide MapView , if MapView is not provided or is null
info window popups will not function unless you handle it yourself
|
Modifier and Type | Method and Description |
---|---|
protected void |
addGreatCircle(GeoPoint startPoint,
GeoPoint endPoint,
int numberOfPoints) |
protected void |
addPoint(GeoPoint aPoint) |
protected void |
addPoint(int aLatitudeE6,
int aLongitudeE6)
Deprecated.
|
protected void |
clearPath() |
void |
draw(Canvas canvas,
MapView mapView,
boolean shadow)
Draw the overlay over the map.
|
int |
getColor() |
String |
getId() |
GeoPoint |
getInfoWindowAnchorPoint(GeoPoint eventPos)
returns a point that the info window cartoon bubble will point at.
|
int |
getNumberOfPoints() |
Paint |
getPaint() |
List<GeoPoint> |
getPoints() |
float |
getWidth() |
boolean |
isCloseTo(GeoPoint point,
double tolerance,
MapView mapView)
Detection is done is screen coordinates.
|
boolean |
isGeodesic() |
boolean |
isVisible() |
protected boolean |
onClickDefault(Polyline polyline,
MapView mapView,
GeoPoint eventPos)
default behaviour when no click listener is set
|
void |
onDetach(MapView mapView)
Override to perform clean up of resources before shutdown.
|
boolean |
onSingleTapConfirmed(MotionEvent event,
MapView mapView)
By default does nothing (
return false ). |
void |
setColor(int color) |
void |
setGeodesic(boolean geodesic)
Sets whether to draw each segment of the line as a geodesic or not.
|
void |
setId(String id) |
void |
setInfoWindow(InfoWindow infoWindow)
Set the InfoWindow to be used.
|
void |
setInfoWindowLocation(GeoPoint location)
Sets the info window's cartoon bubble point to this location
|
void |
setMilestoneManagers(List<MilestoneManager> pMilestoneManagers) |
void |
setOnClickListener(Polyline.OnClickListener listener) |
void |
setPoints(List<GeoPoint> points)
Set the points.
|
void |
setVisible(boolean visible) |
void |
setWidth(float width) |
void |
showInfoWindow(GeoPoint position) |
closeInfoWindow, getInfoWindow, getRelatedObject, getSnippet, getSubDescription, getTitle, isInfoWindowOpen, onDestroy, setRelatedObject, setSnippet, setSubDescription, setTitle
drawAt, getBounds, getSafeMenuId, getSafeMenuIdSequence, isEnabled, onDoubleTap, onDoubleTapEvent, onDown, onFling, onKeyDown, onKeyUp, onLongPress, onPause, onResume, onScroll, onShowPress, onSingleTapUp, onTouchEvent, onTrackballEvent, setEnabled
protected static InfoWindow mDefaultInfoWindow
protected Polyline.OnClickListener mOnClickListener
public Polyline()
public Polyline(MapView mapView)
protected void clearPath()
protected void addPoint(GeoPoint aPoint)
@Deprecated protected void addPoint(int aLatitudeE6, int aLongitudeE6)
public int getNumberOfPoints()
public int getColor()
public float getWidth()
public Paint getPaint()
public boolean isVisible()
public boolean isGeodesic()
public void setColor(int color)
public void setWidth(float width)
public void setVisible(boolean visible)
public void setOnClickListener(Polyline.OnClickListener listener)
protected void addGreatCircle(GeoPoint startPoint, GeoPoint endPoint, int numberOfPoints)
public void setPoints(List<GeoPoint> points)
public void setGeodesic(boolean geodesic)
public void draw(Canvas canvas, MapView mapView, boolean shadow)
Overlay
public boolean isCloseTo(GeoPoint point, double tolerance, MapView mapView)
point
- tolerance
- in pixelspublic void setInfoWindow(InfoWindow infoWindow)
setInfoWindow
in class OverlayWithIW
infoWindow
- the InfoWindow to be opened when tapping the overlay.
This InfoWindow MUST be able to handle an OverlayWithIW (as BasicInfoWindow does).
Set it to null to remove an existing InfoWindow.public void showInfoWindow(GeoPoint position)
public boolean onSingleTapConfirmed(MotionEvent event, MapView mapView)
Overlay
return false
). If you handled the Event, return true
, otherwise return false
. If you returned true
none of the following Overlays
or the underlying MapView
has the chance to handle this event.onSingleTapConfirmed
in class Overlay
public GeoPoint getInfoWindowAnchorPoint(GeoPoint eventPos)
eventPos
- public void setInfoWindowLocation(GeoPoint location)
location
- public String getId()
public void setId(String id)
id
- protected boolean onClickDefault(Polyline polyline, MapView mapView, GeoPoint eventPos)
public void onDetach(MapView mapView)
Overlay
public void setMilestoneManagers(List<MilestoneManager> pMilestoneManagers)