Creating new module vtm-android-mvt

This commit is contained in:
Konstantinos Tzounopoulos 2019-09-08 16:21:17 +02:00
parent bd8cea37ad
commit 1647dd989e
15 changed files with 233 additions and 201 deletions

View File

@ -3,6 +3,7 @@ include ':vtm'
include ':vtm-android'
include ':vtm-android-example'
include ':vtm-android-gdx'
include ':vtm-android-mvt'
include ':vtm-app'
include ':vtm-desktop'
include ':vtm-desktop-lwjgl'

View File

@ -9,6 +9,7 @@ configurations.all {
dependencies {
implementation project(':vtm-android')
implementation project(':vtm-android-mvt')
implementation project(':vtm-extras')
implementation project(':vtm-http')
implementation project(':vtm-jeo')

View File

@ -27,7 +27,6 @@
<string name="now">Now</string>
<string name="warning">Warning</string>
<string name="startup_message_mbtiles">To run this sample activity, you need an MBTiles Database installed on storage.\n\nadb push %s %s</string>
<string name="unknown_format_mbtiles">Unknown format \'%s\' found in MBTiles database \'%s\' in field \'metadata.format\'. Supported format(s) are: \'%s\'</string>
<string name="exit">Exit</string>
</resources>

View File

@ -19,10 +19,8 @@ package org.oscim.android.test;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.TextUtils;
import org.oscim.android.tiling.source.mbtiles.MBTilesBitmapTileDataSourceWorker;
import org.oscim.android.tiling.source.mbtiles.MBTilesMvtTileDataSourceWorker;
import org.oscim.android.tiling.source.mbtiles.MBTilesBitmapTileSource;
import org.oscim.android.tiling.source.mbtiles.MBTilesTileSource;
import org.oscim.core.BoundingBox;
import org.oscim.core.MapPosition;
@ -55,29 +53,7 @@ public class MBTilesBitmapTileActivity extends BitmapTileActivity {
return;
}
MBTilesTileSource tileSource = new MBTilesTileSource(file.getAbsolutePath(), null, 128, null);
if (!MBTilesBitmapTileDataSourceWorker.SUPPORTED_FORMATS.contains(tileSource.getMetadataFormat())) {
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setTitle(R.string.warning)
.setMessage(
getResources().getString(
R.string.unknown_format_mbtiles,
tileSource.getMetadataFormat(),
file.getAbsolutePath(),
TextUtils.join(", ", MBTilesMvtTileDataSourceWorker.SUPPORTED_FORMATS)
)
)
.setPositiveButton(R.string.exit, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
builder.show();
return;
}
MBTilesTileSource tileSource = new MBTilesBitmapTileSource(file.getAbsolutePath(), 128, null);
BitmapTileLayer bitmapLayer = new BitmapTileLayer(mMap, tileSource);
mMap.layers().add(bitmapLayer);

View File

@ -19,23 +19,17 @@ package org.oscim.android.test;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.TextUtils;
import org.oscim.android.cache.TileCache;
import org.oscim.android.tiling.source.mbtiles.MBTilesMvtTileDataSourceWorker;
import org.oscim.android.mvt.tiling.source.mbtiles.MBTilesMvtTileSource;
import org.oscim.android.tiling.source.mbtiles.MBTilesTileSource;
import org.oscim.android.tiling.source.mbtiles.UnsupportedMBTilesDatabaseException;
import org.oscim.core.BoundingBox;
import org.oscim.core.GeoPoint;
import org.oscim.core.MapPosition;
import org.oscim.core.Tile;
import org.oscim.layers.tile.buildings.BuildingLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.OkHttpEngine;
import org.oscim.tiling.source.UrlTileSource;
import org.oscim.tiling.source.mvt.OpenMapTilesMvtTileSource;
import java.io.File;
@ -60,19 +54,13 @@ public class MBTilesMvtTileActivity extends MapActivity {
return;
}
MBTilesTileSource tileSource = new MBTilesTileSource(file.getAbsolutePath(), "en");
if (!MBTilesMvtTileDataSourceWorker.SUPPORTED_FORMATS.contains(tileSource.getMetadataFormat())) {
MBTilesTileSource tileSource;
try {
tileSource = new MBTilesMvtTileSource(file.getAbsolutePath(), "en");
} catch (UnsupportedMBTilesDatabaseException e) {
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setTitle(R.string.warning)
.setMessage(
getResources().getString(
R.string.unknown_format_mbtiles,
tileSource.getMetadataFormat(),
file.getAbsolutePath(),
TextUtils.join(", ", MBTilesMvtTileDataSourceWorker.SUPPORTED_FORMATS)
)
)
.setMessage(e.getMessage())
.setPositiveButton(R.string.exit, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest package="org.oscim.android.mvt" />

View File

@ -0,0 +1,62 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
dependencies {
api project(':vtm-android')
api project(':vtm-mvt')
}
android {
compileSdkVersion androidCompileSdk()
buildToolsVersion "$androidBuildVersionTools"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
defaultConfig {
versionCode project.versionCode()
versionName project.versionName()
minSdkVersion androidMinSdk()
targetSdkVersion androidTargetSdk()
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
lintOptions { abortOnError false }
}
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name == "debug")
return
def jar = project.tasks.create "jar${name.capitalize()}", Jar
jar.dependsOn variant.javaCompileProvider
jar.exclude '**/BuildConfig.class'
jar.exclude '**/R.class'
jar.exclude '**/R$*.class'
jar.from variant.javaCompileProvider.get().destinationDir
artifacts.add('archives', jar)
file('natives').eachDir() { dir ->
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
nativesJar.classifier = "natives-${dir.name}"
nativesJar.from(dir.path)
artifacts.add('archives', nativesJar)
}
}
if (project.hasProperty("SONATYPE_USERNAME")) {
afterEvaluate {
project.apply from: "${rootProject.projectDir}/deploy.gradle"
}
}

View File

@ -12,17 +12,14 @@
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.tiling.source.mbtiles;
package org.oscim.android.mvt.tiling.source.mbtiles;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import org.oscim.core.BoundingBox;
import org.oscim.android.tiling.source.mbtiles.MBTilesTileDataSource;
import org.oscim.core.MercatorProjection;
import org.oscim.layers.tile.MapTile;
import org.oscim.map.Viewport;
import org.oscim.tiling.ITileDataSink;
import org.oscim.tiling.ITileDataSource;
import org.oscim.tiling.OverzoomDataSink;
import org.oscim.tiling.QueryResult;
import org.oscim.tiling.source.mvt.MvtTileDecoder;
@ -30,26 +27,16 @@ import org.oscim.tiling.source.mvt.MvtTileDecoder;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.zip.GZIPInputStream;
public class MBTilesMvtTileDataSourceWorker implements ITileDataSource {
public final static List<String> SUPPORTED_FORMATS = Arrays.asList("pbf");
public class MBTilesMvtTileDataSource extends MBTilesTileDataSource {
private final static List<String> SUPPORTED_FORMATS = Arrays.asList("pbf");
private static final String SELECT_TILES_FORMAT =
"SELECT zoom_level, tile_column, tile_row, tile_data " +
"FROM tiles " +
"WHERE %s " +
"ORDER BY zoom_level DESC " +
"LIMIT 1";
private static final String WHERE_FORMAT = "zoom_level=%d AND tile_column=%d AND tile_row=%d";
public static final String WHERE_FORMAT = "zoom_level=%d AND tile_column=%d AND tile_row=%d";
private final String mLocale;
private final SQLiteDatabase mDatabase;
private final ThreadLocal<MvtTileDecoder> mThreadLocalMvtTileDecoders = new ThreadLocal<MvtTileDecoder>() {
@Override
@ -58,9 +45,17 @@ public class MBTilesMvtTileDataSourceWorker implements ITileDataSource {
}
};
public MBTilesMvtTileDataSourceWorker(SQLiteDatabase database, String locale) {
public MBTilesMvtTileDataSource(String databasePath, String locale) {
super(databasePath);
assertDatabaseFormat();
mLocale = locale != null ? locale : "en";
mDatabase = database;
}
@Override
public List<String> getSupportedFormats() {
return SUPPORTED_FORMATS;
}
@Override

View File

@ -0,0 +1,36 @@
/*
* Copyright 2019 Kostas Tzounopoulos
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.mvt.tiling.source.mbtiles;
import org.oscim.android.tiling.source.mbtiles.MBTilesTileSource;
/**
* Create a Vector MBTiles tile source (OpenMapTiles MVT with gzipped-pbf tiles)
*/
public class MBTilesMvtTileSource extends MBTilesTileSource {
public MBTilesMvtTileSource(String databasePath) {
this(databasePath, null);
}
/**
* Create a MBTiles tile data source for Raster databases
*
* @param databasePath the MBTiles database path
* @param locale the locale to use when rendering the MBTiles
*/
public MBTilesMvtTileSource(String databasePath, String locale) {
super(new MBTilesMvtTileDataSource(databasePath, locale));
}
}

View File

@ -3,7 +3,6 @@ apply plugin: 'com.github.dcendents.android-maven'
dependencies {
api project(':vtm')
api project(':vtm-mvt')
api 'com.caverock:androidsvg:1.3'
}

View File

@ -17,19 +17,16 @@
package org.oscim.android.tiling.source.mbtiles;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.canvas.Bitmap;
import org.oscim.core.BoundingBox;
import org.oscim.core.MercatorProjection;
import org.oscim.layers.tile.MapTile;
import org.oscim.map.Viewport;
import org.oscim.tiling.ITileDataSink;
import org.oscim.tiling.ITileDataSource;
import org.oscim.tiling.QueryResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -37,34 +34,43 @@ import org.slf4j.LoggerFactory;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* A tile data source for MBTiles Raster databases.
*/
public class MBTilesBitmapTileDataSourceWorker implements ITileDataSource {
public final static List<String> SUPPORTED_FORMATS = Arrays.asList("png", "jpg", "jpeg");
protected static final Logger log = LoggerFactory.getLogger(MBTilesBitmapTileDataSourceWorker.class);
public class MBTilesBitmapTileDataSource extends MBTilesTileDataSource {
private final static List<String> SUPPORTED_FORMATS = Arrays.asList("png", "jpg", "jpeg");
protected static final Logger log = LoggerFactory.getLogger(MBTilesBitmapTileDataSource.class);
private final Integer mAlpha;
private final Integer mTransparentColor;
private final SQLiteDatabase mDatabase;
/**
* Create a MBTiles tile data source.
* Create a MBTiles tile data source for Raster databases
*
* @param database the MBTiles database
* @param path the MBTiles database path
* @param alpha an optional alpha value [0-255] to make the tiles transparent.
* @param transparentColor an optional color that will be made transparent in the bitmap.
*/
MBTilesBitmapTileDataSourceWorker(SQLiteDatabase database, Integer alpha, Integer transparentColor) {
mDatabase = database;
public MBTilesBitmapTileDataSource(String path, Integer alpha, Integer transparentColor) {
super(path);
try {
assertDatabaseFormat();
} catch (UnsupportedMBTilesDatabaseException e) {
log.error("Invalid MBTiles database", e);
}
mAlpha = alpha;
mTransparentColor = transparentColor;
}
@Override
public List<String> getSupportedFormats() {
return SUPPORTED_FORMATS;
}
private static android.graphics.Bitmap processAlpha(android.graphics.Bitmap bitmap, int alpha) {
android.graphics.Bitmap newBitmap = android.graphics.Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), android.graphics.Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(newBitmap);
@ -136,16 +142,17 @@ public class MBTilesBitmapTileDataSourceWorker implements ITileDataSource {
* @return the tile image bytes.
*/
private byte[] readTile(int tileX, int tileY, byte zoomLevel) {
long tmsTileY = MercatorProjection.tileYToTMS(tileY, zoomLevel);
Cursor cursor = null;
try {
long tmsTileY = MercatorProjection.tileYToTMS(tileY, zoomLevel);
cursor = mDatabase.rawQuery(
MBTilesTileDataSource.SELECT_TILES,
String.format(MBTilesTileDataSource.SELECT_TILES_FORMAT, MBTilesTileDataSource.WHERE_FORMAT),
new String[]{String.valueOf(zoomLevel), String.valueOf(tileX), String.valueOf(tmsTileY)}
);
if (cursor.moveToFirst()) {
return cursor.getBlob(0);
return cursor.getBlob(cursor.getColumnIndexOrThrow("tile_data"));
}
} finally {
if (cursor != null) {

View File

@ -0,0 +1,37 @@
/*
* Copyright 2019 Andrea Antonello
* Copyright 2019 devemux86
* Copyright 2019 Kostas Tzounopoulos
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.tiling.source.mbtiles;
/**
* Create a Raster MBTiles tile source
*/
public class MBTilesBitmapTileSource extends MBTilesTileSource {
public MBTilesBitmapTileSource(String databasePath) {
this(databasePath, null, null);
}
/**
* Create a MBTiles tile data source for Raster databases
*
* @param databasePath the MBTiles database path
* @param alpha an optional alpha value [0-255] to make the tiles transparent.
* @param transparentColor an optional color that will be made transparent in the bitmap.
*/
public MBTilesBitmapTileSource(String databasePath, Integer alpha, Integer transparentColor) {
super(new MBTilesBitmapTileDataSource(databasePath, alpha, transparentColor));
}
}

View File

@ -20,106 +20,60 @@ import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;
import org.locationtech.jts.geom.Point;
import org.oscim.core.BoundingBox;
import org.oscim.core.GeoPoint;
import org.oscim.core.MapPosition;
import org.oscim.layers.tile.MapTile;
import org.oscim.map.Viewport;
import org.oscim.tiling.ITileDataSink;
import org.oscim.tiling.ITileDataSource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MBTilesTileDataSource implements ITileDataSource {
private static final String TABLE_TILES = "tiles";
private static final String COL_TILES_ZOOM_LEVEL = "zoom_level";
private static final String COL_TILES_TILE_COLUMN = "tile_column";
private static final String COL_TILES_TILE_ROW = "tile_row";
private static final String COL_TILES_TILE_DATA = "tile_data";
private static final String TABLE_METADATA = "metadata";
private static final String COL_METADATA_NAME = "name";
private static final String COL_METADATA_VALUE = "value";
abstract public class MBTilesTileDataSource implements ITileDataSource {
public static final String SELECT_TILES_FORMAT =
"SELECT zoom_level, tile_column, tile_row, tile_data " +
"FROM tiles " +
"WHERE %s " +
"ORDER BY zoom_level DESC " +
"LIMIT 1";
public static final String SELECT_TILES = "SELECT " + COL_TILES_TILE_DATA + " from " + TABLE_TILES + " where "
+ COL_TILES_ZOOM_LEVEL + "=? AND " + COL_TILES_TILE_COLUMN + "=? AND " + COL_TILES_TILE_ROW + "=?";
public static final String SELECT_METADATA = "select " + COL_METADATA_NAME + "," + COL_METADATA_VALUE + " from "
+ TABLE_METADATA;
public static final String WHERE_FORMAT = "zoom_level=? AND tile_column=? AND tile_row=?";
public static final String SELECT_METADATA = "SELECT name, value FROM metadata";
private final SQLiteDatabase mDatabase;
private final String mLocale;
private final Integer mAlpha;
private final Integer mTransparentColor;
private Map<String, String> mMetadata;
private ITileDataSource mTileDataSource;
protected final SQLiteDatabase mDatabase;
protected Map<String, String> mMetadata;
public MBTilesTileDataSource(String path, String locale, Integer alpha, Integer transparentColor) {
public MBTilesTileDataSource(String path) {
mDatabase = SQLiteDatabase.openDatabase(path, null, SQLiteDatabase.OPEN_READONLY);
mLocale = locale;
mAlpha = alpha;
mTransparentColor = transparentColor;
}
@Override
public void cancel() {
findWorker().cancel();
}
@Override
public void dispose() {
findWorker().cancel();
}
@Override
public void query(MapTile requestTile, ITileDataSink requestDataSink) {
findWorker().query(requestTile, requestDataSink);
}
protected ITileDataSource findWorker() {
if (mTileDataSource != null) {
return mTileDataSource;
}
abstract public List<String> getSupportedFormats();
protected void assertDatabaseFormat() {
String mbTilesFormat = getFormat();
if (mbTilesFormat == null) {
throw new RuntimeException("Unable to read the '" + TABLE_METADATA + ".format' field of the database.");
throw new RuntimeException("'metadata.format' field was not found. Is this an MBTiles database?");
}
if (MBTilesBitmapTileDataSourceWorker.SUPPORTED_FORMATS.contains(mbTilesFormat)) {
mTileDataSource = new MBTilesBitmapTileDataSourceWorker(mDatabase, mAlpha, mTransparentColor);
List<String> supportedFormats = getSupportedFormats();
return mTileDataSource;
if (!supportedFormats.contains(mbTilesFormat)) {
throw new RuntimeException(
String.format(
"Unsupported MBTiles 'metadata.format: %s'. Supported format(s) are: %s",
mbTilesFormat,
TextUtils.join(", ", supportedFormats)
)
);
}
if (MBTilesMvtTileDataSourceWorker.SUPPORTED_FORMATS.contains(mbTilesFormat)) {
mTileDataSource = new MBTilesMvtTileDataSourceWorker(mDatabase, mLocale);
return mTileDataSource;
}
List<String> supportedFormats = new ArrayList<>();
supportedFormats.addAll(MBTilesBitmapTileDataSourceWorker.SUPPORTED_FORMATS);
supportedFormats.addAll(MBTilesMvtTileDataSourceWorker.SUPPORTED_FORMATS);
throw new RuntimeException(
String.format(
"Unknown MBtiles database format '%s' found in the 'metadata.format' field of the database. "
+ "Expected one of: '%s'",
mbTilesFormat,
TextUtils.join(", ", supportedFormats)
)
);
}
String getAttribution() {
public String getAttribution() {
return getMetadata().get("attribution");
}
BoundingBox getBounds() {
public BoundingBox getBounds() {
String bounds = getMetadata().get("bounds");
if (bounds == null) {
@ -135,7 +89,7 @@ public class MBTilesTileDataSource implements ITileDataSource {
return new BoundingBox(s, w, n, e);
}
MapPosition getCenter() {
public MapPosition getCenter() {
String center = getMetadata().get("center");
if (center == null) {
@ -154,51 +108,51 @@ public class MBTilesTileDataSource implements ITileDataSource {
return centerMapPosition;
}
String getDescription() {
public String getDescription() {
return getMetadata().get("description");
}
String getFormat() {
public String getFormat() {
return getMetadata().get("format");
}
Integer getPixelScale() {
public Integer getPixelScale() {
String pixelScale = getMetadata().get("pixel_scale");
return pixelScale != null ? Integer.parseInt(pixelScale) : null;
}
int getMaxZoom() {
public int getMaxZoom() {
String maxZoom = getMetadata().get("maxzoom");
return maxZoom != null ? Integer.parseInt(maxZoom) : Viewport.MAX_ZOOM_LEVEL;
}
int getMinZoom() {
public int getMinZoom() {
String minZoom = getMetadata().get("minzoom");
return minZoom != null ? Integer.parseInt(minZoom) : Viewport.MIN_ZOOM_LEVEL;
}
String getName() {
public String getName() {
return getMetadata().get("name");
}
String getVersion() {
public String getVersion() {
return getMetadata().get("version");
}
String getId() {
public String getId() {
return getMetadata().get("id");
}
Long getMTime() {
public Long getMTime() {
String mTime = getMetadata().get("mtime");
return mTime != null ? Long.parseLong(mTime) : null;
}
String getJson() {
public String getJson() {
return getMetadata().get("json");
}

View File

@ -17,46 +17,17 @@
package org.oscim.android.tiling.source.mbtiles;
import org.oscim.core.BoundingBox;
import org.oscim.core.GeoPoint;
import org.oscim.core.MapPosition;
import org.oscim.map.Viewport;
import org.oscim.tiling.TileSource;
/**
* A tile source for MBTiles Raster and Vector databases.
* Supports the OpenMapTiles MVT pbf-gzip MBTiles format
* A tile source for MBTiles databases.
*/
public class MBTilesTileSource extends TileSource {
private final MBTilesTileDataSource mTileDataSource;
abstract public class MBTilesTileSource extends TileSource {
protected final MBTilesTileDataSource mTileDataSource;
/**
* Create a MBTiles tile source (Raster/Vector)
*
* @param path the path to the MBTiles database.
*/
public MBTilesTileSource(String path) {
this(path, null, null, null);
}
/**
* Create an MBTiles tile source with additional parameters
*
* @param path the path to the MBTiles database. (Raster & Vector)
* @param locale the database locale to use, e.g. "en", "de" (Vector only)
* @param alpha an optional alpha value [0-255] to make the tiles transparent. (Raster only)
* @param transparentColor an optional color that will be made transparent in the bitmap. (Raster only)
*/
public MBTilesTileSource(String path, String locale, Integer alpha, Integer transparentColor) {
mTileDataSource = new MBTilesTileDataSource(path, locale, alpha, transparentColor);
}
/**
* Create a MBTiles tile source (Vector only)
*
* @param path the path to the MBTiles database.
*/
public MBTilesTileSource(String path, String locale) {
this(path, locale, null, null);
public MBTilesTileSource(MBTilesTileDataSource tileDataSource) {
mTileDataSource = tileDataSource;
}
@Override

View File

@ -0,0 +1,4 @@
package org.oscim.android.tiling.source.mbtiles;
public class UnsupportedMBTilesDatabaseException extends RuntimeException {
}