OSM上的多边形孔

时间:2015-03-23 18:49:38

标签: android openstreetmap osmdroid

我最近在Android的开放街道地图中从3.05升级到4.2,我曾使用下面的代码初始化我的mapview

        mapView = (MapView) findViewById(R.id.mapView);
        mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);

这曾经在android的osm库的3.x版本中正常工作,但是tile不会加载到4.2中。在LogCat中,我去了那两个错误,但我不知道是否与osm有关。

1

  03-23 20:44:35.773: I/o*.o*.v*.MapView(9397): Using tile source: org.osmdroid.tileprovider.tilesource.XYTileSource@428fabb0
03-23 20:44:35.773: I/AndroidLoggerFactory(9397): Logger name 'org.osmdroid.tileprovider.MapTileProviderBase' exceeds maximum length of 23 characters, using 'o*.o*.t*.MapTileProvid*' instead.
03-23 20:44:35.773: I/AndroidLoggerFactory(9397): Logger name 'org.osmdroid.tileprovider.LRUMapTileCache' exceeds maximum length of 23 characters, using 'o*.o*.t*.LRUMapTileCac*' instead.
03-23 20:44:35.773: I/AndroidLoggerFactory(9397): Logger name 'org.osmdroid.tileprovider.modules.TileWriter' exceeds maximum length of 23 characters, using 'o*.o*.t*.m*.TileWriter' instead.
03-23 20:44:35.773: I/AndroidLoggerFactory(9397): Logger name 'org.osmdroid.tileprovider.modules.MapTileModuleProviderBase' exceeds maximum length of 23 characters, using 'o*.o*.t*.m*.MapTileMod*' instead.
03-23 20:44:35.773: E/File(9397): fail readDirectory() errno=13

2

03-23 20:44:44.083: I/System.out(9397): downloader calls detatch()
03-23 20:44:44.103: I/System.out(9397): downloader calls detatch()
03-23 20:44:44.583: W/System.err(9397): [DEBUG] GbaRequest - GbaRequest: Constructor Called 222 userAgent Apache-HttpClient/UNAVAILABLE (java 1.4)
03-23 20:44:44.583: W/System.err(9397): [DEBUG] NafRequest - NafRequest: NafRequest constructor===useragent Apache-HttpClient/UNAVAILABLE (java 1.4)
03-23 20:44:44.603: W/System.err(9397): [DEBUG] GbaRequest - GbaRequest: Constructor Called 222 userAgent Apache-HttpClient/UNAVAILABLE (java 1.4)
03-23 20:44:44.603: W/System.err(9397): [DEBUG] NafRequest - NafRequest: NafRequest constructor===useragent Apache-HttpClient/UNAVAILABLE (java 1.4)

任何人都可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

我解决了。我必须添加write_external_storage和read_external_storage权限,以便osm可以下载切片。