I think that intersection is not calculated correctly. In zoomlevel.java
you are scaling tile size(tileWidth * scale) but using basemap size to calculate tile row/column.
public LinkedList<MapTile> getIntersections() {
int zoom = zoomManager.getZoom();
double scale = zoomManager.getRelativeScale();
double offsetWidth = tileWidth * scale;
double offsetHeight = tileHeight * scale;
LinkedList<MapTile> intersections = new LinkedList<MapTile>();
Rect boundedRect = new Rect( zoomManager.getViewport() );
boundedRect.top = Math.max( boundedRect.top, 0 );
boundedRect.left = Math.max( boundedRect.left, 0 );
boundedRect.right = Math.min( boundedRect.right, (int)(mapWidth*scale) );
boundedRect.bottom = Math.min( boundedRect.bottom, (int)(mapHeight*scale) );
int sr = (int) Math.floor( boundedRect.top / offsetHeight );
int er = (int) Math.ceil( boundedRect.bottom / offsetHeight );
int sc = (int) Math.floor( boundedRect.left / offsetWidth );
int ec = (int) Math.ceil( boundedRect.right / offsetWidth );
for ( int r = sr; r < er; r++ ) {
for ( int c = sc; c < ec; c++ ) {
MapTile m = new MapTile( zoom, r, c, tileWidth, tileHeight, pattern );
intersections.add( m );
}
}
return intersections;
}