• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TwoLevelTileCache类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.mapsforge.map.layer.cache.TwoLevelTileCache的典型用法代码示例。如果您正苦于以下问题:Java TwoLevelTileCache类的具体用法?Java TwoLevelTileCache怎么用?Java TwoLevelTileCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TwoLevelTileCache类属于org.mapsforge.map.layer.cache包,在下文中一共展示了TwoLevelTileCache类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createExternalStorageTileCache

import org.mapsforge.map.layer.cache.TwoLevelTileCache; //导入依赖的package包/类
static TileCache createExternalStorageTileCache(Context c, String id, int firstLevelSize, int tileSize) {
	Log.d(TAG, "createExternalStorageTileCache firstLevelSize=" + firstLevelSize);
	TileCache firstLevelTileCache = new InMemoryTileCache(firstLevelSize);
	if (storage != null) { // storage will be null if full
		String cacheDirectoryName = storage.getAbsolutePath() + File.separator + id;
		File cacheDirectory = new File(cacheDirectoryName);
		if (cacheDirectory.exists() || cacheDirectory.mkdirs()) {
			int tileCacheFiles = estimateSizeOfFileSystemCache(cacheDirectoryName, firstLevelSize, tileSize);
			if (cacheDirectory.canWrite() && tileCacheFiles > 0) {
				try {
					Log.d(TAG, "createExternalStorageTileCache tileCacheFiles=" + tileCacheFiles);
					TileCache secondLevelTileCache = new FileSystemTileCache(tileCacheFiles,
						cacheDirectory, AndroidGraphicFactory.INSTANCE, true, 25, true);
					return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
				} catch (IllegalArgumentException e) {
					Log.w(TAG, "createExternalStorageTileCache e=" + e);
				}
			}
		}
		else {
			Log.w(TAG, "createExternalStorageTileCache can't");
		}
	}
	return firstLevelTileCache;
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:26,代码来源:Map.java


示例2: createExternalStorageTileCache

import org.mapsforge.map.layer.cache.TwoLevelTileCache; //导入依赖的package包/类
/**
 * @param c
 *            the Android context
 * @param id
 *            name for the directory
 * @return a new cache created on the external storage
 */
@Deprecated
public static TileCache createExternalStorageTileCache(final Context c, final String id) {
	final TileCache firstLevelTileCache = new InMemoryTileCache(32);
	final String cacheDirectoryName = c.getExternalCacheDir().getAbsolutePath() + File.separator + id;
	final File cacheDirectory = new File(cacheDirectoryName);
	if (!cacheDirectory.exists()) {
		cacheDirectory.mkdir();
	}
	final TileCache secondLevelTileCache = new FileSystemTileCache(1024, cacheDirectory, AndroidGraphicFactory.INSTANCE);
	return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
}
 
开发者ID:saintbyte,项目名称:openbmap,代码行数:19,代码来源:MapUtils.java


示例3: createTileCache

import org.mapsforge.map.layer.cache.TwoLevelTileCache; //导入依赖的package包/类
private TileCache createTileCache(int index) {
	TileCache firstLevelTileCache = new InMemoryTileCache(128);
	File cacheDirectory = new File(System.getProperty("java.io.tmpdir"),
			"mapsforge" + index);
	TileCache secondLevelTileCache = new FileSystemTileCache(1024,
			cacheDirectory, GRAPHIC_FACTORY);
	return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
}
 
开发者ID:ianmalcolm,项目名称:DeadReckoning,代码行数:9,代码来源:MainFrame.java


示例4: LayerBase

import org.mapsforge.map.layer.cache.TwoLevelTileCache; //导入依赖的package包/类
LayerBase(Tabulae activity, MapView mapView, boolean persistant) {
	this.mapView = mapView;
	if (persistant) {
		int size = AndroidUtil.getMinimumCacheSize(activity, mapView.getModel().displayModel.getTileSize(), mapView.getModel().frameBufferModel.getOverdrawFactor(), 1f);
		//if (DEBUG) Log.d(TAG, "LayerBase.LayerBase minmal cache size=" + size);
		memCache = new InMemoryTileCache(size);
		tileCache = new TwoLevelTileCache(
				memCache,
				new FileSystemTileCache(99999, new File(activity.getTilesDir(), getId()), AndroidGraphicFactory.INSTANCE, true)
		);
	} else {
		tileCache = AndroidUtil.createTileCache(activity, getId(), mapView.getModel().displayModel.getTileSize(),
				1f, mapView.getModel().frameBufferModel.getOverdrawFactor());
	}
}
 
开发者ID:emdete,项目名称:tabulae,代码行数:16,代码来源:LayerBase.java


示例5: createTileCaches

import org.mapsforge.map.layer.cache.TwoLevelTileCache; //导入依赖的package包/类
@Override
protected void createTileCaches() {
	// to use a tile store you provide it as a cache (which is pre-filled and never purges any files.
	// additionally you should use a memory tile store for faster refresh.
	TileStore tileStore = new TileStore(new File(new File("/storage/sdcard1"), "tilestore"), ".png", AndroidGraphicFactory.INSTANCE);
	InMemoryTileCache memoryTileCache = new InMemoryTileCache(AndroidUtil.getMinimumCacheSize(this,
			this.mapView.getModel().displayModel.getTileSize(),
			this.mapView.getModel().frameBufferModel.getOverdrawFactor(), this.getScreenRatio()));
	this.tileCaches.add(new TwoLevelTileCache(memoryTileCache, tileStore));
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:11,代码来源:TileStoreLayerViewer.java


示例6: createExternalStorageTileCache

import org.mapsforge.map.layer.cache.TwoLevelTileCache; //导入依赖的package包/类
/**
 * @param c
 *            the Android context
 * @param id
 *            name for the directory
 * @return a new cache created on the external storage
 */
static TileCache createExternalStorageTileCache(Context c, String id) {
	TileCache firstLevelTileCache = new InMemoryTileCache(32);
	String cacheDirectoryName = c.getExternalCacheDir().getAbsolutePath() + File.separator + id;
	File cacheDirectory = new File(cacheDirectoryName);
	if (!cacheDirectory.exists()) {
		cacheDirectory.mkdir();
	}
	TileCache secondLevelTileCache = new FileSystemTileCache(1024, cacheDirectory, AndroidGraphicFactory.INSTANCE);
	return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
}
 
开发者ID:monossido,项目名称:CoopTDMOrienteering,代码行数:18,代码来源:Utils.java


示例7: createTileCache

import org.mapsforge.map.layer.cache.TwoLevelTileCache; //导入依赖的package包/类
/**
 * @param c
 *            the Android context
 * @return a new cache
 */
static TileCache createTileCache(Context c, String id) {
	TileCache firstLevelTileCache = new InMemoryTileCache(32);
	File cacheDirectory = c.getDir(id, Context.MODE_PRIVATE);
	TileCache secondLevelTileCache = new FileSystemTileCache(1024, cacheDirectory, AndroidGraphicFactory.INSTANCE);
	return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
}
 
开发者ID:monossido,项目名称:CoopTDMOrienteering,代码行数:12,代码来源:Utils.java


示例8: createTileCache

import org.mapsforge.map.layer.cache.TwoLevelTileCache; //导入依赖的package包/类
private static TileCache createTileCache() {
    TileCache firstLevelTileCache = new InMemoryTileCache(64);
    java.io.File cacheDirectory = new java.io.File(System.getProperty("java.io.tmpdir"), "mapsforge");
    TileCache secondLevelTileCache = new FileSystemTileCache(1024, cacheDirectory, GRAPHIC_FACTORY);
    return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:7,代码来源:MapPanel.java



注:本文中的org.mapsforge.map.layer.cache.TwoLevelTileCache类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Modified类代码示例发布时间:2022-05-23
下一篇:
Java Permiso类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap