OSMDROID在Android中显示多个带有多段线的地图

OSMDROID在Android中显示多个带有多段线的地图,android,maps,osmdroid,Android,Maps,Osmdroid,当我启动android应用程序时,我看到多个带有多段线的地图。如何仅显示一张地图 主要活动: 布局活动_main: 我只想在我的设备上看到一张地图。您的代码是正确的,您实际上只看到一张地图,这意味着只在地图组件上看到。地图被放大太多,比视图小。osmdroid库通过在视口中重复贴图来解决此问题。我认为没有办法关闭此功能 您可以通过设置一些合理的缩放级别来解决此问题 map.setZoomLevel(12) 我解决了这个问题: MapView map = (MapView) findViewBy

当我启动android应用程序时,我看到多个带有多段线的地图。如何仅显示一张地图

主要活动:

布局活动_main:


我只想在我的设备上看到一张地图。

您的代码是正确的,您实际上只看到一张地图,这意味着只在地图组件上看到。地图被放大太多,比视图小。osmdroid库通过在视口中重复贴图来解决此问题。我认为没有办法关闭此功能

您可以通过设置一些合理的缩放级别来解决此问题

map.setZoomLevel(12)

我解决了这个问题:

MapView map = (MapView) findViewById(R.id.map);
map.setScrollableAreaLimitDouble(new BoundingBox(85, 180, -85, -180));
map.setMaxZoomLevel(20.0);
map.setMinZoomLevel(4.0);
map.setHorizontalMapRepetitionEnabled(false);
map.setVerticalMapRepetitionEnabled(false);
map.setScrollableAreaLimitLatitude(MapView.getTileSystem().getMaxLatitude(), MapView.getTileSystem().getMinLatitude(), 0);

我不明白你所观察到的问题到底是什么。你能提供一个屏幕截图吗?@dEod很抱歉,我不明白你的问题。我解决了map.setScrollabealRealimi双边界框85,180,-85,-180;
map.setZoomLevel(12)
MapView map;
map.setHorizontalMapRepetitionEnabled(true);
map.setVerticalMapRepetitionEnabled(false);
map.setScrollableAreaLimitLatitude(MapView.getTileSystem().getMaxLatitude(), MapView.getTileSystem().getMinLatitude(), 0); 
MapView map = (MapView) findViewById(R.id.map);
map.setScrollableAreaLimitDouble(new BoundingBox(85, 180, -85, -180));
map.setMaxZoomLevel(20.0);
map.setMinZoomLevel(4.0);
map.setHorizontalMapRepetitionEnabled(false);
map.setVerticalMapRepetitionEnabled(false);
map.setScrollableAreaLimitLatitude(MapView.getTileSystem().getMaxLatitude(), MapView.getTileSystem().getMinLatitude(), 0);