Added some convenice methods to BaseMapFragment
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
@@ -49,6 +49,25 @@ public abstract class BaseMapFragment extends Fragment {
|
|||||||
mMapView.setSatellite(!mMapView.isSatellite());
|
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
|
* @return mapview
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
@@ -57,6 +76,30 @@ public abstract class BaseMapFragment extends Fragment {
|
|||||||
return mMapView;
|
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
|
* Called when the fragment view is first created
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
@@ -92,6 +135,33 @@ public abstract class BaseMapFragment extends Fragment {
|
|||||||
mMapView.getOverlays().remove(overlay);
|
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
|
* Sets the center of the map to the provided point
|
||||||
* @param 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
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
public void disableGPSProgess(){
|
public void setSatellite(boolean isSat){
|
||||||
isGPSDialogEnabled = false;
|
mMapView.setSatellite(isSat);
|
||||||
mProgress.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables the Acquiring GPS dialog if the location has not been acquired
|
* Sets the zoom level of the map
|
||||||
*
|
* @param zoom
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
public void enableGPSProgess(){
|
public void setZoom(int zoom){
|
||||||
isGPSDialogEnabled = true;
|
mMapView.getController().setZoom(zoom);
|
||||||
mProgress.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isGPSProgessShowing(){
|
|
||||||
return isGPSDialogEnabled;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user