【发布时间】:2020-08-04 12:36:39
【问题描述】:
我尝试使用 osmdroid 实现 OSM,到目前为止我能够正确地做所有事情。但我想知道如何将两个平铺源设置在彼此之上。
以下是我尝试实现的方式:
map = (MapView) findViewById(R.id.map);
map.getTileProvider().getTileCache().getProtectedTileComputers().clear();
map.getTileProvider().getTileCache().setAutoEnsureCapacity(false);
map.setTileSource(TileSourceFactory.MAPNIK);
map.setTileSource(new OnlineTileSourceBase("USGS Topo", 0, 18, 256, ".png?apikey=123",
new String[] { "https://api.xyz.com/maps/satellite/zxy/2020-04-21T16:10:00Z/" }) {
@Override
public String getTileURLString(long pMapTileIndex) {
return getBaseUrl()
+ MapTileIndex.getZoom(pMapTileIndex)
+ "/" + MapTileIndex.getY(pMapTileIndex)
+ "/" + MapTileIndex.getX(pMapTileIndex)
+ mImageFilenameEnding;
}
});
map.setVerticalMapRepetitionEnabled(false);
到目前为止,我的输出低于输出,但卫星图块源下没有 mapnik 源。
但我需要输出看起来像这样
我如何做到这一点?
【问题讨论】:
标签: java android openstreetmap osmdroid