本文整理汇总了Java中com.mapzen.tangram.HttpHandler类的典型用法代码示例。如果您正苦于以下问题:Java HttpHandler类的具体用法?Java HttpHandler怎么用?Java HttpHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HttpHandler类属于com.mapzen.tangram包,在下文中一共展示了HttpHandler类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.mapzen.tangram.HttpHandler; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
view = (CardboardView)findViewById(R.id.map);
mapController = new CardboardMapController(this, "vr_scene.yaml", view);
view.setRenderer(mapController);
HttpHandler handler = new HttpHandler();
File cacheDir = getExternalCacheDir();
if (cacheDir != null && cacheDir.exists()) {
handler.setCache(new File(cacheDir, "tile_cache"), 30 * 1024 * 1024);
}
mapController.setHttpHandler(handler);
setCardboardView(view);
setConvertTapIntoTrigger(true);
goToLocation(locationIndex);
}
示例2: createHttpHandler
import com.mapzen.tangram.HttpHandler; //导入依赖的package包/类
private HttpHandler createHttpHandler()
{
int cacheSize = PreferenceManager.getDefaultSharedPreferences(getContext()).getInt(Prefs.MAP_TILECACHE, 50);
File cacheDir = getContext().getExternalCacheDir();
if (cacheDir != null && cacheDir.exists())
{
return new TileHttpHandler(apiKey, new File(cacheDir, "tile_cache"), cacheSize * 1024L * 1024L);
}
return new TileHttpHandler(apiKey);
}