Added getDestination() calls to retrive destination point from

CompassOverlay

Change-Id: I98a1d3f585a21faa5966c9718b84c75e94a84d24
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-03-11 18:11:57 -04:00
parent 411cba9d00
commit 86d34b501f
5 changed files with 50 additions and 18 deletions

Binary file not shown.

View File

@@ -40,6 +40,14 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
public void followUser(boolean followUser){ public void followUser(boolean followUser){
mUserOverlay.followUser(followUser); mUserOverlay.followUser(followUser);
} }
/**
* @return return the current destination
* @author ricky barrette
*/
public GeoPoint getDestination(){
return mUserOverlay.getDestination();
}
/** /**
* @return the users current location * @return the users current location
@@ -60,6 +68,12 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
mCompassListener.onCompassUpdate(bearing); mCompassListener.onCompassUpdate(bearing);
} }
@Override
public void onFirstFix(boolean isFistFix) {
if(mGeoPointLocationListener != null)
mGeoPointLocationListener.onFirstFix(isFistFix);
}
/** /**
* Called when has a location to report * Called when has a location to report
* @author ricky barrette * @author ricky barrette
@@ -84,7 +98,7 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
map.getOverlays().add(mUserOverlay); map.getOverlays().add(mUserOverlay);
} }
/** /**
* (non-Javadoc) * (non-Javadoc)
* @see com.TwentyCodes.android.fragments.MapFragmentBase#onPause() * @see com.TwentyCodes.android.fragments.MapFragmentBase#onPause()
@@ -136,7 +150,7 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
public void setCompassListener(CompassListener listener){ public void setCompassListener(CompassListener listener){
mCompassListener = listener; mCompassListener = listener;
} }
/** /**
* Sets the destination for the compass to point to * Sets the destination for the compass to point to
* @param destination * @param destination
@@ -153,10 +167,4 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
public void setGeoPointLocationListener(GeoPointLocationListener listener){ public void setGeoPointLocationListener(GeoPointLocationListener listener){
mGeoPointLocationListener = listener; mGeoPointLocationListener = listener;
} }
@Override
public void onFirstFix(boolean isFistFix) {
if(mGeoPointLocationListener != null)
mGeoPointLocationListener.onFirstFix(isFistFix);
}
} }

View File

@@ -40,6 +40,14 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
public void followUser(boolean followUser){ public void followUser(boolean followUser){
mUserOverlay.followUser(followUser); mUserOverlay.followUser(followUser);
} }
/**
* @return return the current destination
* @author ricky barrette
*/
public GeoPoint getDestination(){
return mUserOverlay.getDestination();
}
/** /**
* @return the users current location * @return the users current location
@@ -60,6 +68,12 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
mCompassListener.onCompassUpdate(bearing); mCompassListener.onCompassUpdate(bearing);
} }
@Override
public void onFirstFix(boolean isFistFix) {
if(mGeoPointLocationListener != null)
mGeoPointLocationListener.onFirstFix(isFistFix);
}
/** /**
* Called when skyhook has a location to report * Called when skyhook has a location to report
* @author ricky barrette * @author ricky barrette
@@ -69,7 +83,7 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
if(mGeoPointLocationListener != null) if(mGeoPointLocationListener != null)
mGeoPointLocationListener.onLocationChanged(point, accuracy); mGeoPointLocationListener.onLocationChanged(point, accuracy);
} }
/** /**
* (non-Javadoc) * (non-Javadoc)
* @see com.TwentyCodes.android.fragments.MapFragmentBase#onMapViewCreate(com.TwentyCodes.android.location.MapView) * @see com.TwentyCodes.android.fragments.MapFragmentBase#onMapViewCreate(com.TwentyCodes.android.location.MapView)
@@ -84,7 +98,7 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
map.getOverlays().add(mUserOverlay); map.getOverlays().add(mUserOverlay);
} }
/** /**
* (non-Javadoc) * (non-Javadoc)
* @see com.TwentyCodes.android.fragments.MapFragmentBase#onPause() * @see com.TwentyCodes.android.fragments.MapFragmentBase#onPause()
@@ -95,7 +109,7 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
mUserOverlay.disableMyLocation(); mUserOverlay.disableMyLocation();
removeOverlay(mUserOverlay); removeOverlay(mUserOverlay);
} }
/** /**
* (non-Javadoc) * (non-Javadoc)
* @see com.TwentyCodes.android.fragments.MapFragmentBase#onResume() * @see com.TwentyCodes.android.fragments.MapFragmentBase#onResume()
@@ -128,7 +142,7 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
public void setCompassDrawables(int needleResId, int backgroundResId, int x, int y){ public void setCompassDrawables(int needleResId, int backgroundResId, int x, int y){
mUserOverlay.setCompassDrawables(needleResId, backgroundResId, x, y); mUserOverlay.setCompassDrawables(needleResId, backgroundResId, x, y);
} }
/** /**
* @param listener * @param listener
* @author ricky barrette * @author ricky barrette
@@ -153,10 +167,4 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
public void setGeoPointLocationListener(GeoPointLocationListener listener){ public void setGeoPointLocationListener(GeoPointLocationListener listener){
mGeoPointLocationListener = listener; mGeoPointLocationListener = listener;
} }
@Override
public void onFirstFix(boolean isFistFix) {
if(mGeoPointLocationListener != null)
mGeoPointLocationListener.onFirstFix(isFistFix);
}
} }

View File

@@ -187,6 +187,14 @@ public class CompasOverlay extends Overlay implements CompassListener {
public float getBearing(){ public float getBearing(){
return mBearing; return mBearing;
} }
/**
* @return return the current destination
* @author ricky barrette
*/
public GeoPoint getDestination(){
return mDestination;
}
/** /**
* Called from the compass Sensor to update the current bearing * Called from the compass Sensor to update the current bearing

View File

@@ -311,6 +311,14 @@ public abstract class UserOverlayBase extends Overlay implements GeoPointLocatio
isFollowingUser = followUser; isFollowingUser = followUser;
} }
/**
* @return return the current destination
* @author ricky barrette
*/
public GeoPoint getDestination(){
return mCompass.getDestination();
}
/** /**
* returns the users current bearing * returns the users current bearing
* @return * @return