Hi,
I am using VTM 0.15.0 and want to add a custom tile server(like
a.tile.openstreetmap.fr) to map. This is my code but not working:
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (USE_CACHE) {
// Cache the tiles into file system
File cacheDirectory = new File(getExternalCacheDir(), "tiles");
int cacheSize = 10 * 1024 * 1024; // 10 MB
Cache cache = new Cache(cacheDirectory, cacheSize);
builder.cache(cache);
}
mTileSource.setHttpEngine(new OkHttpEngine.OkHttpFactory(builder));
mTileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-android-example"));
mBitmapLayer = new BitmapTileLayer(mMap, mTileSource);
mMap.layers().add(mBitmapLayer);