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


Java TileRendererLayer.setXmlRenderTheme方法代码示例

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


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

示例1: createLayers

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
@Override
protected void createLayers() {
	TileRendererLayer tileRendererLayer = new TileRendererLayer(
			this.tileCaches.get(0), getMapFile(),
			this.mapView.getModel().mapViewPosition,
			false, true,
			org.mapsforge.map.android.graphics.AndroidGraphicFactory.INSTANCE) {
		@Override
		public boolean onLongPress(LatLong tapLatLong, Point thisXY,
				Point tapXY) {
			LongPressAction.this.onLongPress(tapLatLong);
			return true;
		}
	};
	tileRendererLayer.setXmlRenderTheme(this.getRenderTheme());
	mapView.getLayerManager().getLayers().add(tileRendererLayer);
	BLACK.setTextSize(22);
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:19,代码来源:LongPressAction.java

示例2: 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);
	multiMapDataStore.addMapDataStore(new MapFile(new File(MAPFILE1)), true, true);
	multiMapDataStore.addMapDataStore(new MapFile(new File(MAPFILE2)), false, false);
	tileLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
	mapView.getLayerManager().getLayers().add(tileLayer);
	Bitmap bitmap = AndroidGraphicFactory.convertToBitmap(getResources().getDrawable(R.drawable.poi_black));
	bitmap.incrementRefCount();
	Marker marker = new Marker(new LatLong(52.517037, 13.38886), bitmap, 0, -bitmap.getHeight() / 2) {
		@Override public boolean onTap(LatLong geoPoint, Point viewPosition, Point tapPoint) {
			if (contains(viewPosition, tapPoint)) {
				Toast.makeText(getActivity(), "Unter den Linden Ecke Friedrichstraße, Berlin", Toast.LENGTH_SHORT).show();
				return true;
			}
			return false;
		}
	};
	mapView.getLayerManager().getLayers().add(marker);
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:27,代码来源:Map.java

示例3: 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

示例4: 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);
	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);
	tileLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
	mapView.getLayerManager().getLayers().add(tileLayer);
	myLocationOverlay = new ThreeStateLocationOverlay(getActivity(), mapView.getModel().mapViewPosition);
	myLocationOverlay.setSnapToLocationEnabled(true);
	mapView.getLayerManager().getLayers().add(myLocationOverlay);
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:19,代码来源:Map.java

示例5: 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

示例6: createTileRendererLayer

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
private TileRendererLayer createTileRendererLayer(TileCache tileCache,
		MapViewPosition mapViewPosition, boolean isTransparent,
		boolean renderLabels, File mapFile) {
	TileRendererLayer tileRendererLayer = new TileRendererLayer(tileCache,
			new MapFile(mapFile), mapViewPosition, isTransparent,
			renderLabels, GRAPHIC_FACTORY);
	tileRendererLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
	return tileRendererLayer;
}
 
开发者ID:ianmalcolm,项目名称:DeadReckoning,代码行数:10,代码来源:MainFrame.java

示例7: onStart

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
@Override
protected void onStart() {
    super.onStart();
    multiMapDataStore.addMapDataStore(worldMap,true,true);
    multiMapDataStore.addMapDataStore(taiwanMap,false,false);
    //multiMapDataStore.setStartPosition(new LatLong(23, 121));
    //multiMapDataStore.setStartZoomLevel((byte) 7);
    tileRendererLayer = new TileRendererLayer(tileCache,multiMapDataStore,mapView.getModel().mapViewPosition,false,true, AndroidGraphicFactory.INSTANCE);
    tileRendererLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);

    mapView.getModel().mapViewPosition.setMapPosition(new MapPosition(new LatLong(23, 121), (byte) 7));
    mapView.getLayerManager().getLayers().add(tileRendererLayer);
}
 
开发者ID:lienching,项目名称:MapsforgeSample,代码行数:14,代码来源:SimpleMapView.java

示例8: 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

示例9: onStart

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
@Override public void onStart() {
	super.onStart();
	if (DEBUG) { Log.d(TAG, "Map.onStart"); }
	List<LatLong> latLongs = polyline.getLatLongs();
	LatLong latLong = new LatLong(52.5, 13.4);
	try {
		for (TrackGpxParser.TrackPoint trackPoint : new TrackGpxParser(new File(GPXFILE))) {
			latLong = trackPoint;
			latLongs.add(latLong);
		}
		// add: mapView.getModel().mapViewPosition.setMapPosition(new MapPosition(bb.getCenterPoint(), LatLongUtils.zoomForBounds(dimension, bb, mapView.getModel().displayModel.getTileSize())));
	}
	catch (Exception e) {
		Log.e(TAG, "Map.onStart", e);
	}
	// warp to track
	mapView.getModel().mapViewPosition.setCenter(latLong);
	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);
	multiMapDataStore.addMapDataStore(new MapFile(new File(MAPFILE1)), true, true);
	multiMapDataStore.addMapDataStore(new MapFile(new File(MAPFILE2)), false, false);
	tileLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
	mapView.getLayerManager().getLayers().add(tileLayer);
	mapView.getLayerManager().getLayers().add(polyline);
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:28,代码来源:Map.java

示例10: onStart

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
@Override
public void onStart() {
	super.onStart();
	if (DEBUG) {
		Log.d(TAG, "Map.onStart");
	}
	MultiMapDataStore multiMapDataStore = new MultiMapDataStore(MultiMapDataStore.DataPolicy.DEDUPLICATE);
	tileLayer = new TileRendererLayer(tileCache, multiMapDataStore, mapView.getModel().mapViewPosition,
			false, true, AndroidGraphicFactory.INSTANCE);
	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);
	tileLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
	mapView.getLayerManager().getLayers().add(tileLayer);
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:16,代码来源:Map.java

示例11: 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);
	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);
	tileLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
	mapView.getLayerManager().getLayers().add(tileLayer);
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:16,代码来源:Map.java

示例12: onStart

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
@Override protected void onStart() {
	super.onStart();
	if (DEBUG) Log.d(TAG, "onStart");
	// warp to 'unter den linden'
	mapView.getModel().mapViewPosition.setCenter(new LatLong(52.517037, 13.38886));
	mapView.getModel().mapViewPosition.setZoomLevel((byte)12);
	tileLayer = new TileRendererLayer(tileCache, new MapFile(new File(MAPFILE)), mapView.getModel().mapViewPosition,
		false, true, AndroidGraphicFactory.INSTANCE);
	tileLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);
	mapView.getLayerManager().getLayers().add(tileLayer);
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:12,代码来源:Sample.java

示例13: 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

示例14: createLayers

import org.mapsforge.map.layer.renderer.TileRendererLayer; //导入方法依赖的package包/类
protected void createLayers() {
	TileRendererLayer tileRendererLayer = new TileRendererLayer(
			this.tileCache,
			this.mapViewPositions.get(0),
			false,
			org.mapsforge.map.android.graphics.AndroidGraphicFactory.INSTANCE) {
		@Override
		public boolean onLongPress(LatLong tapLatLong, Point thisXY,
				Point tapXY) {
			OfflineMapActivity.this.onLongPress(tapLatLong);
			return true;
		}
	};
	tileRendererLayer.setMapFile(this.getMapFile());
	tileRendererLayer.setXmlRenderTheme(this.getRenderTheme());
	this.layerManagers.get(0).getLayers().add(tileRendererLayer);

	// a marker to show at the position
	Drawable drawable = getResources().getDrawable(R.drawable.taxi_icon1);
	Bitmap bitmap = AndroidGraphicFactory.convertToBitmap(drawable);

	// create the overlay and tell it to follow the location
	this.myLocationOverlay = new MyLocationOverlay(this,
			this.mapViewPositions.get(0), bitmap);
	this.myLocationOverlay.setSnapToLocationEnabled(false);
	this.layerManagers.get(0).getLayers().add(this.myLocationOverlay);

	addOverlayLayers(layerManagers.get(0).getLayers());
}
 
开发者ID:nirabpudasaini,项目名称:Mero-Bhada-Meter,代码行数:30,代码来源:OfflineMapActivity.java

示例15: 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.setXmlRenderTheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。