I'm trying to get the latitude and longitude of the center of the map in the Google Maps V2 API & get the width and length of the map.
Here is my old code(from GMaps v1 that I started to modify):
import com.google.android.gms.maps.GoogleMap;
private GoogleMap mGoogleMapView;
public LatLng getMapCenter()
{
if( mGoogleMapView != null )
{
return mGoogleMapView.getMapCenter();
}
/*if( mOpenStreetMapView != null )
{
return convertOSMGeoPoint( mOpenStreetMapView.getMapCenter() );
}*/
return null;
}
public int getHeight()
{
if( mGoogleMapView != null )
{
return mGoogleMapView.getHeight();
}
/*if( mOpenStreetMapView != null )
{
return mOpenStreetMapView.getHeight();
}*/
return 0;
}
public int getWidth()
{
if( mGoogleMapView != null )
{
return mGoogleMapView.getWidth();
}
/*else if( mOpenStreetMapView != null )
{
return mOpenStreetMapView.getWidth();
}*/
return 0;
}
How can I perform the same functionality that mapView.getMapCenter(), mapView.getHeight(), and mapView.getWidth() using the Android GMaps V2 API?