Solved How do I add markers to a map?
-
Hi!
How do I add markers to a map?
I use a map in QML. -
It is works https://stackoverflow.com/questions/49344638/adding-markers-places-to-qt-qml-maps
But how to change the marker when I click on it? -
It's works:
Component { id: mapcomponent MapQuickItem { id: marker anchorPoint.x: image.width/4 anchorPoint.y: image.height coordinate: position MouseArea{ anchors.fill: parent onClicked: { imageMarker.source = "qrc:/Images/Images/markerGreen.png" console.log("MapQuickItem clicked")} } sourceItem: Image { id: imageMarker source: "qrc:/Images/Images/markerRed.png" } } }