当前位置: 首页>>代码示例>>Java>>正文


Java TileRendererLayer.setTextScale方法代码示例

本文整理汇总了Java中org.mapsforge.map.layer.renderer.TileRendererLayer.setTextScale方法的典型用法代码示例。如果您正苦于以下问题:Java TileRendererLayer.setTextScale方法的具体用法?Java TileRendererLayer.setTextScale怎么用?Java TileRendererLayer.setTextScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mapsforge.map.layer.renderer.TileRendererLayer的用法示例。


在下文中一共展示了TileRendererLayer.setTextScale方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onStart

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
@Override public void onStart() {
	super.onStart();
	if (DEBUG) { Log.d(TAG, "Map.onStart"); }
	// warp to 'unter den linden'
	mapView.getModel().mapViewPosition.setCenter(new LatLong(52.517037, 13.38886));
	mapView.getModel().mapViewPosition.setZoomLevel((byte)12);
	MultiMapDataStore multiMapDataStore = new MultiMapDataStore(MultiMapDataStore.DataPolicy.DEDUPLICATE);
	tileLayer = new TileRendererLayer(tileCache, multiMapDataStore, mapView.getModel().mapViewPosition,
		false, true, AndroidGraphicFactory.INSTANCE);
	tileLayer.setTextScale(1.5f);
	multiMapDataStore.addMapDataStore(new MapFile(new File(MAPFILE1)), true, true);
	multiMapDataStore.addMapDataStore(new MapFile(new File(MAPFILE2)), false, false);
	multiMapDataStore.addMapDataStore(new MapFile(new File(MAPFILE0)), false, false);
	try {
		tileLayer.setXmlRenderTheme(new ExternalRenderTheme(new File(THEMEFILE))); // set a different render theme
	}
	catch (FileNotFoundException ignore) {
		tileLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER); // fallback if not founr
	}
	mapView.getLayerManager().getLayers().add(tileLayer);
	mapView.getLayerManager().getLayers().add( // add a grid around each tile
		new TileGridLayer(AndroidGraphicFactory.INSTANCE, mapView.getModel().displayModel));
	mapView.getLayerManager().getLayers().add( // add text to show x/y/z of each tile
		new TileCoordinatesLayer(AndroidGraphicFactory.INSTANCE, mapView.getModel().displayModel));
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:26,代码来源:Map.java

示例2: loadMap

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
/**
 * load map to mapView
 *
 * @param areaFolder
 */
public void loadMap(File areaFolder) {
    logToast("Loading map: " + currentArea);
    File mapFile = new File(areaFolder, currentArea + ".map");
    mapView.getLayerManager().getLayers().clear();
    TileRendererLayer tileRendererLayer =
            new TileRendererLayer(tileCache, mapView.getModel().mapViewPosition, false, true,
                    AndroidGraphicFactory.INSTANCE) {
                @Override public boolean onTap(LatLong tapLatLong, Point layerXY, Point tapXY) {
                    return myOnTap(tapLatLong, layerXY, tapXY);
                }
            };
    tileRendererLayer.setMapFile(mapFile);
    tileRendererLayer.setTextScale(0.8f);
    tileRendererLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
    //        log("last location " + Variable.getVariable().getLastLocation());
    if (Variable.getVariable().getLastLocation() == null) {
        centerPointOnMap(tileRendererLayer.getMapDatabase().getMapFileInfo().boundingBox.getCenterPoint(), 6);
    } else {
        centerPointOnMap(Variable.getVariable().getLastLocation(), Variable.getVariable().getLastZoomLevel());
    }

    mapView.getLayerManager().getLayers().add(tileRendererLayer);
    ViewGroup.LayoutParams params =
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    activity.addContentView(mapView, params);
    loadGraphStorage();
}
 
开发者ID:junjunguo,项目名称:PocketMaps,代码行数:33,代码来源:MapHandler.java

示例3: createTileRendererLayer

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
/**
 * Creates a tile layer, which optionally supports long press actions and custom render themes
 * @param tileCache
 * @param mapViewPosition
 * @param mapFile
 * @param renderTheme
 * @return
 */
public static Layer createTileRendererLayer(final TileCache tileCache, final MapViewPosition mapViewPosition,
		final MapFile mapFile, final XmlRenderTheme renderTheme, final onLongPressHandler handler) {

	if (mapFile == null) {
		return null;
	}

	final TileRendererLayer tileRendererLayer = new TileRendererLayer(tileCache, mapFile, mapViewPosition, AndroidGraphicFactory.INSTANCE) {
		@Override
		public boolean onLongPress(LatLong tapLatLong, Point thisXY, Point tapXY) {
               if (handler != null) {
                   ((onLongPressHandler)handler).onLongPress(tapLatLong, thisXY, tapXY);
                   return true;
               } else {
                   return false;
               }
		}
	};

       if (renderTheme == null) {
           Log.i(TAG, "Using default render theme");
           tileRendererLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
       } else {
           Log.i(TAG, "Using custom theme");
           tileRendererLayer.setXmlRenderTheme(renderTheme);
       }

       tileRendererLayer.setTextScale(1.5f);
       return tileRendererLayer;
}
 
开发者ID:openbmap,项目名称:radiocells-scanner-android,代码行数:39,代码来源:MapUtils.java

示例4: createTileRendererLayer

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
private TileRendererLayer createTileRendererLayer(TileCache tileCache,
                                                  MapViewPosition mapViewPosition, File mapFile,
                                                  XmlRenderTheme renderTheme) {
    MapDataStore mapDataStore = new MapFile(mapFile);

    TileRendererLayer tileRendererLayer = AndroidUtil.createTileRendererLayer(tileCache,
            mapViewPosition, mapDataStore, renderTheme, false, false, true);
    tileRendererLayer.setTextScale(1.5f);

    return tileRendererLayer;
}
 
开发者ID:marunjar,项目名称:anewjkuapp,代码行数:12,代码来源:MapFragment.java

示例5: createTileRendererLayer

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
static Layer createTileRendererLayer(TileCache tileCache, MapViewPosition mapViewPosition, File mapFile) {
	TileRendererLayer tileRendererLayer = new TileRendererLayer(tileCache, mapViewPosition,
			false, false, AndroidGraphicFactory.INSTANCE);
	tileRendererLayer.setMapFile(mapFile);
	tileRendererLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
	tileRendererLayer.setTextScale(1.5f);
	return tileRendererLayer;
}
 
开发者ID:monossido,项目名称:CoopTDMOrienteering,代码行数:9,代码来源:Utils.java

示例6: createTileRendererLayer

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
static TileRendererLayer createTileRendererLayer(TileCache tileCache,
		MapViewPosition mapViewPosition, File mapFile,
		XmlRenderTheme renderTheme, boolean hasAlpha) {
	TileRendererLayer tileRendererLayer = new TileRendererLayer(tileCache,
			mapViewPosition, hasAlpha, AndroidGraphicFactory.INSTANCE);
	tileRendererLayer.setMapFile(mapFile);
	tileRendererLayer.setXmlRenderTheme(renderTheme);
	tileRendererLayer.setTextScale(1.5f);
	return tileRendererLayer;
}
 
开发者ID:nirabpudasaini,项目名称:Mero-Bhada-Meter,代码行数:11,代码来源:Utils.java


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