add available zoomlevel to MapInfo

This commit is contained in:
Hannes Janetzek 2012-09-18 21:53:52 +02:00
parent 6ee2a85e12
commit 363cf8b029
6 changed files with 21 additions and 9 deletions

View File

@ -79,6 +79,11 @@ public class MapInfo {
*/
public final Byte startZoomLevel;
/**
* Zoomlevels provided by this Database, if null then any zoomlevel can be queried.
*/
public final int[] zoomLevel;
/**
* @param bbox
* ...
@ -100,11 +105,15 @@ public class MapInfo {
* ...
* @param createdBy
* ...
* @param zoomLevel
* TODO
*/
public MapInfo(BoundingBox bbox, Byte zoom, GeoPoint start, String projection,
long date, long size, int version, String language, String comment, String createdBy) {
long date, long size, int version, String language, String comment,
String createdBy, int[] zoomLevel) {
this.startZoomLevel = zoom;
this.zoomLevel = zoomLevel;
this.startPosition = start;
this.projectionName = projection;
this.mapDate = date;
@ -116,5 +125,6 @@ public class MapInfo {
this.comment = comment;
this.createdBy = createdBy;
}
}

View File

@ -59,7 +59,7 @@ public class MapFileInfo extends org.oscim.database.MapInfo {
mapFileInfoBuilder.fileVersion,
mapFileInfoBuilder.optionalFields.languagePreference,
mapFileInfoBuilder.optionalFields.comment,
mapFileInfoBuilder.optionalFields.createdBy);
mapFileInfoBuilder.optionalFields.createdBy, null);
debugFile = mapFileInfoBuilder.optionalFields.isDebugFile;

View File

@ -55,7 +55,7 @@ public class MapDatabase implements IMapDatabase {
private static final MapInfo mMapInfo =
new MapInfo(new BoundingBox(-180, -90, 180, 90),
new Byte((byte) 4), new GeoPoint(53.11, 8.85),
null, 0, 0, 0, "de", "comment", "author");
null, 0, 0, 0, "de", "comment", "author", null);
private boolean mOpenFile = false;

View File

@ -78,7 +78,7 @@ public class MapDatabase implements IMapDatabase {
private static final MapInfo mMapInfo =
new MapInfo(new BoundingBox(-180, -90, 180, 90),
new Byte((byte) 4), new GeoPoint(53.11, 8.85),
null, 0, 0, 0, "de", "comment", "author");
null, 0, 0, 0, "de", "comment", "author", null);
private boolean mOpenFile = false;

View File

@ -60,7 +60,7 @@ public class MapDatabase implements IMapDatabase {
new MapInfo(new BoundingBox(-180, -85, 180, 85),
new Byte((byte) 14), new GeoPoint(53.11, 8.85),
WebMercator.NAME,
0, 0, 0, "de", "comment", "author");
0, 0, 0, "de", "comment", "author", null);
private boolean mOpenFile = false;

View File

@ -35,13 +35,15 @@ public class MapDatabase implements IMapDatabase {
private final static String PROJECTION = "Mercator";
private float[] mCoords = new float[20];
private short[] mIndex = new short[4];
// private Tag[] mTags = { new Tag("boundary", "administrative"), new Tag("admin_level", "2") };
// private Tag[] mTags = { new Tag("boundary", "administrative"), new
// Tag("admin_level", "2") };
private Tag[] mTags = { new Tag("natural", "water") };
private Tag[] mNameTags;
private final MapInfo mMapInfo =
new MapInfo(new BoundingBox(-180, -90, 180, 90),
new Byte((byte) 0), null, PROJECTION, 0, 0, 0, "de", "yo!", "by me");
new Byte((byte) 0), null, PROJECTION, 0, 0, 0, "de", "yo!", "by me",
null);
private boolean mOpenFile = false;
@ -50,8 +52,8 @@ public class MapDatabase implements IMapDatabase {
float lat1 = -0.5f;
float lon1 = -0.5f;
float lat2 = Tile.TILE_SIZE - 0.5f;
float lon2 = Tile.TILE_SIZE - 0.5f;
float lat2 = Tile.TILE_SIZE + 0.5f;
float lon2 = Tile.TILE_SIZE + 0.5f;
mCoords[0] = lon1;
mCoords[1] = lat1;