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

Java MultiMapDataStore类代码示例

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

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



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

示例1: MapsforgeTileSource

import org.mapsforge.map.datastore.MultiMapDataStore; //导入依赖的package包/类
/**
     * The reason this constructor is protected is because all parameters,
     * except file should be determined from the archive file. Therefore a
     * factory method is necessary.
     *
     * @param file
     * @param xmlRenderTheme the themeFuture to render tiles with
     */
    protected MapsforgeTileSource(Application app,
                                  File file,
                                  XmlRenderTheme xmlRenderTheme,
                                  MultiMapDataStore.DataPolicy dataPolicy) {

        AndroidGraphicFactory.createInstance(app);

//        model.setFixedTileSize(256);

        mapDatabase = new MultiMapDataStore(dataPolicy);
        mapDatabase.addMapDataStore(new MapFile(file), false, false);

        InMemoryTileCache tileCache = new InMemoryTileCache(5);
        renderer = new DatabaseRenderer(mapDatabase, factory, tileCache,
                new TileBasedLabelStore(tileCache.getCapacityFirstLevel()), true, true, null);

        Log.d(TAG, "min=" + MIN_ZOOM + " max=" + MAX_ZOOM + " tilesize=" + TILE_SIZE_PIXELS);

        themeFuture = new RenderThemeFuture(factory, xmlRenderTheme, model);
        //super important!! without the following line, all rendering activities will block until the themeFuture is created.
        new Thread(themeFuture).start();

    }
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:32,代码来源:MapsforgeTileSource.java


示例2: onCreate

import org.mapsforge.map.datastore.MultiMapDataStore; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mapView = new MapView(this);
    mapView.setClickable(true);
    mapView.getMapScaleBar().setVisible(true);
    mapView.setBuiltInZoomControls(true);
    mapView.getMapZoomControls().setZoomLevelMin((byte) 5);
    mapView.getMapZoomControls().setZoomLevelMax((byte) 20);

    worldMap = new MapFile(new File(Constant.PATH_WORLDMAP));
    taiwanMap = new MapFile(new File(Constant.PATH_TAIWANMAP));
    multiMapDataStore = new MultiMapDataStore(MultiMapDataStore.DataPolicy.RETURN_ALL);

    tileCache = AndroidUtil.createTileCache(this, "mapcache", mapView.getModel().displayModel.getTileSize(), 1f, this.mapView.getModel().frameBufferModel.getOverdrawFactor());
    setContentView(mapView);
}
 
开发者ID:lienching,项目名称:MapsforgeSample,代码行数:19,代码来源:SimpleMapView.java


示例3: MapsforgeNwwLayer

import org.mapsforge.map.datastore.MultiMapDataStore; //导入依赖的package包/类
public MapsforgeNwwLayer(String layerName, File[] mapsforgeFiles, Integer tileSize, Float scaleFactor)
		throws Exception {
	super(makeLevels(layerName, getTilegenerator(mapsforgeFiles, tileSize, scaleFactor), tileSize));
	this.layerName = layerName;
	this.setUseTransparentTextures(true);

	MultiMapDataStore mapDatabase = new MultiMapDataStore(DataPolicy.RETURN_ALL);
	for (int i = 0; i < mapsforgeFiles.length; i++)
		mapDatabase.addMapDataStore(new MapFile(mapsforgeFiles[i]), false, false);
	BoundingBox boundingBox = mapDatabase.boundingBox();
	LatLong centerPoint = boundingBox.getCenterPoint();
	centerCoordinate = new Coordinate(centerPoint.longitude, centerPoint.latitude);
	mapDatabase.close();
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:15,代码来源:MapsforgeNwwLayer.java


示例4: getTilegenerator

import org.mapsforge.map.datastore.MultiMapDataStore; //导入依赖的package包/类
private static OsmTilegenerator getTilegenerator(File[] mapsforgeFiles, Integer tileSize, Float scaleFactor) {
	if (tileSize == null || tileSize < 256) {
		tileSize = TILESIZE;
	}
	if (scaleFactor == null)
		scaleFactor = 1.5f;

	MapWorkerPool.NUMBER_OF_THREADS = 4;
	// Map buffer size
	ReadBuffer.setMaximumBufferSize(6500000);
	// Square frame buffer
	FrameBufferController.setUseSquareFrameBuffer(false);

	DisplayModel model = new DisplayModel();
	model.setUserScaleFactor(scaleFactor);
	model.setFixedTileSize(tileSize);

	DataPolicy dataPolicy = DataPolicy.RETURN_ALL;
	MultiMapDataStore mapDatabase = new MultiMapDataStore(dataPolicy);
	for (int i = 0; i < mapsforgeFiles.length; i++)
		mapDatabase.addMapDataStore(new MapFile(mapsforgeFiles[i]), false, false);

	InMemoryTileCache tileCache = new InMemoryTileCache(200);
	DatabaseRenderer renderer = new DatabaseRenderer(mapDatabase, AwtGraphicFactory.INSTANCE, tileCache,
			new TileBasedLabelStore(tileCache.getCapacityFirstLevel()), true, true);
	InternalRenderTheme xmlRenderTheme = InternalRenderTheme.DEFAULT;
	RenderThemeFuture theme = new RenderThemeFuture(AwtGraphicFactory.INSTANCE, xmlRenderTheme, model);
	// super important!! without the following line, all rendering
	// activities will block until the theme is created.
	new Thread(theme).start();

	// TODO get back external themes
	// DatabaseRenderer dbRenderer = null;
	// XmlRenderTheme xmlRenderTheme = null;
	// DisplayModel displayModel = null;
	// if (mapsforgeFile.exists()) {
	// mapDatabase.openFile(mapsforgeFile);
	// dbRenderer = new DatabaseRenderer(mapDatabase, graphicFactory);
	//
	// String mapName =
	// FileUtilities.getNameWithoutExtention(mapsforgeFiles[0]);
	// File xmlStyleFile = new File(mapsforgeFiles[0].getParentFile(),
	// mapName + ".xml");
	// if (xmlStyleFile.exists()) {
	// try {
	// xmlRenderTheme = new ExternalRenderTheme(xmlStyleFile);
	// } catch (Exception e) {
	// xmlRenderTheme = InternalRenderTheme.OSMARENDER;
	// }
	// } else {
	// xmlRenderTheme = InternalRenderTheme.OSMARENDER;
	// }
	// displayModel = new DisplayModel();
	// displayModel.setUserScaleFactor(tileSize / 256f);
	// }

	return new OsmTilegenerator(mapDatabase, renderer, theme, model, tileSize);
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:59,代码来源:MapsforgeNwwLayer.java


示例5: createFromFiles

import org.mapsforge.map.datastore.MultiMapDataStore; //导入依赖的package包/类
/**
 * Creates a new MapsForgeTileSource from file.
 * <p></p>
 * Parameters minZoom and maxZoom are obtained from the
 * database. If they cannot be obtained from the DB, the default values as
 * defined by this class are used, which is zoom = 3-20
 *
 * @param file
 * @return the tile source
 */
public static MapsForgeTileSource createFromFiles(File[] file) {
    //these settings are ignored and are set based on .map file info
    int minZoomLevel = MIN_ZOOM;
    int maxZoomLevel = MAX_ZOOM;
    int tileSizePixels = TILE_SIZE_PIXELS;

    return new MapsForgeTileSource(InternalRenderTheme.OSMARENDER.name(), minZoomLevel, maxZoomLevel, tileSizePixels, file, InternalRenderTheme.OSMARENDER, MultiMapDataStore.DataPolicy.RETURN_ALL, null);
}
 
开发者ID:osmdroid,项目名称:osmdroid,代码行数:19,代码来源:MapsForgeTileSource.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java H2Dialect类代码示例发布时间:2022-05-23
下一篇:
Java MapEventsOverlay类代码示例发布时间: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