summaryrefslogtreecommitdiff
path: root/examples/location
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-02-16 11:12:52 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-03-01 13:11:44 +0000
commite463bf8f4ae1eb94b4f91cb6ebca4b198e86bccd (patch)
treeb6a481e79d3512eb381503e5ca0f6c0df740b8ba /examples/location
parent55a414382925fdd8387b3b767447d79c8dd31c66 (diff)
downloadqtlocation-e463bf8f4ae1eb94b4f91cb6ebca4b198e86bccd.tar.gz
Default to 45degrees FoV if possible
The new MapSliders.qml component introduced a different way of binding the sliders properties. This makes the slider change the value in the map when these bindings kick in. This change explicitly sets a sensible default at map initialization time. Change-Id: I90d977003a571c2226c2dd6d5b66bc67a246e754 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/location')
-rw-r--r--examples/location/mapviewer/mapviewer.qml5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml
index 08ef2663..21348919 100644
--- a/examples/location/mapviewer/mapviewer.qml
+++ b/examples/location/mapviewer/mapviewer.qml
@@ -87,7 +87,10 @@ ApplicationWindow {
map.zoomLevel = zoomLevel
map.center = center
} else {
- map.zoomLevel = (map.maximumZoomLevel - map.minimumZoomLevel)/2
+ // Use an integer ZL to enable nearest interpolation, if possible.
+ map.zoomLevel = Math.floor((map.maximumZoomLevel - map.minimumZoomLevel)/2)
+ // defaulting to 45 degrees, if possible.
+ map.fieldOfView = Math.min(Math.max(45.0, map.minimumFieldOfView), map.maximumFieldOfView)
}
map.forceActiveFocus()