summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativegeomap.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-261-113/+94
|\ | | | | | | | | | | | | | | Conflicts: tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp tests/plugins/declarativetestplugin/testhelper.h Change-Id: Ie218ab1dc68642a6922e05e5688c20b90440b72e
| * Fix copyright notice performance when adding/removing itemsPaolo Angelelli2018-01-161-67/+23
| | | | | | | | | | | | | | | | | | | | This change avoids rescanning the list of map items every time an item is added or removed, to recompute the Z value at which the copyright notice should go. Task-number: QTBUG-64880 Change-Id: Ieea77669f0140e43085a76dfd9dfdee40a335f5a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Fix performance issue with copyright noticePaolo Angelelli2018-01-151-20/+37
| | | | | | | | | | | | | | | | | | | | | | | | Skip evaluating copyrights when the notice is not visible. The implication of this patch is that copyright information won't be up to date or even available unless there is an "attached" copyright notice that has the visible property set to true. Task-number: QTBUG-64880 Change-Id: I3750b61913becb0cbf31273ad9a76ae1a2b6a393 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Fix fitViewportToMapItems in presence of MapQuickItems with zoomLevelPaolo Angelelli2018-01-111-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Map.fitViewportToMapItems currently uses the screen geometries of the items to calculate the new values for zoom level and center. When the zoomLevel property is set on MapQuickItems, their on-screen geometry is affected by a hidden transformation within the item. This patch considers that transformation in the calculations. Task-number: QTBUG-63093 Change-Id: I328028f1901b31225866aa3d749849815d59a2a1 Reviewed-by: Vlad Seryakov <vseryakov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Fix documented property types for Map propertiesPaolo Angelelli2018-01-101-5/+5
| | | | | | | | | | | | Task-number: QTBUG-65564 Change-Id: I9c52d0bdbbdd2eb0e41ff21741423aa7e22f3e28 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | remove use of deprecated QQuickEventPoint::grabber()Shawn Rutledge2017-11-081-1/+1
| | | | | | | | | | | | | | It will soon be removed. Change-Id: Id3e348a6e2ef200b1dde7bd87f64b7ca2cffc5cc Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | DocFix: mark the new QDeclarativeGeoMap API in 5.10 as tech previewv5.10.0-beta2Paolo Angelelli2017-10-071-0/+4
| | | | | | | | | | Change-Id: Iec1cf03fe5cb480cb6dcd24b43046d7009a37f23 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Use QGeoPolygon for returning the visible regionv5.10.0-alpha1Paolo Angelelli2017-09-091-5/+6
| | | | | | | | | | Change-Id: I5be81916c5c7b4802bdde00c60c370b9a12c07e9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devPaolo Angelelli2017-08-271-8/+8
|\ \ | |/ | | | | | | | | | | Conflicts: tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h Change-Id: I4940db79ebe500ff7e37ded42c7d29d7ccfb6253
| * Fix QDeclarativeGeoMap::populateMap duplicating itemsPaolo Angelelli2017-08-231-8/+8
| | | | | | | | | | | | | | | | | | | | | | Since apparently children() and childItems() do not necessarily return disjoint sets, concatenating the two lists did, in some cases, cause duplicated items in the map. This patch resorts to uniting sets to remove the duplicates. Change-Id: I07ef19a2fdff65429eb65d92be278d7c02ac1999 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | Merge remote-tracking branch 'origin/5.9' into devPaolo Angelelli2017-08-101-30/+33
|\ \ | |/ | | | | | | | | | | Conflicts: tests/auto/declarative_ui/tst_map.qml Change-Id: If408b8242b39f78926b5373393f3b1f65b262499
| * Fix visible region computation in QGeoProjectionWebMercatorPaolo Angelelli2017-08-091-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Restore usage of setProperty on Map.fitViewportToGeoShapePaolo Angelelli2017-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | setProperty was initially introduced with 2867f1efc989478667ea7ae56ff91cd991d74121 to animate center and zoom level, if an animation was present, but then removed. This change restores it. Change-Id: Id1f6da820b6cccb62b18eeb78d7dba21ebc073bc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * Fix memleak: delete QGeoMap when QDeclarativeGeoMap gets deletedBogDan Vatra2017-07-281-17/+19
| | | | | | | | | | | | Task-number: QTBUG-62122 Change-Id: I538e1eeb6bce3f5de424003b0b31fa59599dc2d5 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | Add invokables to add/remove mapItemViewsPaolo Angelelli2017-08-071-2/+53
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds two new methods to QDeclarativeGeoMap, to allow users to add or remove MapItemViews at runtime. [ChangeLog][QtLocation][Map] Added methods to add or remove MapItemViews at runtime. Task-number: QTBUG-55782 Change-Id: I4e612a9476a864331f61d49dac811a8069ae010f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add alignCoordinateToPoint methodPaolo Angelelli2017-08-031-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This method effectively extends the functionalities offered by the center qml property, allowing to set a coordinate to an item position other than the center of the item. This is useful in those applications where the center of the scene (e.g., a cursor) is not to be place exactly in the center of the map. [ChangeLog][QtLocation][QDeclarativeGeoMap] Added alignCoordinateToPoint method to QDeclarativeGeoMap. Change-Id: I68a3d12e8376b83c4c1775a3af5e2125d3e71d63 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add setBearing overload to rotate around a coordinatePaolo Angelelli2017-08-031-0/+27
| | | | | | | | | | | | | | | | | | | | | | This patch adds an overload for setBearing in QDeclarativeGeoMap to rotate the map around a specific QGeoCoordinate. [ChangeLog][QtLocation][QDeclarativeGeoMap] Added setBearing overload to rotate the map around a given QGeoCoordinate. Change-Id: I5d2428d852b0c3537f4a1cdb1925c059788c45c5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add camera capabilities + metadata to QGeoMapType/QDeclarativeGeoMapTypePaolo Angelelli2017-07-311-2/+11
|/ | | | | | | | | | | | | | This patch enriches QGeoMapType/QDeclarativeGeoMapType embedding into this object the camera capabilities for this type, that are then exposed via a new QML Type, CameraCapabilities, and custom metadata in form of a QVariantMap, that can be accessed via the new metadata property. [ChangeLog][QtLocation][QDeclarativeGeoMapType] Added CameraCapabilities and metadata properties to QDeclarativeGeoMapType. Task-number: QTBUG-58931 Change-Id: I97a8852fbb3bbac88fdbf0d47e8247ea7ed1f31e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix add/removeMapItemGroup not checking if the item is added to a mapPaolo Angelelli2017-06-181-5/+4
| | | | | | | | | Currently these methods aren't checking if a group is already added to another map. This patch fixes it. Change-Id: I58a5e633b44abfcae5c362f8e97d4c6706869ac5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix Map.addMapItemGroup documentationPaolo Angelelli2017-06-121-3/+1
| | | | | | | Items in map item groups are not reparented anymore. Change-Id: I1d083bf8cba5aa46e8640c175bf90aa9f04b69aa Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix incorrect Map.visibleRegion when all the map is visiblePaolo Angelelli2017-06-091-1/+11
| | | | | | Change-Id: I9d532416e0e6dd06f84216d97bcf160e3e8e43be Task-number: QTBUG-57690 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-231-3/+4
|\ | | | | | | Change-Id: I122bd675639baca961882ec9d512900f4e7e773b
| * Fix compile due to change in private API in qtdeclarativeJan Arve Saether2017-05-191-3/+4
| | | | | | | | | | | | | | | | | | | | e0c30279ec1fad88346ed3fb483bc3c672fdd01b in qtdeclarative changed some private APIs, so we need to adjust code correspondingly. Task-number: QTBUG-57253 Change-Id: I0cf30b5f4aaf5c040d72a384d87b0fe277a84d27 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Fix incorrect condition in QDeclarativeGeoMap::geometryChanged()Paolo Angelelli2017-05-231-1/+1
|/ | | | | | | | isEmpty should be used instead of !isValid, as 0,0 is a condition to skip as well. Change-Id: Ibbfa03b5a09fd0adf4b143d21674870301459f45 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add pluginName to QGeoMapType and check against it in setActiveMapTypePaolo Angelelli2017-05-071-10/+24
| | | | | | | | | | | This patch adds a QByteArray member to QGeoMapType with the name of the plugin providing that map type. This value is then used to validate what is passed to QDeclarativeGeoMap::setActiveMapType to see if it's a map type for the currently set plugin. Change-Id: If15b67c32150f0c3c2815d28e26fc37138d4cf71 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix QDeclarativeGeoMap::visibleRegion when map is rotated/tiltedPaolo Angelelli2017-05-031-3/+6
| | | | | | | | This patch attempts to return something meaningful from that method also when the map is rotated/tilted, while waiting for QGeoPolygon. Change-Id: Id14853f2078ed399cf7f2c603ae7442489c07829 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix for MapGestureArea pinch and scroll wheel not honoring min zoomPaolo Angelelli2017-05-031-2/+18
| | | | | | | | | This patch fixes a regression introduced with e81ba34a98b259723e783e2d2df4321309992291, which made possible to zoom below the minimum valid zoom level for a viewport size. Change-Id: I4e71530b9bc5423ea24083146963c3bd0928f14a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix build for -no-feature-wheeleventStephan Binner2017-04-191-0/+2
| | | | | Change-Id: I69246dcaeda841892b1efe182725629517031447 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Clarify overzoomEnabled property of QGeoCameraCapabilitiesv5.9.0-beta2Paolo Angelelli2017-04-121-1/+3
| | | | | Change-Id: If6f8fd446c562d6ccaf368e1d5afb5eee113fece Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Allow overzooming when setting zoomLevel directly in a MapPaolo Angelelli2017-04-121-3/+4
| | | | | | | | | | | | | This patch moves the lower/upper bound check on setZoom from QDeclarativeGeoMap to the gesture area, allowing to set higher zoom levels than the maximumZoomLevel when setting Map.zoomLevel directly, for the map types that support overzoom. This is now safe as the bound check is introduced in the tile fetcher, so no invalid tiles will be requested, and is beneficial when combining layers supporting different maximum zoom levels. Change-Id: I08ee9c282ee2ebc1dafa3c68a238b93ffbc1ba02 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix for copyright notice not showing before map type is changedPaolo Angelelli2017-04-121-1/+19
| | | | | | Task-number: QTBUG-58801 Change-Id: I2a980c6d218d0d7e44277f7b31fcdd7355e31698 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Prevent QList detaching in for loops in QDeclarativeGeoMapPaolo Angelelli2017-04-111-3/+3
| | | | | | | Using qAsConst where possible to prevent QList from detaching. Change-Id: Ief03fb17761e350335f945b7134cf4a9266971d7 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Protect QGeoMap pointer with QPointerPaolo Angelelli2017-04-111-13/+13
| | | | | | | | | | | | m_map inside QDeclarativeGeoMap is created, but also destroyed, by the engine. In some cases (dynamic QML object creation/destruction) the engine may disappear before the Map. This patch introduces a QPointer to prevent a dangling pointer Change-Id: Ice3c57b4dbeb96ee8d7e4d401654b9085c105dec Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Complete parameter documentationNico Vertriest2017-04-101-1/+1
| | | | | | | | | | | qdeclarativegeomap.cpp: 1327: warning: Can't link to 'Component.onCompleted' qgeopath.cpp:117: warning: Undocumented parameter 'width' in QGeoPath::QGeoPath() qgeopath.cpp:117: warning: Undocumented parameter 'path' in QGeoPath::QGeoPath() qgeoshape.cpp:90: warning: Undocumented enum item 'PathType' in QGeoShape::ShapeType qgeoshape.cpp:231: warning: No such parameter 'QGeoRectangle' in QGeoShape::boundingGeoRectangle() Change-Id: Ie57dff2aabe82d61b8122362a396ac706939c3b3 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Trigger manually map update after initializationKarol Polak2017-04-101-0/+6
| | | | | | | | If all of the tiles were loaded from cache and plugin for the map was set after creation of the declarative map, it can occur that item is not updated Task-number: QTBUG-60021 Change-Id: I260b6219b65ef16726aa767d3a83c6fc756642b5 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Update location screenshotsThiago Marcos P. Santos2017-04-061-1/+1
| | | | | | | | Better rendering using Mapbox GL plugin. Change-Id: I3ef1862988e652c1caad62920c2f3b5775f18552 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Bruno de Oliveira Abinader <brunoabinader@gmail.com>
* Consider keepTouchGrab when handing mouse events in QDeclarativeGeoMapPaolo Angelelli2017-03-241-2/+2
| | | | | | | | | | QDeclarativeGeoMap used to consider only keepMouseGrab. Some components only set keepTouchGrab. With this patch both are considered Task-number: QTBUG-59416 Change-Id: Ie551c9a207cdac144fd760b863fc5fafd4c21274 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add mapReady to notify when the map is readyThiago Marcos P. Santos2017-03-061-7/+16
| | | | | | | | | This adds a mean to notify when the Map becomes truly ready. This property should always be used in place of listening on the Component completed() signal. Change-Id: I98db7a4fd1fea6e54f6e6eca7ac50f26f90276f5 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Notify when the map is initializedThiago Marcos P. Santos2017-03-031-0/+8
| | | | | | | | | This patch makes the map notify when the initialization is complete, and thus all the API functioning as expected, like fromCoordinate and toCoordinate. Change-Id: Idaebbcf910f32dd297bd5ebec6dffa166d015b4a Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Fix clang compilation warningsBruno de Oliveira Abinader2017-03-011-2/+0
| | | | | | Change-Id: I972cd8bc307ffce9c8f7a56b76cfc0f025b7ad98 Reviewed-by: Thiago Marcos P. Santos <tmpsantos@gmail.com> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Remove tiltingSupported and bearingSupported propertiesPaolo Angelelli2017-02-281-26/+0
| | | | | | | | | | As these two properties would be deprecated in 5.10, this patch removes them, implicitly forcing all plugins to support tilting and bearing (or at least bearing, as tilting can be bounded via range). Task-number: QTBUG-58931 Change-Id: Iddec8cc225aaa656e8d509bd41b860f18956788a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Make min/max Tilt/FieldOfView Read/WritePaolo Angelelli2017-02-281-43/+164
| | | | | | | | | | | | This change makes the currently read only properties minimumTilt, maximumTilt, minimumFieldOfView and maximumFieldOfView user-settable as well, like minimum and maximum zoom level. Autotests are included. Task-number: QTBUG-58931 Change-Id: I784be7bd0d960061e94bc40cd8a45e466754526f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Make QGeoCameraCapabilities independent of the enginePaolo Angelelli2017-02-281-72/+116
| | | | | | | | | | | | | | This patch makes it possible to change QGeoCameraCapabilites at runtime, when the map type changes, to accommodate for those plugins that offer different maps having different capabilities. This is then used to properly push the min/max zoom levels for each map type in our OSM plugin. Autotests are included. Change-Id: I48532da77ffb3eaf2e752561395945c3a2c21985 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix support for MapParameters on Mapbox GL pluginThiago Marcos P. Santos2017-02-171-2/+2
| | | | | | | | | | Mapbox GL plugin can now accept MapParameters, such as MapParameters used for the Mapbox runtime style API, allowing runtime changes on the map, not restricted only to style, but also adding new geometries and features. Change-Id: If0394bd044a2d3058fe5480966880a1055614ea2 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Remove moc_* inclusions from source filesPaolo Angelelli2017-02-141-2/+0
| | | | | | Change-Id: I7385348d7b6ec22fa92ed1be65f89e262c38b5c0 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Default style for the copyright defined on the pluginThiago Marcos P. Santos2017-02-131-0/+9
| | | | | | | | | | | | The Mapbox GL plugin defines a logo image on the copyright notice that needs styling in order to have an appealing look and feel. The default style is empty, so we need to fetch one for the plugin to make this work. Task-number: QTBUG-58601 Change-Id: Ib3f7d7d7fcb2797c6381fc862ce7513b516c9ff5 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Use cameraCapabilities from QGeoMapPaolo Angelelli2017-02-101-4/+4
| | | | | | | | | This patch makes the access to cameraCapabilities consistent throughout qdeclarativegeomap.cpp, whereas previously this was sometimes accessed through the mappingManager. Change-Id: I6948f4c376530162a872798b5df848c48237c4c6 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add QDeclarativeGeoMap::fitViewportToVisibleMapItemsPaolo Angelelli2017-01-311-6/+21
| | | | | | | | | | As per request, this additional method behaves like fitViewportToMapItems except that only items that are visible are considered Task-number: QTBUG-57912 Change-Id: Ic334ad0a5a2899b2990a03d4ba655d03c39c1227 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Allow to create maps with groups of map itemsPaolo Angelelli2017-01-311-9/+104
| | | | | | | | | | | | | This patch lets a user create an external qml file, and put multiple map items inside a parent MapItemGroup{}, and add that element to a Map item. QDeclarativeGeoMap gets also two associated methods: addMapItemGroup and removeMapItemGroup to deal with item groups at runtime. Additionally, clearMapItems now clears also added item groups. Task-number: QTBUG-55211 Change-Id: Ie4e602e4bda65fb56422b721be5fd34c54eb7954 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add tilt and bearing gestures to QQuickGeoMapGestureAreaPaolo Angelelli2017-01-301-0/+2
| | | | | | | | | | | | | | | | | | | This patch adds two new gestures to the Map gesture area, that are two finger rotation and two finger parallel vertical sliding. The first gesture changes the bearing of the map, while the second gesture changes the tilt angle. The rotation gesture can co-exist with both pan and pinch. In other words it's possible to put down two fingers on the map, and rotate, pinch and pan at the same time. The tilt gesture, on the other hand, excludes the others when initiated, and also does not start, if any of the other actions is in progress. Change-Id: I0ef003caf0efe4addcf2e5ad563212f3c53db9ba Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>