summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use SPDX license identifiersVolker Hilsheimer2023-02-021-38/+2
| | | | | | | Task-number: QTBUG-67283 Pick-to: 6.5 Change-Id: I4b8f877cc355c7c6cd410b3b1683defa58486381 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port to pointer-to-member-function connection syntaxVolker Hilsheimer2022-08-231-2/+4
| | | | | | | | | | | | | | | | Rename overloads that would cause conflict and require explicit overloa resolution via QOverload: - Q*Reply::error -> errorOccurred (equivalent to QNetworkReply) - Q*Engine::error -> errorOccurred (for consistency, even if no overloa - Q*Manager::error -> errorOccurred (ditto) - QDeclarativeGeoMap::copyrightChanged -> copyrightImageChanged As a drive-by, change QString value parameters to const references. Pick-to: 6.2 Change-Id: I1ab16079842540ca0a86f711d83b35c8c56135e6 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Use 'const' correctlyVolker Hilsheimer2022-07-281-1/+1
| | | | | | | | | | Don't return or pass const copies, use either plain copies or const references. Make getters const, make variables const, and use qAsConst in ranged for loops to avoid detaches. Pick-to: 6.2 Change-Id: If1463cf7f0077c08dedb15388d912b652c2b037c Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Silence build warnings, fix build errorsVolker Hilsheimer2022-06-161-2/+2
| | | | | | | | | | Replace various deprecated APIs with their supported Qt 6 versions. Most notably, replace QScopedPointer with std::unique_ptr, as the code frequently use deprecated QScopedPointer::swap. Change-Id: If9cb0be89423fd310073709eb390401d74240153 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Use up-to date LGPL license headerKai Köhne2021-12-021-11/+14
| | | | | | | | Remove usages of outdated LGPL3 header that references LICENSES.LGPLv3 instead of LICENSES.LGPL3. Change-Id: Ied647fc10d2bf051cccc8b38d75570b7caef1f28 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Merge branch '5.15' into devIvan Solovev2021-03-231-1/+1
|\ | | | | | | | | Task-number: QTBUG-91623 Change-Id: I3218a516d4ecb0030a14c692c7d3d94d5833c3fa
| * Fix typo in error->errorOccurred deprecation fixMårten Nordheim2020-04-201-1/+1
| | | | | | | | | | Change-Id: If9ee065e8d2cbca6ca0ff64415c509caa655a2e6 Reviewed-by: Paolo Angelelli <paolo.angelelli.qt@gmail.com>
* | Use QList instead of QVectorJarek Kobus2020-06-251-4/+7
|/ | | | | | Task-number: QTBUG-84469 Change-Id: Iefd2fb627602ef4744d80858eee72a089ef5f4ec Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QtLocation: get rid of now unneeded qOverloadsTimur Pocheptsov2020-03-231-1/+1
| | | | | | | | | | | In a preparation for final cleanup in dev/Qt6. This amends the recent change in QtNetwork where we deprecated ambiguous signal overload. Also, fix old SIGNAL to use the proper name. Task-number: QTBUG-82605 Change-Id: Ifc92ce4569ba15ac5429fe379f134a6dbe3a5f73 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Revert "qtlocation: remove uses of the deprecated member-function"Timur Pocheptsov2020-02-251-2/+2
| | | | | | | | This reverts commit b482674e51c097fccffa1e1cc32b4843ad393894. Reason for revert: naming in QProcess is considered to be the correct one. Change-Id: I6722adfc06b351c76fb432628a678c4ce887d594 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qtlocation: remove uses of the deprecated member-functionTimur Pocheptsov2020-01-151-2/+2
| | | | | | | | | Which is QNetworkReply::error(). Use QNetworkReply::networkError() instead. Task-number: QTBUG-80369 Change-Id: Id41166a72c0d14bc77d9ec853db2f665617195ee Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta4Qt Forward Merge Bot2019-05-071-0/+1
|\ | | | | | | Change-Id: I28b2db32a10b2f70d8c3626d645d279cfedb49f5
| * Use network cache when fetching provider data in the OSM pluginPaolo Angelelli2019-05-061-0/+1
| | | | | | | | | | | | | | | | | | Otherwise it becomes problematic to start up applications in absence of network. Change-Id: Ia543b88bd56bb6c93c803a66e345be1610a4dfe0 Reviewed-by: Tuomas Vaarala <tuomas.vaarala@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-011-1/+23
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I5700c90ee86873599b5e7c9ccb6cef7ca48153e7
| * Display a notice when requesting a SSL map type without SSL supportPaolo Angelelli2019-03-251-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some plugins request map data for some map types over HTTPS. Without SSL support (Qt built without SSL support, or missing OpenSSL libraries) this typically translates into blank maps. This is very evident on the MapViewer example. This patch makes sure that the example displays a notice when this situation happens. [ChangeLog] Added a notice to the MapViewer example to inform when a HTTPS-based map is selected without SSL support. Change-Id: I85428bb0536f33089a0e6045301c089fafe69d74 Fixes: QTBUG-74195 Fixes: QTBUG-74294 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Unify semicolon usage in Q_UNUSEDJesus Fernandez2019-01-231-2/+2
|/ | | | | Change-Id: I36dd6881b6f6f028869d63b6311cba7f52a99cc4 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta1Paolo Angelelli2017-09-111-1/+1
|\ | | | | | | Change-Id: Ibcf748d5f0d172ad5c77bdcd41806009ff6914e3
| * Fix disabling redirection for providers that have no local fallbackMårten Nordheim2017-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | Currently these providers would not turn ready when disableRedirection() is called, while they also get disconnected, thus never being tried to be resolved, resulting in stalling the completion of the provider's resolution process Task-number: QTBUG-63033 Change-Id: I316b858fbc66b82bc124b8814b25fe29bc0c21a1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devPaolo Angelelli2017-08-101-0/+2
|\ \ | |/ | | | | | | | | | | Conflicts: tests/auto/declarative_ui/tst_map.qml Change-Id: If408b8242b39f78926b5373393f3b1f65b262499
| * Fix OSM plugin not working with providersrepository.disabled = truePaolo Angelelli2017-07-071-0/+2
| | | | | | | | | | | | | | | | Provider's status was not updated when disabling the redirection. Task-number: QTBUG-61637 Change-Id: I5987cc8363f69060c5e9ed7daafaab03043e333c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add camera capabilities + metadata to QGeoMapType/QDeclarativeGeoMapTypePaolo Angelelli2017-07-311-1/+2
|/ | | | | | | | | | | | | | 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>
* Merge "Merge remote-tracking branch 'gerrit/5.8' into 5.9" into refs/staging/5.9Paolo Angelelli2017-02-281-1/+1
|\
| * Fix null pointer exceptionPaolo Angelelli2017-02-281-1/+1
| | | | | | | | | | | | | | | | This patch fixes a null pointer exception happening when the application starts without network and then the network becomes available Change-Id: Iedeacf8fb8f350dfa92c05c1d2e16f62199ca5fd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Make QGeoCameraCapabilities independent of the enginePaolo Angelelli2017-02-281-2/+19
|/ | | | | | | | | | | | | | 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>
* Evict obsolete provider data on init()Paolo Angelelli2016-11-081-16/+43
| | | | | | | | | | | | | | | | | | | | | | During initialization, this patch makes sure that the cached tiles belong to the provider currently in use by using the file lastModified() value and comparing it against the (optional) Timestamp in the provider records. If this value is not present in the provider record, or if it is older than the newest modified file, the data is untouched. This operation is performed separately for each map id. This method isn't perfect in all use cases, though. E.g., if we are forced to shut down one of the provider and run on the hardcoded fallback, which has an older TS. These are however rare edge cases that most likely won't happen in practice (in the case above we could put the content of the hardcoded provider in the remote json files too) Change-Id: Ie29cf05c1fbc835ce4e3363fc0caa38a97800214 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix cache mixing with high-dpi and low-dpi osm providersPaolo Angelelli2016-10-051-6/+21
| | | | | | | | | | | | | | | | | This cache fixes the cache mixing problem that has been introduced with the osm high dpi tiles support. high dpi providers fall back to low dpi ones and ultimately to hardcoded providers (also low dpi), and can also be enabled/disabled via plugin parameter, thus leaving the cache for a given map id dirty for the next run. With this patch high dpi tiles are named differently from low dpi ones. If high-dpi providers are selected, but become not available, the cache can also change the tileset to load at runtime Change-Id: I229692da07c1fc61c58fb0b6fae6ec5af16e43a7 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Fix for osm provider record fetcherPaolo Angelelli2016-09-191-1/+3
| | | | | | | | This patch fixes a bug introduced with the high-dpi support for osm, that caused various types of malfunctioning with the osm plugin Change-Id: I08e459059be4d8c99bd2d49b42c2502e0a5cef09 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* OSM: Honor min/max zoom level limits coming from the provider recordsPaolo Angelelli2016-08-301-2/+26
| | | | | | | | | | This patch prevents the tile fetcher from requesting tiles with a z values that is outside the range defined in the provider record. If the provider record does not specify these values, the default values are used (0 and 20) Change-Id: I5c3f7be8bbd2b2ce6c8c8d6d8d81431237e60f5b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add OSM plugin parameter osm.mapping.highdpi_tilesPaolo Angelelli2016-08-301-117/+355
| | | | | | | | | | | | | | | | | | | This patch adds a mean to enable/disable high dpi support for the OSM plugin too, following the same approach taken for the mapbox and here plugins. In order to do so, it has been necessary to rework QGeoTileProviderOsm. It can now be constructed with an arbitrary number of TileProviders, as opposed to the previous approach with one primary and one fallback tileprovider. It has also been necessary to disable Nearest interpolation for high dpi tiles, as it appears to produce considerable artifacts. So in presence of highdpi tiles, Linear interpolation is now always used. Change-Id: Id7d20fd5a320f3d5ef41b9fa28447a5c4f5398be Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add indirection for osm providersPaolo Angelelli2016-07-271-0/+318
To prevent furter breakage of qtlocation osm provider in existing qt versions, this patch introduces one level of indirection in resolving OSM providers, fetching the tile server address from files hosted at http://maps-redirect.qt.io/osm/5.6/ The content of the files requested for the server address resolution must be in JSON format, containing (currently) the following fields: { "Enabled" : bool, (optional) "UrlTemplate" : "<url template>", (mandatory) "ImageFormat" : "<image format>", (mandatory) "MapCopyRight" : "<copyright>", (mandatory) "DataCopyRight" : "<copyright>", (mandatory) "MinimumZoomLevel" : <minimumZoomLevel>, (optional) "MaximumZoomLevel" : <maximumZoomLevel>, (optional) } Enabled is optional, and allows us to temporarily disable tile providers if they go offline without firing requests to them. Default is true. MinimumZoomLevel and MaximumZoomLevel are also optional, and allow us to prevent tile requests to the providers, if they do not support the specific ZL. Default is 0 and 19, respectively. <server address template> is required, and is the tile url template, with %x, %y and %z as placeholders for the actual parameters. Example: http://localhost:8080/maps/%z/%x/%y.png <image format> is required, and is the format of the tile. Example: "png" or "jpg" <MapCopyRight> is required and is the string that will be displayed in the "Map (c)" part of the on-screen copyright notice. example: "<a href='http://www.mapquest.com/'>MapQuest</a>" <DataCopyRight> is required and is the string that will be displayed in the "Data (c)" part of the on-screen copyright notice. example: "a href= 'http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors" The patch also adds four additional OSM plugin parameters, modifies an existing ones, and removes another existing one. Removed: - osm.mapping.copyright, now removed and replaced by two other parameters (see below). New: - osm.mapping.providersrepository.address, allowing to change the hardcoded http://maps-redirect.qt.io/osm/5.6/ The implication of this parameter is that it becomes possible to use file:// urls or even qrc:, allowing to ship custom providers with the applicarions - osm.mapping.providersrepository.disabled, allowing to disable the indirection and go with hardcoded URLs by default. - osm.mapping.custom.mapcopyright replaces the old osm.mapping.copyright, and contains the copyright notice to be displayed next to the "Map (c)" part of the copyright, to be consistent with the way the copyright notice coming from the provider data is handled - osm.mapping.custom.datacopyright replaces the old osm.mapping.copyright, and contains the copyright notice to be displayed next to the "Data (c)" part of the copyright, to be consistent with the way the copyright notice coming from the provider data is handled Modified: - osm.mapping.host now became osm.mapping.custom.host, improving the naming consistency. Task-number: QTBUG-54599 Change-Id: Iee88883572a198c00bcf54cf2bc33fbcc0498a68 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>