public boolean isWithinBoundingBox ( int x , int y , int zoom ) { boolean withinBounds = true ; // If a bounding box is set, check if it overlaps with the request if ( webMercatorBoundingBox != null ) { // Get the bounding box of the requested tile BoundingBox tileWebMercatorBoundingBox = TileBoundingBoxUtils . getWebMercatorBoundingBox ( x , y , zoom ) ; // Adjust the bounding box if needed BoundingBox adjustedWebMercatorBoundingBox = getWebMercatorBoundingBox ( tileWebMercatorBoundingBox ) ; // Check if the request overlaps withinBounds = adjustedWebMercatorBoundingBox . intersects ( tileWebMercatorBoundingBox , true ) ; } return withinBounds ; }
Check if the tile request is within the desired tile bounds