mapwidget.qml: track the marker selection
Add a MouseArea to the MapItemView delagate and onClick set the "mapHelper.model.selectedUuid" to the uuid of the clicked marker. This updates the "selectedUuid" property inside MapLocationModel. Based on "mapHelper.model.selectedUuid" it is now possible to show two seprate images for selected / deselected markers. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
4b03216fdb
commit
f2608edc56
@ -38,7 +38,17 @@ Item {
|
||||
anchorPoint.x: 0
|
||||
anchorPoint.y: mapItemImage.height
|
||||
coordinate: model.coordinate
|
||||
sourceItem: Image { id: mapItemImage; source: "qrc:///mapwidget-marker-image" }
|
||||
sourceItem: Image {
|
||||
id: mapItemImage;
|
||||
source: "qrc:///mapwidget-marker" + (mapHelper.model.selectedUuid === model.uuid ? "-selected" : "");
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
mapHelper.model.selectedUuid = model.uuid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user