com.TwentyCodes.android.SkyHook
Class SkyHookUserOverlay

java.lang.Object
  extended by Overlay
      extended by com.TwentyCodes.android.SkyHook.SkyHookUserOverlay
All Implemented Interfaces:
XPSLocationListener

public class SkyHookUserOverlay
extends Overlay
implements XPSLocationListener

this class will be used to the users location on the map using skyhook's call back methods

Author:
ricky barrette

Field Summary
 boolean isFollowingUser
           
 
Constructor Summary
SkyHookUserOverlay(MapView mapView, Context context)
          Construct a new SkyHookUserOverlaymFollowUser
SkyHookUserOverlay(MapView mapView, Context context, boolean followUser)
          Construct a new SkyHookUserOverlay
 
Method Summary
 void disableMyLocation()
          Stops location updates and removes the overlay from view
 void draw(Canvas canvas, MapView mapView, boolean shadow)
          we override this methods so we can provide a drawable and a location to draw on the canvas.
 void enableMyLocation()
          Attempts to enable MyLocation, registering for updates from sky hook
 void followUser(boolean followUser)
          Allows the map to follow the user
 float getUserBearing()
          returns the users current bearing
 GeoPoint getUserLocation()
          returns the users current location
 void onAccuracyChanged(Sensor sensor, int accuracy)
          Called when the accuracy of a sensor has changed.
 void onSensorChanged(SensorEvent event)
          Called when sensor values have changed.
 void onXPSLocationChanged(GeoPoint point, int accuracy)
          called when the SkyHook location changes, this mthod is resposiable for updating the overlay location and accuracy circle.
 void registerListener(XPSLocationListener listener)
          Attempts to register the listener for location updates
 void unRegisterListener()
          UnResgisters the listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isFollowingUser

public boolean isFollowingUser
Constructor Detail

SkyHookUserOverlay

public SkyHookUserOverlay(MapView mapView,
                          Context context)
Construct a new SkyHookUserOverlaymFollowUser

Parameters:
mapView -
context -

SkyHookUserOverlay

public SkyHookUserOverlay(MapView mapView,
                          Context context,
                          boolean followUser)
Construct a new SkyHookUserOverlay

Parameters:
mapView -
context -
followUser -
Method Detail

disableMyLocation

public void disableMyLocation()
Stops location updates and removes the overlay from view


draw

public void draw(Canvas canvas,
                 MapView mapView,
                 boolean shadow)
we override this methods so we can provide a drawable and a location to draw on the canvas. (non-Javadoc)

Parameters:
canvas -
mapView -
shadow -
See Also:
Overlay

enableMyLocation

public void enableMyLocation()
Attempts to enable MyLocation, registering for updates from sky hook


followUser

public void followUser(boolean followUser)
Allows the map to follow the user

Parameters:
followUser -

getUserBearing

public float getUserBearing()
returns the users current bearing

Returns:

getUserLocation

public GeoPoint getUserLocation()
returns the users current location

Returns:

onAccuracyChanged

public void onAccuracyChanged(Sensor sensor,
                              int accuracy)
Called when the accuracy of a sensor has changed.

Parameters:
sensor -
accuracy -
See Also:
SensorEventListener

onXPSLocationChanged

public void onXPSLocationChanged(GeoPoint point,
                                 int accuracy)
called when the SkyHook location changes, this mthod is resposiable for updating the overlay location and accuracy circle. (non-Javadoc)

Specified by:
onXPSLocationChanged in interface XPSLocationListener
Parameters:
point -
accuracy -
See Also:
com.TwentyCodes.android.SkyHook.XPSLocationListener.location.LocationListener#onXPSLocationChanged(com.google.android.maps.GeoPoint, float)

onSensorChanged

public void onSensorChanged(SensorEvent event)
Called when sensor values have changed.

Parameters:
event -
See Also:
SensorEventListener

registerListener

public void registerListener(XPSLocationListener listener)
Attempts to register the listener for location updates

Parameters:
listener -

unRegisterListener

public void unRegisterListener()
UnResgisters the listener. after this call you will no longer get location updates