0

我正在使用 Mapboxgl - qml,一切都很好,但我不能倾斜到 45 以上,天空层找不到代码:main.qml

import QtLocation 5.12
import QtPositioning 5.12
import QtQuick 2.12


Map {
        id: map
        anchors.fill: parent

        plugin: Plugin {
            name: "mapboxgl"
            PluginParameter {
                name: "mapboxgl.access_token"
                value: "pk.eyJ1IjoibWlsYWRsb3ZlYm90aCIsImEiOiJjanZiaHlrZXEwczF5NDRxZnp0cnFseG9jIn0.CZjNPyoSnkUG4NaEzvb36A"
            }
            PluginParameter{
                name: "mapboxgl.mapping.additional_style_urls"
                value: "mapbox://styles/miladloveboth/ckkpdclqt0siu17nppaymn68a"
            }
            PluginParameter {
                name: "mapboxgl.mapping.use_fbo"
                value: true
            }

            PluginParameter {
                name: "mapboxgl.mapping.items.insert_before"
                value: "aerialway"
            }
        }

        center: QtPositioning.coordinate(44.190448, 35.402046) // Helsinki
        zoomLevel: 16
        minimumZoomLevel: 0
        maximumZoomLevel: 20
        gesture.enabled: true
        tilt: 45
        activeMapType: map.supportedMapTypes[0]
         MapParameter {
            type: "paint"
            property var layer: "sky"
            property var skyType: "atmosphere"
        }
     }

当我运行它时,我得到了这个错误:

    Threaded rendering is not optimal in the Mapbox GL plugin.
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [3]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [3]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [3]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [3]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [2]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [2]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [2]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [2]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [2]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [2]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [3]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [3]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [2]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [1]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: [1]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead."
[ WARNING ]  "{QSGRenderThread}[ParseStyle]: invalid layer type"
Layer not found: "sky"
[ INFO ]  "{QSGRenderThread}[General]: GPU Identifier: SVGA3D; build: RELEASE;  LLVM;"

我在 Mapbox Studio 添加了天空图层,我可以在我的自定义 mapbox 样式 JSON 中看到天空图层(使用 ctrl+F 搜索“天空”,你可以看到它) 自定义 mapbox 样式链接 所以我的问题是什么?我也尝试了这种方法,但我也一无所获:

MapParameter {
                type: "sky"
                property var layer: "sky"
                property var skyType: "atmosphere"
            }

和这个:

MapParameter {
                type: "layer"
                property var layer: "sky"
                property var paint:{
                "sky-type": "atmosphere"
                }
            }

我得到了一些错误:

Invalid value for property 'type': 'sky'

#ubuntu@uname -a

Linux ubuntu 5.8.0-41-generic #46~20.04.1-Ubuntu SMP Mon Jan 18 17:52:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

QT 版本是 14.13.1 那么我如何在我的 mapboxgl 中使用天空?抱歉英语不好 - milad 来自伊朗 - 谢谢你们

4

0 回答 0