private Envelope getMaxScreenEnvelope ( InternalTile tile , Coordinate panOrigin ) { int nrOfTilesX = Math . max ( 1 , MAXIMUM_TILE_COORDINATE / tile . getScreenWidth ( ) ) ; int nrOfTilesY = Math . max ( 1 , MAXIMUM_TILE_COORDINATE / tile . getScreenHeight ( ) ) ; double x1 = panOrigin . x - nrOfTilesX * tile . getTileWidth ( ) ; // double x2 = x1 + (nrOfTilesX * tileWidth * 2); double x2 = panOrigin . x + nrOfTilesX * tile . getTileWidth ( ) ; double y1 = panOrigin . y - nrOfTilesY * tile . getTileHeight ( ) ; // double y2 = y1 + (nrOfTilesY * tileHeight * 2); double y2 = panOrigin . y + nrOfTilesY * tile . getTileHeight ( ) ; return new Envelope ( x1 , x2 , y1 , y2 ) ; }
What is the maximum bounds in screen space? Needed for correct clipping calculation .