diff options
Diffstat (limited to 'mobile-widgets/qml/MapWidget.qml')
-rw-r--r-- | mobile-widgets/qml/MapWidget.qml | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index e581ade38..28754e0de 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -5,8 +5,7 @@ import QtPositioning 5.3 import org.subsurfacedivelog.mobile 1.0 Item { - - readonly property var esriMapTypeIndexes: { "STREET": 0, "SATELLITE": 1 }; + readonly property var esriMapTypeIndexes: { "STREET": 0, "SATELLITE": 1 } Plugin { id: mapPlugin @@ -24,18 +23,17 @@ Item { plugin: mapPlugin zoomLevel: 1 - readonly property var defaultCenter: QtPositioning.coordinate(0, 0); - readonly property var defaultZoomIn: 17.0; - property var newCenter: defaultCenter; - property var newZoom: 1.0; + readonly property var defaultCenter: QtPositioning.coordinate(0, 0) + readonly property var defaultZoomIn: 17.0 + property var newCenter: defaultCenter + property var newZoom: 1.0 Component.onCompleted: { - map.activeMapType = map.supportedMapTypes[esriMapTypeIndexes.SATELLITE]; + map.activeMapType = map.supportedMapTypes[esriMapTypeIndexes.SATELLITE] } MapItemView { id: mapItemView - model: mapHelper.model delegate: MapQuickItem { anchorPoint.x: 0 @@ -43,11 +41,11 @@ Item { coordinate: model.coordinate z: mapHelper.model.selectedUuid === model.uuid ? mapHelper.model.count - 1 : 0 sourceItem: Image { - id: mapItemImage; - source: "qrc:///mapwidget-marker" + (mapHelper.model.selectedUuid === model.uuid ? "-selected" : ""); + id: mapItemImage + source: "qrc:///mapwidget-marker" + (mapHelper.model.selectedUuid === model.uuid ? "-selected" : "") SequentialAnimation { - id: mapItemImageAnimation; + id: mapItemImageAnimation PropertyAnimation { target: mapItemImage; property: "scale"; from: 1.0; to: 0.7; duration: 120; } @@ -58,7 +56,7 @@ Item { onSourceChanged: { if (mapHelper.model.selectedUuid === model.uuid) - mapItemImageAnimation.restart(); + mapItemImageAnimation.restart() } } @@ -73,7 +71,6 @@ Item { ParallelAnimation { id: mapAnimation - CoordinateAnimation { target: map property: "center" @@ -90,10 +87,10 @@ Item { } function centerOnMapLocation(mapLocation) { - map.newCenter = mapLocation.coordinate; - map.zoomLevel = 2; - mapAnimation.restart(); - mapHelper.model.selectedUuid = mapLocation.uuid; + map.newCenter = mapLocation.coordinate + map.zoomLevel = 2 + mapAnimation.restart() + mapHelper.model.selectedUuid = mapLocation.uuid } } } |