mapwidget.qml: implement the MapItemView with delegate

MapItemView is the QML class that handles the "create map markers based
on a model". In this case the model is created as part of the
MapWidgetHelper, so here passing "mapHelper.model" to the "model"
property is enough.

The delegate receives coordinates from the model as "model.latitude",
"model.logitude" and converts them to QGeoCoordinate.

The "sourceItem" image for the delagete is just an image ATM and is
fetched from QRC.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2017-07-17 22:24:30 +03:00 committed by Dirk Hohndel
parent f4e6df475e
commit d783984443

View file

@ -30,6 +30,18 @@ Item {
map.activeMapType = map.supportedMapTypes[esriMapTypeIndexes.SATELLITE];
}
MapItemView {
id: mapItemView
model: mapHelper.model
delegate: MapQuickItem {
anchorPoint.x: 0
anchorPoint.y: mapItemImage.height
coordinate: QtPositioning.coordinate(latitude, longitude)
sourceItem: Image { id: mapItemImage; source: "qrc:///mapwidget-marker-image" }
}
}
ParallelAnimation {
id: mapAnimation