com.ls.widgets.map.location
Class PositionMarker

java.lang.Object
  extended by com.ls.widgets.map.model.MapObject
      extended by com.ls.widgets.map.location.PositionMarker

public class PositionMarker
extends MapObject


Constructor Summary
PositionMarker(MapWidget context, java.lang.Object id, Drawable roundPointerDrawable, Drawable arrowPointerDrawable)
           
 
Method Summary
 void draw(Canvas canvas)
          Draws the map object on the canvas
 Rect getBounds()
          Returns bounds of the image that represents the map object.
 void setAccuracy(float accuracy)
          Sets the size of accuracy area.
 void setArrowPointer(Drawable arrowPointer, Point pivotPoint)
           
 void setBearing(float bearing)
          Rotates the position pointer by some degree.
 void setBearingEnabled(boolean hasBearing)
          Enables show direction mode.
 void setColor(int area, int border)
          Sets the color of accuracy area and border.
 void setDotPointer(Drawable dotPointer, Point pivotPoint)
           
 
Methods inherited from class com.ls.widgets.map.model.MapObject
equals, getDrawable, getId, getPosition, getX, getXScaled, getY, getYScaled, hashCode, isTouchable, isTouched, moveTo, moveTo, setDrawable, setPivotPoint, setPivotPoint
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositionMarker

public PositionMarker(MapWidget context,
                      java.lang.Object id,
                      Drawable roundPointerDrawable,
                      Drawable arrowPointerDrawable)
Method Detail

setColor

public void setColor(int area,
                     int border)
Sets the color of accuracy area and border.

Parameters:
color - - Color

setAccuracy

public void setAccuracy(float accuracy)
Sets the size of accuracy area.

Parameters:
accuracy - - accuracy in meters. You can get this value from android.location.Location
See Also:
android.location.Location

setBearing

public void setBearing(float bearing)
Rotates the position pointer by some degree. In order for this method to take effect you should call GpsPositionMarker.setBearingEnabled(true)

Parameters:
bearing - - GPS bearing angle value in degrees. You can get it from android.location.Location object.

setDotPointer

public void setDotPointer(Drawable dotPointer,
                          Point pivotPoint)

setArrowPointer

public void setArrowPointer(Drawable arrowPointer,
                            Point pivotPoint)

setBearingEnabled

public void setBearingEnabled(boolean hasBearing)
Enables show direction mode.

Parameters:
hasBearing - - true to show movement direction of false otherwise.

getBounds

public Rect getBounds()
Description copied from class: MapObject
Returns bounds of the image that represents the map object. Note: for efficiency, the returned object may be the same object stored in the drawable (though this is not guaranteed), so if a persistent copy of the bounds is needed, call copyBounds(rect) instead. You should also not change the object returned by this method as it may be the same object stored in the drawable.

Overrides:
getBounds in class MapObject
Returns:
instance of Rect with size of the image in pixels taking the scale of the map into account.

draw

public void draw(Canvas canvas)
Description copied from class: MapObject
Draws the map object on the canvas

Overrides:
draw in class MapObject
Parameters:
canvas - - Canvas