Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
Qt 3D Studio 2.7
-
None
Description
i want to display geojson file on maps and make these shapes clickable to show more details about a building for example.
what i get is just a coordinate ... i need to get geojson object of building clicked
// code placeholder Map { id: map anchors.fill: parent plugin: Plugin { name: "mapboxgl" PluginParameter { name: "mapboxgl.access_token" value:"sk.eyJ1IjoiYWxub29yLXNjaG9vbCIsImEiOiJjbGF1cmd0YTEwOWNoM3ByNjdxaW0yZXZiIn0.-RGpdTPTSBqrUGc65oLPNQ" } MouseArea { acceptedButtons: Qt.LeftButton | Qt.RightButton anchors.fill: parent onClicked: { mouse.accepted=true if (mouse.button == Qt.LeftButton) { var coord = map.toCoordinate(Qt.point(mouse.x,mouse.y)); console.log(coord.latitude, coord.longitude) console.log(JSON.stringify(mouse) ) } } DynamicParameter { type: "source" property var name: "buildingSource" property var sourceType: "geojson" property var data: ":building.json" } DynamicParameter { type: "layer" property var name: "buildingLayer" property var layerType: "fill" property var source: "buildingSource" } DynamicParameter { type: "paint" property var layer: "buildingLayer" property var fillColor: "#bbb" }