summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps
Commit message (Collapse)AuthorAgeFilesLines
* 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 MapCircle artifacts with small radiusesPaolo Angelelli2017-08-032-7/+23
| | | | | | Task-number: QTBUG-62154 Change-Id: I86647b0509b4682ea6fde1305834b6a86b0b6f64 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix memleak: delete QGeoMap when QDeclarativeGeoMap gets deletedBogDan Vatra2017-07-284-21/+23
| | | | | | Task-number: QTBUG-62122 Change-Id: I538e1eeb6bce3f5de424003b0b31fa59599dc2d5 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Fix dragging items out of map boundsPaolo Angelelli2017-07-282-17/+38
| | | | | | | | | | | | | | | | | | | | | | | | | In 5.9.0 map items are clipped against the visible region. This implies that their geometry is also clipped against the visible region. This is problematic in ::geometryChanged, since the old geometry is always clipped in this way. This patch clips items against a "projectable" region instead, that is the part of the map that is in front of the camera. Since this can produce very large vertices, mapbox earcut 3rd party library is pulled in, to replace qTriangulate that only supports coordinates up to 1<<21. This patch also contains a fix for earcut.hpp to make it build also on QNX6.6 Task-number: QTBUG-61727 Change-Id: Iffc95fdae88fef982c1eb86db567b326b5e51057 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Revert "Fix dragging items out of map bounds"Paolo Angelelli2017-07-192-38/+17
| | | | | | | | This reverts commit 2ab93acd9751b3ffe2c36a4a0e37dc792686a08f. Reason being: not passing QNX6 bot Change-Id: If45fe095b6e6959f7c40e3e0ed7a14d278bbb230 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove dead code in QDeclarativePolygon/Polyline MapItemsPaolo Angelelli2017-07-172-149/+0
| | | | | Change-Id: I95c1d361bd6ba43a3eed5465fc2f74b7a622af72 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix dragging items out of map boundsPaolo Angelelli2017-07-172-17/+38
| | | | | | | | | | | | | | | | | | | | | In 5.9.0 map items are clipped against the visible region. This implies that their geometry is also clipped against the visible region. This is problematic in ::geometryChanged, since the old geometry is always clipped in this way. This patch clips items against a "projectable" region instead, that is the part of the map that is in front of the camera. Since this can produce very large vertices, mapbox earcut 3rd party library is pulled in, to replace qTriangulate that only supports coordinates up to 1<<21. Task-number: QTBUG-61727 Change-Id: I7449e755a4848a2b2107c5de4e27821e3e887bfb Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Do not draw mapQuickItems if coordinate_ is invalidPaolo Angelelli2017-07-051-1/+8
| | | | | | | | | This change also reverts a4dc11fd52f42676265cff2ff9396a7396f1ccb3 Task-number: QTBUG-61070 Change-Id: I2046356e339b5889860b3dce10627d6b736ac02f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix for Plugin.required being readonlyPaolo Angelelli2017-06-202-1/+24
| | | | | | | | | | The documentation clearly states that this property should be writable but it's not. Task-number: QTBUG-57419 Change-Id: I1dc93d45ddf52f2e1eee9572f153f4f19916ca2a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix add/removeMapItemGroup not checking if the item is added to a mapPaolo Angelelli2017-06-183-6/+20
| | | | | | | | | 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 MapQuickItems w/o zoomLevel sticking around when behind the cameraPaolo Angelelli2017-06-141-3/+14
| | | | | | | | | | | | This patch fixes the case when rendering a map with MapQuickItems in it that have the zoomLevel property not set and using a tilting angle. Without the patch, in some scenarios the items may stick around on the screen while they should simply go away. Change-Id: Ic485ecf5851d27a0248ff1745ae552bbb81423ba Reviewed-by: Thiago Marcos P. Santos <tmpsantos@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Fix for QDeclarativeGeoMapCopyrightNotice crashing the applicationPaolo Angelelli2017-06-142-6/+16
| | | | | | | | Some pointers were used without prior check. This adds checks where necessary. Change-Id: I82e01b72fd3a46a6add7cf286e81686b686b272b 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 for GeocodeModel documentationPaolo Angelelli2017-06-091-3/+3
| | | | | | | Links to Location QML element are broken Change-Id: Iffda8fd8c8cdd9e00e45592ee2f0e971865defb9 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>
* Fix documentation for return types from QJSValue to the actual QML typePaolo Angelelli2017-05-313-3/+3
| | | | | Change-Id: I6db1f0db07de3bb9446f0b04ea95f34b56acf805 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Check for validity in QDeclarativeGeoMapQuickItem::setCoordinatePaolo Angelelli2017-05-291-1/+1
| | | | | | Task-number: QTBUG-61070 Change-Id: I610a943e9aeaa2129b87bfd4e4f5afa391bc7c31 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-033-4/+23
| | | | | | | | | 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>
* Move QGeoRectangle definition inside qgeorectangle.hPaolo Angelelli2017-05-031-1/+1
| | | | | | Change-Id: I7d0bb4eac89ca9a018f71faa9d73f62d97a24085 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make error_messages.h privatePaolo Angelelli2017-05-028-9/+19
| | | | | Change-Id: Iba33d12fad113b64cb071f0542a2c92034ff755d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix build for -no-feature-wheeleventStephan Binner2017-04-194-0/+10
| | | | | Change-Id: I69246dcaeda841892b1efe182725629517031447 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix build for -no-feature-cssparserStephan Binner2017-04-191-0/+2
| | | | | Change-Id: I06c0c1ad4744cd91a116906d7e7725f05cc35688 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix build for -no-feature-texthtmlparserStephan Binner2017-04-191-0/+16
| | | | | Change-Id: I9ab2c7b494aff0059f871a2bedee414559272a73 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-181-1/+1
| | | | Change-Id: I8ce0a0994d57fb077be4b6771f219bfc4134aa22
* 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-122-5/+7
| | | | | | | | | | | | | 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-114-17/+18
| | | | | | | | | | | | 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>
* Rename libclipper namespaceThiago Marcos P. Santos2017-04-102-3/+3
| | | | | | | | | | | So it won't clash with the libclipper used by the Mapbox GL plugin when linking Qt with -static. With -static, all the plugins are linked together instead of each one having its own shared library, thus, hiding private symbols. Change-Id: I33ee4afd4b83741c5f3fae32a88da7f4a7fee75f 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>
* Improve flicking behavior of QQuickGeoMapGestureAreaPaolo Angelelli2017-04-032-51/+37
| | | | | | | | | This patch replaces the two separate flick velocities and displacements for x and y with one vector , so that there will be no discrepancy between the flicking direction and where the map actually flicks Change-Id: I83164107003a423cb7332da5759d83ff689c1b31 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix rotation gesture startPaolo Angelelli2017-03-271-2/+2
| | | | | | | | | | This patch makes the rotation gesture start more smoothly instead of abruptingly start with an initial rotation equal to starting angle threshold, once this threshold angle has been trespassed. Change-Id: I2be52fa53f50151b9b87244a1b53ca4105121a8b Reviewed-by: Bruno de Oliveira Abinader <brunoabinader@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Check for map in map item's geometryChangedPaolo Angelelli2017-03-274-4/+4
| | | | | | | | | Add additional sanity checks to do the geometry changing only if the map() has been set already (that is, the item has been added to the map) Change-Id: Id5b5faa41c68c80c3ad322f408b7a8abe5d2f7ab Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* 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>
* Remove pathPropertyChanged() from Polyline,PolygonPaolo Angelelli2017-03-222-2/+0
| | | | | | | This private method is not even implemented. Change-Id: I30c0e559d0264f1b0eb6d394c9675879b23be44e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Cache coordinate projections in map itemsPaolo Angelelli2017-03-228-68/+165
| | | | | | | | | | | | This patch caches the result of geoToMapProjection() for the coordinates of the map items, regenerating this data only upon coordinate changes. This allows avoiding to perform a (mercator) projection basically every time the item has to be drawn, and instead do only the wrapping around the camera center and the projection to screen Task-number: QTBUG-59479 Change-Id: Iea5ec04f360d2fe7495cd9c1dd278e83200e0f8d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Correctly handle pinch, rotation and tilt gestures in map gesture areaPaolo Angelelli2017-03-222-43/+111
| | | | | | | | | This patch reworks the logic for handling the touch gestures. Now tilt can kick in after parallel panning, making it easier to achieve it. Change-Id: I528f146fd80532bbc8b97f8f92b8c1a38c40a710 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix for disappearing MapQuickItems with tilted cameraPaolo Angelelli2017-03-222-4/+30
| | | | | | | | | | | This patch fixes a bug that makes MapQuickItem disappear when the zoomLevel property is set, the camera is tilted and zoomed in very close to the item, causing the coordinate of the map quick item to end behind the camera. Task-number: QTBUG-59397 Change-Id: Iae92204917729eb9daaf8592db318613bf57b966 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Minor build cleanupsBruno de Oliveira Abinader2017-03-211-0/+1
| | | | | Change-Id: I85870f176510d1d6fd51bce94daf58fc326e13b3 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Handle flick state on gesture enabling/disablingPaolo Angelelli2017-03-131-2/+11
| | | | | Change-Id: I178c3ff8d93ce672b0d7e168acbf691c4ddd80de Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix MapQuickItem when zoomLevel is setPaolo Angelelli2017-03-082-5/+48
| | | | | | | | | This patch fixes the behavior of MapQuickItem when the zoomLevel is set, that is it makes behave the qquickitem as if it would be on the map, instead of on the screen. Change-Id: Ibb8a6000e2f6a37a68c32df001fc8565079a6f70 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>