public static BoundingBox boundDegreesBoundingBoxWithWebMercatorLimits ( BoundingBox boundingBox ) { BoundingBox bounded = new BoundingBox ( boundingBox ) ; if ( bounded . getMinLatitude ( ) < ProjectionConstants . WEB_MERCATOR_MIN_LAT_RANGE ) { bounded . setMinLatitude ( ProjectionConstants . WEB_MERCATOR_MIN_LAT_RANGE ) ; } if ( bounded . getMaxLatitude ( ) < ProjectionConstants . WEB_MERCATOR_MIN_LAT_RANGE ) { bounded . setMaxLatitude ( ProjectionConstants . WEB_MERCATOR_MIN_LAT_RANGE ) ; } if ( bounded . getMaxLatitude ( ) > ProjectionConstants . WEB_MERCATOR_MAX_LAT_RANGE ) { bounded . setMaxLatitude ( ProjectionConstants . WEB_MERCATOR_MAX_LAT_RANGE ) ; } if ( bounded . getMinLatitude ( ) > ProjectionConstants . WEB_MERCATOR_MAX_LAT_RANGE ) { bounded . setMinLatitude ( ProjectionConstants . WEB_MERCATOR_MAX_LAT_RANGE ) ; } return bounded ; }
Bound the upper and lower bounds of the degrees bounding box with web mercator limits