0

我在尝试使用 osmdroid 5.6.5 从 .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
...
}

提前致谢

4

0 回答 0