Android MapBox无法从OOB(APK扩展)文件加载地图

时间:2018-04-02 15:58:11

标签: android mapbox mapbox-gl apk-expansion-files mapbox-android

我有MapBox的离线地图,当我从assets文件夹加载地图时一切正常

"sources": {
    "mapbox": {
        "tiles": [
            "asset://mapparis/{z}/{x}/{y}.pbf"
        ],
        "type": "vector"
    }
}

但是当我从已安装的OBB文件

加载地图时
"sources": {
    "mapbox": {
        "tiles": [
            "/mnt/obb/a2d68a13d68baf704a98a82bc8f9d62f/mapparis/{z}/{x}/{y}.pbf"
        ],
        "type": "vector"
    }
}

我有一个错误:

E/mbgl: {GLThread 7385}[Style]: Failed to load tile 0/0/0=>0 for source openmaptiles: Attempt to invoke virtual method 'java.lang.String okhttp3.HttpUrl.host()' on a null object reference

我解析了已挂载的OBB,所有文件夹都存在于原始文件夹中。

1 个答案:

答案 0 :(得分:0)

必须使用file://前缀

file://mnt/obb/a2d68a13d68baf704a98a82bc8f9d62f/mapparis/{z}/{x}/{y}.pbf