Uploaded image for project: 'Qt 3D Studio'
  1. Qt 3D Studio
  2. QT3DS-4237

attach MouseArea to MapParameter

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt 3D Studio 2.7
    • CustomerSupport
    • None
    • All, Windows

    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"
              }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kileppal Kimmo Leppälä
            souseh samer bakleh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes