Qt Location - Map interaction

262 Views Asked by At

My goal is to write a simple desktop route planner in Qt. The user needs to be able to plot a route on the map and edit it. I've got a map up and running using the QML Map/Openstreetmap plugin and have been looking at the MapPolyLine type.

But I cannot see anyway of getting map events, specifically when a user clicks on a map location or a map object such as a MapPolyLine.

Is there a way I can extend the Map type to add some new slots to deal with this?

1

There are 1 best solutions below

0
On BEST ANSWER

Ok it's easy using a MouseArea

MouseArea {
       anchors.fill: parent
       onClicked: console.log('HERE '+mouseX + ':'+ mouseY)
   }