summaryrefslogtreecommitdiff
path: root/src/location/labs
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash with empty maps on constructionPaolo Angelelli2020-02-131-0/+2
| | | | | Change-Id: I8716c94b2c3f1fb995e933fe5be736e94ff161ce Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add geometry simplification to MapPolyline/MapPolylineObjectQSGPaolo Angelelli2020-02-123-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a metric-based implementation of the Ramer-Douglas-Peucker line simplification algorithm to generate a LOD pyramid for the polyline geometries. This comes with a related property (in MapItemBase), lodThreshold, that can be used to change the threshold after which no simplification will be used. By default the value of this property is 0, meaning that the behavior will be unchanged and no LOD will be used. This change also introduces LOD on map polyine objects QSG, for which no property is introduced, and there's a default threshold set to zoom level 12 (which appear to produce acceptable results). Finally, this patch makes use of a threadpool with 1 thread to enqueue geometry simplification tasks, which would otherwise freeze the UI when computing for the first time. Support for geometry simplification is currently added only to polylines. It might be of interest extending it to polygons as well, once a proper strategy for handling the simplification of inner holes has been identified. Finally, extending it to circles could be of interest, while potentially bringing only minor benefits, as circle geometries are currently fixed to 128 vertices. Also adds a MapObject-based delegate to the geojson viewer example. Task-number: QTBUG-46652 Task-number: QTBUG-38459 Task-number: QTBUG-49303 Change-Id: I64b5db4577962db17e5388812909285c9356ef0d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port Map*ObjectPrivateQSG to the shader-based projection geometriesv5.15.0-alpha1Paolo Angelelli2020-02-1110-195/+420
| | | | | | | | | | | | | | | | | | | | | | | This patch changes the implementation of the scenegraph-based mapobjects (those created by QGeoTiledMap) to be the recently introduced one sporting shader-based map projection. This is much faster than the previous, but may introduce small glitches at this time (mostly on minified polylines). Adding polyline LOD simplification will solve this problem. Compared to equivalent Map Items (that is, Map Items backed by the same underlying implementation), map objects now are approximately 1.5x faster. This measure has been gathered using medium-size polygons (contained in the file 10_countries.json from the geojson_viewer example). The difference is caused by the additional QtQuick geometry related operations (essentially projecting the bounding box for each item) present in MapItems. Smaller polygons may therefore yield larger improvements, larger polygons the opposite. Change-Id: I3fc92b02b74a3a4d001e69755949a98f80d8a3d3 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix Map*ObjectsQSG implementation triggering QSGBatchRenderer crashesPaolo Angelelli2020-02-116-24/+35
| | | | | | | | The new approach introduces a root node for all objects, that is repopulated at every repaint. Change-Id: I4562e1aaa18999a03e8c38fe3bf59fe41f14dd70 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Enable mercator-to-screen projection in GLSLPaolo Angelelli2020-02-114-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, all the geo-to-screen conversion, and the triangulation operations for geo polylines and geo polygon are performed either at set time or in the shader. A separate bounding box geometry is processed in the old way to provide a correct QtQuick Item geometry, that can be used for nesting mouse areas, performing translations, input event delivery, etc. With this approach, performance are improved by more than one order of magnitude in average, but complex geometries will of course benefit more. It also adds correct rendering support for polygons with holes, previously only rendered correctly by the MapboxGL plugin. The polyline shader has basic miter joins. The miter is skipped if the angle is too sharp to avoid complicating the implementation. This shader introduces some glitches when the polyline is minified, for which the real fix is to have LOD for the geometry, and render simplified geometries at low zoom levels (added in a subsequent patch). Note: this approach, at least in its current implementation, does not support enabling layers on individual items, only on the Map element. Task-number: QTBUG-49303 Task-number: QTBUG-38459 Change-Id: I0c2dc0bf364d32f74ca7c4014f6d66e6219c8ae4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix MapObjectView not setting propertiesPaolo Angelelli2020-01-181-3/+11
| | | | | | | | | | | | Set parent for incubated objects in MapObjectView to the view. Also properly set component completed when removing the view from a map and then readding it. Finally silence the useless warning about MapObjectView being unsupported, as the default MOV is basically what's wanted. Change-Id: Iecbc345ced99754d0d09112b4b30eaca2bb078e5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix MapObjects ::border property not properly initializedPaolo Angelelli2020-01-145-5/+5
| | | | | | | This patch also parents it with the object also fixing memory leaks. Change-Id: I74a21176b1d2450b10a21f92321520ca2c6e88e0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Fix documentation warningsTopi Reinio2019-11-142-14/+9
| | | | | | | | | | | | | Fix missing/incorrect parameter documentation, linking warnings, and \instantiates references to undocumented/internal classes. Remove mention of Navigator::currentRoute, as such a property no longer exists. Fixes: QTBUG-79811 Change-Id: I048a13109aa19f3db75e76611473d60a2396f028 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix more 5.14 QML API inconsistenciesPaolo Angelelli2019-10-311-0/+3
| | | | | | Change-Id: Ia2dac783ce05bd87888b73b4225d133ada04af79 Fixes: QTBUG-78690 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix 5.14 QML API inconsistenciesv5.14.0-beta2Paolo Angelelli2019-10-041-0/+27
| | | | | | Change-Id: I54bf3791d3d5e40fb9405c2f1527758fcfba8120 Fixes: QTBUG-78690 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Expose alternativeRoutes in QDeclarativeNavigationBasicDirectionsPaolo Angelelli2019-07-092-1/+69
| | | | | | | | So that they can be also visualized in list views or details can be presented. Change-Id: Ib8bb48e73624d8bb50073312e7834c3c609c561b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Expose recalculateRoutes invokable method in NavigatorPaolo Angelelli2019-07-092-0/+8
| | | | | | | | This to let the user choose when to do it, if automaticRerouting is disabled. Change-Id: I53251dc42fc831da623f135ff3f1c372ee3dac66 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Expose automaticReroutingEnabled and isOnRoute properties in NavigatorPaolo Angelelli2019-07-033-0/+44
| | | | | | | | | | This patch adds these two properties to the Navigator API to let the user know when the engine detects that the position source gets off the route and to choose whether or not let the engine automatically recalculate routes in that case. Change-Id: I1f3afc8820dee1dd2042aa05fb0b3284108cb581 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-031-39/+71
|\ | | | | | | Change-Id: I46ebc392ac3f5da89bc9957113247dd18d682fc1
| * Doc: Fix documentation issuesTopi Reinio2019-05-161-39/+71
| | | | | | | | | | | | | | | | | | | | | | Fix various documentation-related issues, including missing parameter documentation, broken links, and typos. Do some minor language editing. Change-Id: I0a8f8457e0d1ab56b4fc4670376509adf1fd26a3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Fix changed import for delegate modelPaolo Angelelli2019-05-061-1/+1
|/ | | | | | | | | | | This is needed after 2b91e2bca3 in qtdeclarative. Need to be adjusted to QtQmlModels/private/qqmldelegatemodel_p.h later. Task-number: QTBUG-75607 Change-Id: Ic6db50798edc47f6bca307be3acd1611282d2e83 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Introduce Qt.labs.location QtLocationLabs singleton typePaolo Angelelli2019-03-115-1/+49
| | | | | | | | | | | This singleton is meant to offer tech-preview map-related API. It starts with a mapObjectsAt invokable, that can be used to probe MapObjects at a specific coordinate of a map. Reference implementation for Q*ObjectQSG, based on QGeoShape::contains, included. Change-Id: Ief692eb5a43115ca02d4642c82023d1b2e217400 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix broken MapPolylineObjectQSGPaolo Angelelli2019-02-041-1/+3
| | | | | | | | | Fixes missing data sync between MapPolylineObjectPrivateDefault m_path and MapPolylineObjectPrivateQSG m_geoPath. Change-Id: Ie9eaee0bd23795b3afa51ca2facbd11ce32c8a26 Fixes: QTBUG-73408 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-021-0/+18
|\ | | | | | | Change-Id: Ia0a66c229f249532e70b1548f5e618e4db4bc5ad
| * Document Qt.labs.location qml modulePaolo Angelelli2019-01-301-0/+18
| | | | | | | | | | | | Change-Id: I823bd3ebbd74096fc7319147dc7d4ca6ef10e414 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Expose QAbstractNavigatorPaolo Angelelli2019-02-012-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | This change exposes the QAbstractNavigator instantiated by QDeclarativeNavigator. By doing so, it is possible to expose to the user engine-specific features and data via properties, signals and methods added to the QAbstractNavigator subclass. However, while this approach greatly simplifies the exposure of such features, it also leads to writing non-cross-plugin code. Change-Id: I03be9b6d0868d940dc0ac80520f3b507bec2953a Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | Introduce QGeoMapObject::geoShape propertyPaolo Angelelli2019-02-0118-92/+225
| | | | | | | | | | | | | | | | | | | | In this way MapObjects become a little closer to MapItems, and this property can be used to, for example, center the map on one specific object or object group. Fixes: QTBUG-69640 Change-Id: I4dbead9e670bf5d1eeaccb2bd09d956b8de7da87 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Provide additional navigation information via NavigatorPaolo Angelelli2019-02-013-135/+242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch, Navigator becomes able to expose additional running navigation information such as distance to next maneuver, traveled distance, and so on. This information must be made available by the engines by emitting the related signals and implement the related methods, in QAbstractNavigator subclasses. This patch also groups all navigation read-only progress information into a property group inside Navigator, called directions. Change-Id: I00baf64bafe88cd21d4fef06dae0e7331a40ff70 Fixes: QTBUG-70238 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | Unify semicolon usage in Q_UNUSEDJesus Fernandez2019-01-235-5/+5
| | | | | | | | | | Change-Id: I36dd6881b6f6f028869d63b6311cba7f52a99cc4 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-222-10/+21
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I8d0881209c8b0a0dce4ed949ef89ee2679448420
| * Fix MapObjectView removing wrong indices on model changesPaolo Angelelli2019-01-142-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | No incubation cancellation required when an object is removed: the DM takes care of that. Handle also the case of itemCreated called during synchronous object creation, that fires the callback in the middle of the ->object call. Task-number: QTBUG-71264 Change-Id: I058a101c754f22f4b6fbcbd7f6f7ded36f3c129b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add QGeoJson: a GeoJSON parserJulian Sherollari2019-01-182-0/+1323
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a Class to convert a GeoJSON document to a QVariantList ready to be used as Model in a MapItemView. It comes with autotests, example and detailed documentation. [ChangeLog][QtLocation] Added a GeoJSON parser which can be used to annotate maps with tracks, polygonal boundaries, etc. Fixes: QTBUG-64111 Change-Id: Ib06d3902a052f69f75ae40be5c9ab56023cad916 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | Rename MapIconObject.size to MapIconObject.iconSizePaolo Angelelli2019-01-145-25/+25
| | | | | | | | | | | | | | Associated signals and methods are also renamed Change-Id: I6a6baa77f8324d3b345118072be75491ca251be2 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | Expose manager-specific errors from QGeoServiceProviderPaolo Angelelli2019-01-143-22/+111
| | | | | | | | | | | | | | | | | | So that there's no risk to mix failures when creating multiple managers. Task-number: QTBUG-72180 Change-Id: I5c3b18ba17094e1480b2376e37b58d47029ca8f4 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Fix MapObjectView clone and equalsPaolo Angelelli2018-12-113-13/+61
| | | | | | | | | | | | | | | | | | This also allow to properly subclass MapObjectViewPrivate, as the model would be passed to the private implementation (and the delegate too). Change-Id: I0513a81120e8e8404fb35eb58fb2532487663ed9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Remove QDeclarativeNavigatorPrivate::updateReadyStatePaolo Angelelli2018-12-112-12/+4
| | | | | | | | | | | | | | | | | | This method was initially introduced to be used in the engines, when QDeclarativeNavigatorPrivate was passed in place of QDeclarativeNavigatorData. Right now there is no use for it. Change-Id: Ic623d8c56c5685831629a906837b748e1f4017b6 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Reset transient Navigator data when stopping navigationPaolo Angelelli2018-12-112-0/+30
| | | | | | | | | | Change-Id: I43607931ec071fc25af02ebe4762e456c72c7d01 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add QDeclarativeNavigator currentRouteLeg propertyPaolo Angelelli2018-12-052-0/+10
| | | | | | | | | | | | | | | | | | Somehow missing in the previous patch. Fixes: QTBUG-72281 Change-Id: Ic1bc24f0b241013048f5e02ede8332561212ffd0 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-272-4/+5
|\ \ | |/ | | | | Change-Id: I79898ba40dcce8054a105867ab2a88f1fba72c1f
| * Add QAbstractNavigator::setTrackPositionPaolo Angelelli2018-11-262-4/+5
| | | | | | | | | | | | | | | | | | Or else there's no reactive way to tell navigator objects when the user changes this property. Change-Id: Ief78facf537a50c15611127c5282c2bcfd59f8fd Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | Add Navigator.currentRouteLegPaolo Angelelli2018-11-013-1/+27
|/ | | | | Change-Id: I9027afac6143784b14879889ffd4180ad8269cc4 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Safer and easier navigation APIs for pluginsBogDan Vatra2018-08-303-48/+53
| | | | | | | | | | Each QDeclarativeNavigator will create and manage its own QAbstractNavigator using the QNavigationManagerEngine, this way the QNavigationManagerEngine doesn't have to manage the sessions itself based on a const reference. Change-Id: Ibe006524969b4f8100e71ea188d951072b846c6c Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* QGeoMapObject: Fix MSVC warnings about '*/' found outside of commentFriedemann Kleint2018-07-103-3/+3
| | | | | | | | | labs\qsg\qmappolylineobjectqsg.cpp(103): warning C4138: '*/' found outside of comment labs\qsg\qmappolygonobjectqsg.cpp(81): warning C4138: '*/' found outside of comment labs\qsg\qqsgmapobject.cpp(53): warning C4138: '*/' found outside of comment Change-Id: I5c000dbd40e59af6504b52303bd4ae4a1b782dc9 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Add Qt.labs.location::Navigator::trackPositionSource propertyBruno de Oliveira Abinader2018-06-263-0/+34
| | | | | | | | | | | | This property tells whether the Navigator should control the Map camera to keep track of position source updates. This property is enabled by default, and setting it to false is useful in cases where e.g. the user starts gesturing over the map area. Task-number: QTBUG-69031 Change-Id: I86157f69890f8cf0eb60d457d0f9c4134e2befb0 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Use QPointer to avoid dangling QDeclarativeGeoRoute in NavigatorPrivatePaolo Angelelli2018-06-084-8/+45
| | | | | | | | | | | | | | | QDeclarativeNavigator::setRoute takes a QDeclarativeGeoRoute. This type is not COW, and could be destroyed by the user or the route model. This patch stores it inside a QPointer. It also stores the contained QGeoRoute, that is what the navigation engines are supposed to use to perform navigation, and is COW. Task-number: QTBUG-68536 Change-Id: I73fb79faeb3ac9efefcbd778ee106d29fbf26658 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix MapObjectView object removalPaolo Angelelli2018-05-221-1/+3
| | | | | | | Call delegateModel.cancel if the object is still incubating Change-Id: Iee4af5530b6a00981280b9531cc3c1643db71d03 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Fix crash in Map{Polyline,Polygon,Route}ObjectQsgPaolo Angelelli2018-05-092-0/+4
| | | | | | | | | | | | | | | | When these objects get added to a map but aren't immediately visible (meaning are outside the visible region entirely), their respective QSGNodes will be marked as blocked. However, this isn't handled gracefully in qsgbatchrenderer. Renderer::nodeWasAdded discards nodes that are blocked. Meaning that when they will become unblocked, the node will result in being unallocated. This patch makes sure that a node is not instantiated at all if it would result in a blocked node. Change-Id: I8e174ba1d317e1d0c4006d993ec558bdad8a5b39 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QtLocation: Fix build warningsFriedemann Kleint2018-05-041-0/+11
| | | | | | | | | | QtLocation: WARNING: qtlocation/src/location/qlocationglobal.h includes qlocation.h when it should include QtLocation/qlocation.h QtLocation: WARNING: qtlocation/src/location/labs/qsg/qqsgmapobject_p.h does not have the "We mean it." warning Amends 2782765e20ba3bc6af92375574456fd54d4243f7. Change-Id: I6c225c8af70ebc5753b3b20aec1900efd1bc2c5c Reviewed-by: Martin Smith <martin.smith@qt.io>
* Let QDeclarativeNavigator::{start,stop} update m_activeBruno de Oliveira Abinader2018-05-031-8/+4
| | | | | | | | | | | QDeclarativeNavigator should call QNavigatorManager::start() inside QDeclarativeNavigator::start(), however because we were already updating m_active in QDeclarativeNavigator::setActive(), the call for QNavigationManager::start() never happens. Task-number: QTBUG-68066 Change-Id: I486381fdec7fc77ac977ee46683fabd2465cf799 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Fix QGeoMapObject handling in reference implementationPaolo Angelelli2018-04-2222-205/+444
| | | | | | | | | | | | | | | | | setVisible was neither changing the visibility nor triggering repaint. Pimpls weren't removing themselves in their destructors when dynamically added/removed via QGeoMapObjectView add/removeMapObject. This patch also factors out the duplicated QGeoMapObject support from QGeoTiledMapLabs and QGeoMapObjectsOverlay and moves it into an own class, QGeoMapObjectQSGSupport. To properly flush the scene graph nodes upon object removal, a pointer to the QSGNode is added to the MapObject struct, now moved inside QGeoMapObjectQSGSupport. Change-Id: Ie8c6d54f8f340ba3867717d9620791d3fe8021cc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix MapPolyline being drawn misplaced and moving when clippedPaolo Angelelli2018-04-193-3/+3
| | | | | | | Regression introduced in f0bc0db15ed262a8f31bb07b3b46a5cdf9277e79 Change-Id: I4c4a3cb2302daeb825be21f9e2f6c235d2cb7c93 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add q pointer to QDeclarativeNavigatorPrivatewip/navigationPaolo Angelelli2018-04-172-1/+10
| | | | | | | | | Since QDeclarativeNavigatorPrivate is what gets passed to the engine, a QParameterizableObject *q becomes necessary in order to extract and connect the QGeoMapParameters in the engines. Change-Id: Id4a8a99f2287faab9c7e67e5355e9c90c33eaa8f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Introduce map objects reference implementationPaolo Angelelli2018-04-1715-2/+1902
| | | | | | | | | | | | | | | | This patch introduces a reference implementation for the QGeoMapObject subclasses in the locationlabs module. If this module is built, all current plugins, with the exception of mapboxgl, will also be able to render map objects. The current reference implementation of map objects is not optimized, but it can be useful for both testing and feature parity (so that switching between plugins will give the same result). Change-Id: I830ebb3813f219e42c085f450952a2b4327361cd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add documentation for QDeclarativeNavigatorPaolo Angelelli2018-04-171-6/+110
| | | | | Change-Id: I8dd9a35b05b7015c8f4fc6badfa0b0909c669e62 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Introduce Navigator QML typePaolo Angelelli2018-04-173-0/+514
| | | | | | | | | A new QML type, Navigator, is introduced in Qt.labs.location Its intended purpose is to be a front-end for the functionalities offered by NavigationManagerEngines. Change-Id: Ic93bed0bfaaf32453e759b12a348fa6ef1ae2c93 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>