osmdroid显示来自.mbtiles的地图

时间:2017-11-23 20:40:07

标签: android osmdroid mbtiles

尝试使用osmdroid 5.6.5 <。p>显示来自.mbtiles文件的地图时遇到问题

这是我的代码:

val path = Environment.getExternalStorageDirectory().absolutePath.plus("/osmdroid/tiles/map.mbtiles")
        val file = File(path)

        val tilesSource = XYTileSource(file.absolutePath, 1, 14, 256, "jpg", arrayOf<String>())

        val register = SimpleRegisterReceiver(this)

        val offProvider = OfflineTileProvider(register, arrayOf(file))



    mapView?.apply {
            setTileSource(tilesSource)
            tileProvider = offProvider
...
}

提前致谢

0 个答案:

没有答案