public static double getCenterLongitude ( final double pWest , final double pEast ) { double longitude = ( pEast + pWest ) / 2.0 ; if ( pEast < pWest ) { // center is on the other side of earth longitude += 180 ; } return org . osmdroid . views . MapView . getTileSystem ( ) . cleanLongitude ( longitude ) ; }
Compute the center of two longitudes Taking into account the case when west is on the right and east is on the left