'How to show 3D real buildings in QML maps
I am using Mapbox to work with maps in *.qml. I wanna know if there is any 3D terrain real option like the one that works in iOS maps. The code part I have is,
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: "#f2bc68"
property var fillExtrusionOpacity: 0.6
property var fillExtrusionHeight: { return { type: "identity", property: "height" } }
property var fillExtrusionBase: { return { type: "identity", property: "min_height" } }
}
anchors.fill: parent
center: QtPositioning.coordinate(homeLat.text, homeLng.text)
tilt: 80
zoomLevel: 18
}
This, however, is only a 3D object on any building, not the real one, and the result is like this,
And the one, I am looking for is like this,
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
