Fix blank tiles on large windows and tilt (#522)
This commit is contained in:
@@ -217,8 +217,9 @@ public class TileManager {
|
||||
mTilesEnd = 0;
|
||||
mTilesCount = 0;
|
||||
|
||||
/* set up TileSet large enough to hold current tiles */
|
||||
int num = Math.max(mMap.getWidth(), mMap.getHeight());
|
||||
/* Set up TileSet large enough to hold current tiles.
|
||||
* Use screen size as workaround for blank tiles in #520. */
|
||||
int num = Math.max(mMap.getScreenWidth(), mMap.getScreenHeight());
|
||||
int size = Tile.SIZE >> 1;
|
||||
int numTiles = (num * num) / (size * size) * 4;
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
* Copyright 2013 Hannes Janetzek
|
||||
* Copyright 2016 Andrey Novikov
|
||||
* Copyright 2016 Stephan Leuschner
|
||||
* Copyright 2016-2017 devemux86
|
||||
* Copyright 2016-2018 devemux86
|
||||
* Copyright 2016 Longri
|
||||
* Copyright 2018 Gustl22
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
@@ -272,15 +273,25 @@ public abstract class Map implements TaskQueue {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return screen width in pixel.
|
||||
* Return view width in pixel.
|
||||
*/
|
||||
public abstract int getWidth();
|
||||
|
||||
/**
|
||||
* Return screen height in pixel.
|
||||
* Return view height in pixel.
|
||||
*/
|
||||
public abstract int getHeight();
|
||||
|
||||
/**
|
||||
* Return screen width in pixel.
|
||||
*/
|
||||
public abstract int getScreenWidth();
|
||||
|
||||
/**
|
||||
* Return screen height in pixel.
|
||||
*/
|
||||
public abstract int getScreenHeight();
|
||||
|
||||
/**
|
||||
* Request to clear all layers before rendering next frame
|
||||
*/
|
||||
|
||||
@@ -42,6 +42,8 @@ public class Viewport {
|
||||
public final static int MAX_ZOOM_LEVEL = 20;
|
||||
public final static int MIN_ZOOM_LEVEL = 2;
|
||||
public final static float MIN_TILT = 0;
|
||||
|
||||
/* Note: limited by numTiles in TileManager to ~80° */
|
||||
public final static float MAX_TILT = 65;
|
||||
|
||||
protected double mMaxScale = (1 << MAX_ZOOM_LEVEL);
|
||||
|
||||
Reference in New Issue
Block a user