Added some convenice methods to BaseMapFragment

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-05-10 13:04:21 -04:00
parent c5570b4aa4
commit 5ba3f55eda

View File

@@ -49,6 +49,25 @@ public abstract class BaseMapFragment extends Fragment {
mMapView.setSatellite(!mMapView.isSatellite());
}
/**
* Disables the Acquiring GPS dialog
* @author ricky barrette
*/
public void disableGPSProgess(){
isGPSDialogEnabled = false;
mProgress.setVisibility(View.GONE);
}
/**
* Enables the Acquiring GPS dialog if the location has not been acquired
*
* @author ricky barrette
*/
public void enableGPSProgess(){
isGPSDialogEnabled = true;
mProgress.setVisibility(View.VISIBLE);
}
/**
* @return mapview
* @author ricky barrette
@@ -57,6 +76,30 @@ public abstract class BaseMapFragment extends Fragment {
return mMapView;
}
/**
* Forces the map to redraw
* @author ricky barrette
*/
public void invalidate(){
mMapView.invalidate();
}
/**
* @return true if the GPS progress is showing
* @author ricky barrette
*/
public boolean isGPSProgessShowing(){
return isGPSDialogEnabled;
}
/**
* @return true if the map is in satellite mode
* @author ricky barrette
*/
public boolean isSatellite(){
return mMapView.isSatellite();
}
/**
* Called when the fragment view is first created
* (non-Javadoc)
@@ -92,6 +135,33 @@ public abstract class BaseMapFragment extends Fragment {
mMapView.getOverlays().remove(overlay);
}
/**
* Enables or disables the built in zoom controls
* @param isShowing
* @author ricky barrette
*/
public void setBuiltInZoomControls(boolean isShowing){
mMapView.setBuiltInZoomControls(isShowing);
}
/**
* Sets where or not the map view is interactive
* @param isClickable
* @author ricky barrette
*/
public void setClickable(boolean isClickable){
mMapView.setClickable(isClickable);
}
/**
* Sets double tap zoom
* @param isDoubleTapZoonEnabled
* @author ricky barrette
*/
public void setDoubleTapZoonEnabled(boolean isDoubleTapZoonEnabled){
mMapView.setDoubleTapZoonEnabled(isDoubleTapZoonEnabled);
}
/**
* Sets the center of the map to the provided point
* @param point
@@ -105,25 +175,20 @@ public abstract class BaseMapFragment extends Fragment {
}
/**
* Disables the Acquiring GPS dialog
* Sets the view of the map. true is sat, false is map
* @param isSat
* @author ricky barrette
*/
public void disableGPSProgess(){
isGPSDialogEnabled = false;
mProgress.setVisibility(View.GONE);
public void setSatellite(boolean isSat){
mMapView.setSatellite(isSat);
}
/**
* Enables the Acquiring GPS dialog if the location has not been acquired
*
* Sets the zoom level of the map
* @param zoom
* @author ricky barrette
*/
public void enableGPSProgess(){
isGPSDialogEnabled = true;
mProgress.setVisibility(View.VISIBLE);
}
public boolean isGPSProgessShowing(){
return isGPSDialogEnabled;
public void setZoom(int zoom){
mMapView.getController().setZoom(zoom);
}
}