Dimension newDimension = calculateFrameBufferDimension(mapViewDimension, overdrawFactor); if (!Parameters.SQUARE_FRAME_BUFFER || frameBuffer.getDimension() == null || newDimension.width > frameBuffer.getDimension().width
/** * Compute the minimum cache size for a view, using the size of the map view. * For the view size we use the frame buffer calculated dimension. * * @param tileSize the tile size * @param overdrawFactor the overdraw factor applied to the mapview * @param width the width of the map view * @param height the height of the map view * @return the minimum cache size for the view */ public static int getMinimumCacheSize(int tileSize, double overdrawFactor, int width, int height) { // height * overdrawFactor / tileSize calculates the number of tiles that would cover // the view port, adding 1 is required since we can have part tiles on either side, // adding 2 adds another row/column as spare and ensures that we will generally have // a larger number of tiles in the cache than a TileLayer will render for a view. // For any size we need a minimum of 4 (as the intersection of 4 tiles can always be in the // middle of a view. Dimension dimension = FrameBufferController.calculateFrameBufferDimension(new Dimension(width, height), overdrawFactor); return Math.max(4, (2 + (dimension.height / tileSize)) * (2 + (dimension.width / tileSize))); }
Dimension dimension = FrameBufferController.calculateFrameBufferDimension(new Dimension(width, height), overdrawFactor); return (int) Math.max(4, screenRatio * (2 + (dimension.height / tileSize)) * (2 + (dimension.width / tileSize)));
Dimension newDimension = calculateFrameBufferDimension(mapViewDimension, overdrawFactor); if (!Parameters.SQUARE_FRAME_BUFFER || frameBuffer.getDimension() == null || newDimension.width > frameBuffer.getDimension().width