MapPosition: use int to represent zoomLevel

add MapPosition.setFromLatLon utility
This commit is contained in:
Hannes Janetzek
2013-03-26 07:15:15 +01:00
parent a818e2f062
commit bef8e125fb
8 changed files with 52 additions and 46 deletions

View File

@@ -166,7 +166,7 @@ public class GLRenderer implements GLSurfaceView.Renderer {
if (tile == null)
continue;
holder = new MapTile(x, y, mZoom);
holder = new MapTile(x, y, (byte)mZoom);
holder.isVisible = true;
holder.holder = tile;
tile.isVisible = true;

View File

@@ -46,11 +46,11 @@ public abstract class ScanBox {
private Edge ca = new Edge();
private float minX, maxX;
protected byte mZoom;
protected int mZoom;
abstract void setVisible(int y, int x1, int x2);
public void scan(float[] coords, byte zoom) {
public void scan(float[] coords, int zoom) {
mZoom = zoom;
maxX = Float.MIN_VALUE;

View File

@@ -290,13 +290,13 @@ public class TileManager {
//
// }
/* package */MapTile addTile(int x, int y, byte zoomLevel) {
/* package */MapTile addTile(int x, int y, int zoomLevel) {
MapTile tile;
tile = QuadTree.getTile(x, y, zoomLevel);
if (tile == null) {
tile = new MapTile(x, y, zoomLevel);
tile = new MapTile(x, y, (byte)zoomLevel);
QuadTree.add(tile);
mJobs.add(tile);
addToCache(tile);
@@ -392,7 +392,7 @@ public class TileManager {
// TODO there is probably a better quad-tree distance function
double x = mapPosition.x;
double y = mapPosition.y;
byte zoom = mapPosition.zoomLevel;
int zoom = mapPosition.zoomLevel;
int h = Tile.TILE_SIZE >> 1;
long center = h << zoom;

View File

@@ -99,7 +99,7 @@ public class GridOverlay extends BasicOverlay {
private int mCurX = -1;
private int mCurY = -1;
private byte mCurZ = -1;
private int mCurZ = -1;
private boolean finished;