protected synchronized BoundingBox getCurBounds ( ) { if ( currBoundingBox == null ) { if ( mapView == null ) { throw new NullPointerException ( "mapView == null" ) ; } if ( mapView . getWidth ( ) <= 0 || mapView . getHeight ( ) <= 0 ) { throw new IllegalArgumentException ( " mapView.getWidth() <= 0 " + "|| mapView.getHeight() <= 0 " + mapView . getWidth ( ) + " || " + mapView . getHeight ( ) ) ; } /** North-West geo point of the bound */ LatLong nw_ = mapView . getMapViewProjection ( ) . fromPixels ( 0 , 0 ) ; // Log.e(TAG, " nw_.latitude => " + nw_.latitude + " nw_.longitude => " + nw_.longitude ); /** South-East geo point of the bound */ LatLong se_ = mapView . getMapViewProjection ( ) . fromPixels ( mapView . getWidth ( ) , mapView . getHeight ( ) ) ; // Log.e(TAG, " se_.latitude => " + se_.latitude + " se_.longitude => " + se_.longitude ); if ( nw_ != null && se_ != null ) { if ( se_ . latitude > nw_ . latitude ) { currBoundingBox = new BoundingBox ( nw_ . latitude , se_ . longitude , se_ . latitude , nw_ . longitude ) ; } else { currBoundingBox = new BoundingBox ( se_ . latitude , nw_ . longitude , nw_ . latitude , se_ . longitude ) ; } } } return currBoundingBox ; }
get the current BoundingBox of the viewport