summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-17 22:24:30 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commitd7839844431a4ffab9050a9194b9f3e9fdd51118 (patch)
tree7b468331e7b39b9dcd2a95d5267d844cfffa9dcb
parentf4e6df475e1cfd93dc0d73287ec6a5113b5eb176 (diff)
downloadsubsurface-d7839844431a4ffab9050a9194b9f3e9fdd51118.tar.gz
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>
-rw-r--r--mobile-widgets/qml/MapWidget.qml12
1 files changed, 12 insertions, 0 deletions
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