本文整理汇总了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);
}
示例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);
}
示例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));
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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());
}
示例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;
}