From 05c4125cd65e34d64befeef4c4c2aba1f3b86665 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Mon, 23 Jan 2017 18:31:33 +0100 Subject: Add field of view support to QtLocation mapping This patch introduces a new camera parameter, field of view, used in QGeoCameraCapabilities, QGeoCameraData and QDeclarativeGeoMap. This is necessary as now QtLocation supports map tilting, and different QGeoMap implementations support different ranges for the field of view of the camera. Through this API it becomes possible to query the supported range and current value, and to stack Map elements using different plugins while keeping a consistent camera projection across all of them. Change-Id: Ie061142bea090ec223d842efbe7924f924430496 Reviewed-by: Alex Blasche --- src/location/maps/qgeoprojection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/location/maps/qgeoprojection.cpp') diff --git a/src/location/maps/qgeoprojection.cpp b/src/location/maps/qgeoprojection.cpp index b33f180f..a54eee54 100644 --- a/src/location/maps/qgeoprojection.cpp +++ b/src/location/maps/qgeoprojection.cpp @@ -263,7 +263,7 @@ void QGeoProjectionWebMercator::setupCamera() double altitude = f / (2.0 * z) ; //aperture(90 / 2) = 1 - m_aperture = 0.41421356237309503; // For a field of view of 45 degrees, as 90 is loading too many tiles + m_aperture = tan(QLocationUtils::radians(m_cameraData.fieldOfView()) * 0.5); // calculate eye m_eye = m_center; m_eye.setZ(altitude * defaultTileSize / m_aperture); -- cgit v1.2.1