[SOLVED] Does 3D terrain feature work for Qt Location Mapbox GL Plugin?


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?


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.

Answered By – Pa_

Answer Checked By – David Goodson (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *