1

我有来自 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,所有文件夹都像原始文件夹一样存在。

4

1 回答 1

0

必须使用file://前缀

file://mnt/obb/a2d68a13d68baf704a98a82bc8f9d62f/mapparis/{z}/{x}/{y}.pbf
于 2018-04-07T15:14:43.443 回答