summaryrefslogtreecommitdiff
path: root/src/positioning/qlocationutils_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix visible region computation in QGeoProjectionWebMercatorPaolo Angelelli2017-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Currently the visible region is calculated as the intersection between the viewing frustum and the map plane clipped against the map extended rectangle in mercator space (from -1 to 2 in x coords, 0 to 1 in y coords). The result is correct in the extended mercator space. However, this may lead to overlapping coordinates when converted back to latitude and longitude. For this reason, this patch changes the clipping geometry to be the map un-extended rectangle centered around the current map center. The result is a geometry that never wraps around or overlaps, thus removing the need for handling separately the case when the map is fully visible when returning the visible region. Task-number: QTBUG-57690 Change-Id: I8396c40a123ce94bff4388dfefbd8a694657b8bd Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Use qRadiansToDegrees() and qDegreesToRadians() more widelyEdward Welbourne2017-02-271-9/+5
| | | | | | | | | | | | | | They document intent more clearly (and replace *two* local hand-rolled versions of each). Also kill an extraneous #include of <math.h>; and switch to qmath.h as source for M_PI, replacing the M_PID value (and friends) previously provided by (thankfully private) qlocationutils_p.h (at more precision than even long double would retain - qmath.h's M_PI is entirely sufficient even for long double, as is the Linux <math.h> one). Task-number: QTBUG-58083 Change-Id: I6fa4abd3c8ed9c826998f2cdc2aefc51681c19c1 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Adapt QQuickGeoMapGestureArea to work with tilted and rotated mapsPaolo Angelelli2017-01-261-5/+5
| | | | | | | | This patch fixes the handling of pan/flick/pinch in presence of tilt or bearing. Change-Id: Iad04fd92e1c8e318e3b1b0d344852c81e554ebb7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add clipping for rotated/tilted Map ItemsPaolo Angelelli2017-01-261-10/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds proper rotation/tilting support to Map Items. To do so, clipping is now performed in wrapped mercator space instead of screen space. This prevents projection of geo coordinates that ended behind the camera, and that would be projected incorrectly by the projection transformation. This patch therefore does not use the screen clipping code any longer (clipPathToRect), since the geometry has already been clipped. The downside is that updateSourcePoints is now necessary for any viewport change. This would be necessary anyway in presence of tilt or rotation. NB: Handling of MapQuickItems with zoomLevel set is still TODO. Future work: 1) Optimize updateSourcePoints by pre-computing the mercator projection of the geometry, and let updateSourcePoints do only the wrapping/clipping/projection-to-screen operations. 2) Remove updateScreenPoints altogether Change-Id: Ie0d3dbef68d48ac97a596d40240d0ac126c0efaf Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add rotation and tilt controls to QDeclarativeGeoMapPaolo Angelelli2017-01-251-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDeclarativeGeoMap currently does not provide any mean to set bearing and tilt into qgeocameradata. It has been not a problem since QGeoTiledMap and sons did not support it. External renderers however support it, so this patch adds QML api calls to control these parameters, and adapt the existing logic to take them into consideration in camera-related calls, as well as in the afterViewportChange handlers of the Map Items. This patch also sligthly modifies the QML api to make the handling of all the bounded camera property more homogeneous. Minimum and maximum zoom levels prior plugin initialization aren't -1 anymore, but are some valid lower and upper bounds for this property, that is 0 and 30. in this way all the 2 bounded properties (zoomLevel and tilt) behave the same, in that they can be freely set before plugin initialization, within reasonable predefined bounds, and, after that, they may be clamped depending on the actual plugin capabilities. Autotests for the QML part of the API included. Change-Id: I9d09e32698a7330388e465e8ea7523ee39577d34 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename QGeoProjection to QWebMercatorPaolo Angelelli2017-01-161-0/+4
| | | | | | | | | | QGeoProjection is currently a class containing only static methods for WebMercator conversion/interpolation. This patch renames it to QWebMercator, effectively freeing the QGeoProjection name for a real projection class Change-Id: I15b71d04f7d1d21a1d26f46687ed33aa277f6deb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add support for boundingGeoRectangle to QGeoShapePaolo Angelelli2016-11-301-0/+49
| | | | | | | | | | | | this patch introduces QGeoShape::boundingGeoRectangle, which returns a QGeoRectangle containing the latitudinal/longitudinal bounds of a geoshape. The bounding geo rectangle is projection independent, as it returns a georectangle containing the min/max latitudes/longitudes of the shape. Change-Id: Ie3a83ec41f87ea3753899d2278e664fe2469f778 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'gerrit/5.6' into 5.7Alex Blasche2016-11-021-0/+93
|\ | | | | | | | | | | | | | | Conflicts: src/imports/location/qdeclarativegeomap.cpp src/location/maps/maps.pri Change-Id: I346d7351e98f4a1aa67c9c0401d41b6da9099f48
| * Add OSRMv5 support in osm pluginPaolo Angelelli2016-10-061-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the OSRMv5 protocol (the only one currently available on the OSRM demo server router.project.osrm.org). Support for the old v4 protocol is retained, in case of users who supply their own osm.routing.host parameter pointing at a self hosted OSRMv4 server. The support for OSRMv4 and v5 has been moved away from the osm plugin and into the location module because this should be used in the mapbox plugin in a subsequent patch (the routing support in the mapbox plugin currently uses the text direction coming from the server, which does not support i18n) Task-number: QTBUG-56119 Change-Id: Id30fd536c7fd434011795f643221f55becfc9e18 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | Updated license headersAntti Kokko2016-01-201-14/+20
|/ | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Iaee1a5fd53291752a1891710ee375ca32778b142 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update contact URL in all license headers to qt.ioAlex Blasche2015-02-181-1/+1
| | | | | Change-Id: Ia1e333be7fec8898de609d9b9303b1ad7687632e Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* Update BSD and LGPLv2.1 licensesAlex Blasche2015-02-181-3/+3
| | | | | | | | - Removes subsidiary extension from Qt Company - Replaces remaining occurrences of Digia in BSD and LGPLv2.1 Change-Id: I7467a6744af7d1c3aef3c29118f219399162a18c Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* Update all LGPLv2.1 license headers in source to latest versionAlex Blasche2015-02-151-4/+4
| | | | | | | | | | | This affects all QtPositioning related code and the test code in the entire repository. The Qt Company is set as new copyright owner and the copyright year is bumped to 2015. Change-Id: Iee0e990680683c20f5920e49cc1063ea9349e2cd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new license filesAntti Kokko2014-08-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: Iedee2507ab1bd46788409a98505d7be510253110 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Support position accuracy in QNmeaPositionInfoSource.Aaron McCarthy2013-12-111-1/+3
| | | | | | | | | | | | Extract the HDOP and VDOP from the NMEA stream and calculate the twice the distance root mean square (2DRMS) error based on the user provided User equivalent range error value. [ChangeLog][QtPositioning][QNmeaPositionInfoSource] Added support for reporting position accuracy. Change-Id: I59e5f8c32070fa96ae4d0bd02a18f38663920e05 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Split QtLocation into QtPositioning and QtLocationAlex Blasche2013-09-021-0/+118
QtPositioning is not dependent on any gui component and mostly covers everything around the retrieval of position information. QtLocation covers place, map and navigation APIs. Several documentation issues were fixed during the process. Change-Id: I98e2a53065549a2fc43f93a75b4f65b5bc884c92 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>