MapFragmentBase.java

added convince methods

UserOverlayBase.java
added convince methods

UserOverlayMapFragment.java
added convince methods

SkyHoookUserOverlayMapFragment.java
added convince methods
This commit is contained in:
2012-01-12 17:10:04 +00:00
parent 51e03d9d9d
commit fdc21f6afe
41 changed files with 133 additions and 18 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -32,6 +32,31 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
super();
}
/**
* disables the GPS dialog
* @author ricky barrette
*/
public void disableGPSDialog(){
mUserOverlay.disableGPSDialog();
}
/**
* enables the GPS dialog
* @author ricky barrette
*/
public void enableGPSDialog(){
mUserOverlay.enableGPSDialog();
}
/**
* Tells the useroverlay to pan the map to follow the user
* @param followUser
* @author ricky barrette
*/
public void followUser(boolean followUser){
mUserOverlay.followUser(followUser);
}
/**
* @return the users current location
* @author ricky barrette
@@ -39,7 +64,7 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
public GeoPoint getUserLocation() {
return mUserOverlay.getUserLocation();
}
/**
* Called when the compass is updated
* (non-Javadoc)
@@ -60,7 +85,7 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
if(mGeoPointLocationListener != null)
mGeoPointLocationListener.onLocationChanged(point, accuracy);
}
/**
* (non-Javadoc)
* @see com.TwentyCodes.android.location.MapFragmentBase#onMapViewCreate(com.TwentyCodes.android.location.MapView)
@@ -83,22 +108,42 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
*/
@Override
public void onPause() {
super.onPause();
mUserOverlay.disableMyLocation();
removeOverlay(mUserOverlay);
super.onPause();
}
/**
* (non-Javadoc)
* @see com.TwentyCodes.android.location.MapFragmentBase#onResume()
*/
@Override
public void onResume() {
super.onResume();
if(mUserOverlay != null)
mUserOverlay.enableMyLocation();
super.onResume();
}
/**
* reorders the overlays to the UserOverlay always on top
* @author ricky barrette
*/
public void reorderOverlays() {
getMap().getOverlays().remove(mUserOverlay);
getMap().getOverlays().add(mUserOverlay);
}
/**
* @param needleResId
* @param backgroundResId
* @param x
* @param y
* @author ricky barrette
*/
public void setCompassDrawables(int needleResId, int backgroundResId, int x, int y){
mUserOverlay.setCompassDrawables(needleResId, backgroundResId, x, y);
}
/**
* @param listener
* @author ricky barrette
@@ -115,7 +160,7 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
public void setDestination(GeoPoint destination){
mUserOverlay.setDestination(destination);
}
/**
* @param listener
* @author ricky barrette

View File

@@ -13,6 +13,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.Overlay;
/**
* This map fragment will maintain a map view and all its functions
@@ -30,7 +31,27 @@ public abstract class MapFragmentBase extends Fragment {
public MapFragmentBase() {
super();
}
public void addOverlay(Overlay overlay){
mMapView.getOverlays().add(overlay);
}
/**
* changes the map mode
* @author ricky barrette
*/
public void changeMapMode() {
mMapView.setSatellite(!mMapView.isSatellite());
}
/**
* @return mapview
* @author ricky barrette
*/
public MapView getMap(){
return mMapView;
}
/**
* Called when the fragment view is first created
* (non-Javadoc)
@@ -60,7 +81,7 @@ public abstract class MapFragmentBase extends Fragment {
* @param overlay
* @author ricky barrette
*/
protected void removeOverlay(Object overlay){
public void removeOverlay(Object overlay){
mMapView.getOverlays().remove(overlay);
}
@@ -69,7 +90,10 @@ public abstract class MapFragmentBase extends Fragment {
* @param point
* @author ricky barrette
*/
public void setMapCenter(GeoPoint point){
public boolean setMapCenter(GeoPoint point){
if(point == null)
return false;
mMapView.getController().setCenter(point);
return true;
}
}

View File

@@ -300,6 +300,8 @@ public abstract class UserOverlayBase extends Overlay implements GeoPointLocatio
/**
* Enables the Acquiring GPS dialog if the location has not been acquired
*
* TODO fix funtion
* @author ricky barrette
*/
public void enableGPSDialog(){

View File

@@ -28,6 +28,31 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
super();
}
/**
* disables the GPS dialog
* @author ricky barrette
*/
public void disableGPSDialog(){
mUserOverlay.disableGPSDialog();
}
/**
* enables the GPS dialog
* @author ricky barrette
*/
public void enableGPSDialog(){
mUserOverlay.enableGPSDialog();
}
/**
* Tells the useroverlay to pan the map to follow the user
* @param followUser
* @author ricky barrette
*/
public void followUser(boolean followUser){
mUserOverlay.followUser(followUser);
}
/**
* @return the users current location
* @author ricky barrette
@@ -35,7 +60,7 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
public GeoPoint getUserLocation() {
return mUserOverlay.getUserLocation();
}
/**
* Called when the compass is updated
* (non-Javadoc)
@@ -56,7 +81,7 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
if(mGeoPointLocationListener != null)
mGeoPointLocationListener.onLocationChanged(point, accuracy);
}
/**
* (non-Javadoc)
* @see com.TwentyCodes.android.location.MapFragmentBase#onMapViewCreate(com.TwentyCodes.android.location.MapView)
@@ -72,16 +97,16 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
map.getOverlays().add(mUserOverlay);
}
/**
* (non-Javadoc)
* @see com.TwentyCodes.android.location.MapFragmentBase#onPause()
*/
@Override
public void onPause() {
super.onPause();
mUserOverlay.disableMyLocation();
removeOverlay(mUserOverlay);
super.onPause();
}
/**
@@ -90,11 +115,31 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
*/
@Override
public void onResume() {
super.onResume();
if(mUserOverlay != null)
mUserOverlay.enableMyLocation();
super.onResume();
}
/**
* reorders the overlays to the UserOverlay always on top
* @author ricky barrette
*/
public void reorderOverlays() {
getMap().getOverlays().remove(mUserOverlay);
getMap().getOverlays().add(mUserOverlay);
}
/**
* @param needleResId
* @param backgroundResId
* @param x
* @param y
* @author ricky barrette
*/
public void setCompassDrawables(int needleResId, int backgroundResId, int x, int y){
mUserOverlay.setCompassDrawables(needleResId, backgroundResId, x, y);
}
/**
* @param listener
* @author ricky barrette
@@ -102,7 +147,7 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
public void setCompassListener(CompassListener listener){
mCompassListener = listener;
}
/**
* Sets the destination for the compass to point to
* @param destination
@@ -111,7 +156,7 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
public void setDestination(GeoPoint destination){
mUserOverlay.setDestination(destination);
}
/**
* @param listener
* @author ricky barrette
@@ -119,5 +164,4 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
public void setGeoPointLocationListener(GeoPointLocationListener listener){
mGeoPointLocationListener = listener;
}
}