From d7839844431a4ffab9050a9194b9f3e9fdd51118 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Mon, 17 Jul 2017 22:24:30 +0300 Subject: 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 --- mobile-widgets/qml/MapWidget.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index 0058cc117..c64fd5f77 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -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 -- cgit v1.2.3-70-g09d2