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(); 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 * @return the users current location
* @author ricky barrette * @author ricky barrette
@@ -83,9 +108,9 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
*/ */
@Override @Override
public void onPause() { public void onPause() {
super.onPause();
mUserOverlay.disableMyLocation(); mUserOverlay.disableMyLocation();
removeOverlay(mUserOverlay); removeOverlay(mUserOverlay);
super.onPause();
} }
/** /**
@@ -94,9 +119,29 @@ public class SkyHoookUserOverlayMapFragment extends MapFragmentBase implements G
*/ */
@Override @Override
public void onResume() { public void onResume() {
super.onResume();
if(mUserOverlay != null) if(mUserOverlay != null)
mUserOverlay.enableMyLocation(); 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);
} }
/** /**

View File

@@ -13,6 +13,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import com.google.android.maps.GeoPoint; import com.google.android.maps.GeoPoint;
import com.google.android.maps.Overlay;
/** /**
* This map fragment will maintain a map view and all its functions * This map fragment will maintain a map view and all its functions
@@ -31,6 +32,26 @@ public abstract class MapFragmentBase extends Fragment {
super(); 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 * Called when the fragment view is first created
* (non-Javadoc) * (non-Javadoc)
@@ -60,7 +81,7 @@ public abstract class MapFragmentBase extends Fragment {
* @param overlay * @param overlay
* @author ricky barrette * @author ricky barrette
*/ */
protected void removeOverlay(Object overlay){ public void removeOverlay(Object overlay){
mMapView.getOverlays().remove(overlay); mMapView.getOverlays().remove(overlay);
} }
@@ -69,7 +90,10 @@ public abstract class MapFragmentBase extends Fragment {
* @param point * @param point
* @author ricky barrette * @author ricky barrette
*/ */
public void setMapCenter(GeoPoint point){ public boolean setMapCenter(GeoPoint point){
if(point == null)
return false;
mMapView.getController().setCenter(point); 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 * Enables the Acquiring GPS dialog if the location has not been acquired
*
* TODO fix funtion
* @author ricky barrette * @author ricky barrette
*/ */
public void enableGPSDialog(){ public void enableGPSDialog(){

View File

@@ -28,6 +28,31 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
super(); 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 * @return the users current location
* @author ricky barrette * @author ricky barrette
@@ -79,9 +104,9 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
*/ */
@Override @Override
public void onPause() { public void onPause() {
super.onPause();
mUserOverlay.disableMyLocation(); mUserOverlay.disableMyLocation();
removeOverlay(mUserOverlay); removeOverlay(mUserOverlay);
super.onPause();
} }
/** /**
@@ -90,9 +115,29 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
*/ */
@Override @Override
public void onResume() { public void onResume() {
super.onResume();
if(mUserOverlay != null) if(mUserOverlay != null)
mUserOverlay.enableMyLocation(); 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);
} }
/** /**
@@ -119,5 +164,4 @@ public class UserOverlayMapFragment extends MapFragmentBase implements GeoPointL
public void setGeoPointLocationListener(GeoPointLocationListener listener){ public void setGeoPointLocationListener(GeoPointLocationListener listener){
mGeoPointLocationListener = listener; mGeoPointLocationListener = listener;
} }
} }