0

I have created custom map style in Mapbox Studio with 3D terrain and it looks fine in the Studio:

изображение

However in QML application there is no 3D terrain, map is still flat and 2D:

изображение

The only thing we can do 3D is 3d-buildings layer, see used code below:

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtLocation 5.15
import QtPositioning 5.15
import "../helper.js" as Helper

//! [top]
Map {
    id: map

    plugin: Plugin {
        name: "mapboxgl"

        PluginParameter {
            name: "mapboxgl.access_token";
            value: "pk.eyJ1IjoidGFudHJpZG8iLCJhIjoiY2tlYnB0YWo0MGFpczJzcnZubHRlNTAwbiJ9.6QG-4BeuCpUjaawDiyyfVg"
        }

        PluginParameter {
            name: "mapboxgl.mapping.additional_style_urls";
            value: "mapbox://styles/tantrido/ckyuch3ub001q16ofjwsxnlz6"
        }
    }

    MapParameter {
        type: "layer"

        property var name: "3d-buildings"
        property var source: "composite"
        property var sourceLayer: "building"
        property var layerType: "fill-extrusion"
        property var minzoom: 15.0
    }

    MapParameter {
        type: "filter"

        property var layer: "3d-buildings"
        property var filter: [ "==", "extrude", "true" ]
    }

    MapParameter {
        type: "paint"

        property var layer: "3d-buildings"
        property var fillExtrusionColor: "#55aaff"
        property var fillExtrusionOpacity: .6
        property var fillExtrusionHeight: { return { type: "identity", property: "height" } }
        property var fillExtrusionBase: { return { type: "identity", property: "min_height" } }
    }
...
}

Is it possible to add some MapParameter(s) or PluginParameter(s) to a Qt 5.15 QML application to enable 3D terrain, or this feature is not supported by Qt Location Mapbox GL Plugin like sky layer? Is some good example exists somewhere?

Aleksey Kontsevich
  • 4,671
  • 4
  • 46
  • 101

1 Answers1

1

The Qt Location MapboxGL plugin is based on the https://github.com/mapbox/mapbox-gl-native project, and supports all the features that are supported by that project, which stopped getting new features in the beginning of 2020. So the answer is no, the plugin does not support 3d terrain.

Pa_
  • 641
  • 1
  • 5
  • 17
  • Yes, seems so. But they are saying about [Maps SDK v10](https://www.mapbox.com/blog/maps-sdk-v10) which has support for [3D terrain and sky](https://github.com/mapbox/mapbox-gl-native/issues/16635#issuecomment-1023088110). However it is not clear where to download it, how to use and whether it has Qt/QML support. – Aleksey Kontsevich Jan 29 '22 at 13:25
  • From https://www.mapbox.com/mobile-maps-sdk It seems that Maps SDK v10 is available only for Mobile. Instructions to download are provided on that link. No support for Qt/QML as it seems. – Pa_ Jan 29 '22 at 17:29