本文整理汇总了Java中org.oscim.layers.tile.vector.OsmTileLayer类的典型用法代码示例。如果您正苦于以下问题:Java OsmTileLayer类的具体用法?Java OsmTileLayer怎么用?Java OsmTileLayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OsmTileLayer类属于org.oscim.layers.tile.vector包,在下文中一共展示了OsmTileLayer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setBaseMap
import org.oscim.layers.tile.vector.OsmTileLayer; //导入依赖的package包/类
/**
* Create OsmTileLayer with given TileSource and
* set as base map (layer 1)
*
* TODO deprecate
*/
public VectorTileLayer setBaseMap(TileSource tileSource) {
VectorTileLayer l = new OsmTileLayer(this);
l.setTileSource(tileSource);
setBaseMap(l);
return l;
}
示例2: createVectorTileLayer
import org.oscim.layers.tile.vector.OsmTileLayer; //导入依赖的package包/类
protected VectorTileLayer createVectorTileLayer(Map map) {
OsmTileLayer vectorTileLayer = new OsmTileLayer(map);
vectorTileLayer.setTileSource(tileSource);
return vectorTileLayer;
}
示例3: showBitmapMap
import org.oscim.layers.tile.vector.OsmTileLayer; //导入依赖的package包/类
private void showBitmapMap(MapFile mapFile, boolean reposition) {
logger.debug("showBitmapMap({})", mapFile.name);
showHideMapObjects(true);
mapFile.tileSource.open();
if ("vtm".equals(mapFile.tileSource.getOption("format"))) {
OsmTileLayer layer = new OsmTileLayer(mMap);
layer.setTileSource(mapFile.tileSource);
layer.setRenderTheme(ThemeLoader.load(Themes.MAPTREK));
mapFile.tileLayer = layer;
} else {
mapFile.tileLayer = new BitmapTileLayer(mMap, mapFile.tileSource, 1 - mBitmapMapTransparency * 0.01f);
}
mMap.layers().add(mapFile.tileLayer, MAP_MAPS);
mBitmapLayerMap = mapFile;
if (!reposition)
return;
MapPosition position = mMap.getMapPosition();
boolean positionChanged = false;
if (!mapFile.boundingBox.contains(position.getGeoPoint())) {
position.setPosition(mapFile.boundingBox.getCenterPoint());
positionChanged = true;
}
if (position.getZoomLevel() > mapFile.tileSource.getZoomLevelMax()) {
position.setScale((1 << mapFile.tileSource.getZoomLevelMax()) - 5);
positionChanged = true;
}
int minZoomLevel = mapFile.tileSource.getZoomLevelMin();
if (mapFile.tileSource instanceof SQLiteTileSource) {
minZoomLevel = ((SQLiteTileSource) mapFile.tileSource).sourceZoomMin;
}
double minScale = (1 << minZoomLevel) * 0.7 + (1 << (minZoomLevel + 1)) * 0.3 + 5;
if (position.getScale() < minScale) {
position.setScale(minScale);
positionChanged = true;
}
if (positionChanged)
mMap.animator().animateTo(MAP_POSITION_ANIMATION_DURATION, position);
else
//TODO Bitmap layer should respond to update map (see TileLayer)
mMap.clearMap();
}