diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-03-10 15:59:52 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-03-13 10:31:23 +0000 |
commit | b0480d83282d76c6740ed71323155adbf97de9fa (patch) | |
tree | 69a4d6e257b0029431e8806d5f41a6c1aca0fa54 /examples/location/mapviewer/mapviewer.qml | |
parent | dca175454aefdd019952d941c6369c314e8c3b11 (diff) |
Polish MapViewer example
This patch does some improvements to the MapViewer example.
Namely:
- sliders, which have been problematic in many ways, are now from
QtQuickControls 2, and this solves a couple of glitches.
- changing map provider now retains tilt, bearing and field of view,
if possible.
- High DPI scaling is enabled by default in main()
- the slider panel is open at start
Change-Id: I1cc380e3d05b89aa547139d912c142e4f0d266c9
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/location/mapviewer/mapviewer.qml')
-rw-r--r-- | examples/location/mapviewer/mapviewer.qml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml index 21348919..debc329f 100644 --- a/examples/location/mapviewer/mapviewer.qml +++ b/examples/location/mapviewer/mapviewer.qml @@ -73,10 +73,18 @@ ApplicationWindow { } var zoomLevel = null + var tilt = null + var bearing = null + var fov = null var center = null + var panelExpanded = null if (map) { zoomLevel = map.zoomLevel + tilt = map.tilt + bearing = map.bearing + fov = map.fieldOfView center = map.center + panelExpanded = map.slidersExpanded map.destroy() } @@ -84,8 +92,12 @@ ApplicationWindow { map.plugin = plugin; if (zoomLevel != null) { + map.tilt = tilt + map.bearing = bearing + map.fieldOfView = fov map.zoomLevel = zoomLevel map.center = center + map.slidersExpanded = panelExpanded } else { // Use an integer ZL to enable nearest interpolation, if possible. map.zoomLevel = Math.floor((map.maximumZoomLevel - map.minimumZoomLevel)/2) |