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


Java OsmTileLayer类代码示例

本文整理汇总了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;
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:13,代码来源:Map.java

示例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;
}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:6,代码来源:OSciMap.java

示例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();
}
 
开发者ID:andreynovikov,项目名称:trekarta,代码行数:43,代码来源:MainActivity.java


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