summaryrefslogtreecommitdiffstats
path: root/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Avoid adding x-y-z structure of tile server if the url end with a keyMatthias Rauter2023-11-231-1/+1
| | | | | | | | | | | We previously added the x-y-z structure "%z/%x/%y.png" if the url did not end with ".png". This is not very flexible and will not allow to add an apikey that does not end with ".png". Searching for "%x" instead should be more flexible. Fixes: QTBUG-115742 Change-Id: I0ec4cf1713292896b84894224c1e279babc486ed Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Allow enabling QT_USE_QSTRINGBUILDER for pluginsAlexey Edelev2023-08-041-14/+18
| | | | | Change-Id: I88d4d217bded411299330e2af0b4230303e39c51 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Avoid adding x-y-z structure of tile server if it already exists in urlMatthias Rauter2023-02-271-1/+3
| | | | | Change-Id: I94255b1c6406e82bd12b126fbdff6ac43e63dbd2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* 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>
* Mark the module as free of qAsConst()Marc Mutz2022-12-071-1/+1
| | | | | Change-Id: Ie67ec9b4f1f808b3b70ca7beb98f90c9cd1f2a9f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace foreach with ranged for and set QT_NO_FOREACHVolker Hilsheimer2022-07-261-1/+1
| | | | | | | | | | Make containers const where they obviously should be, iterate over references where it's clearly possible. Cherry-pick of 2c8c5dca44aba5612cc67b04dd3c7e5fc4919b19. Change-Id: Ie55a58873b48bbb60ac49790db612f85777e6ceb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-251-8/+8
| | | | | | Task-number: QTBUG-84469 Change-Id: Iefd2fb627602ef4744d80858eee72a089ef5f4ec Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use network cache when fetching provider data in the OSM pluginPaolo Angelelli2019-05-061-16/+23
| | | | | | | | | 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.9' into 5.10v5.10.0-beta1Paolo Angelelli2017-09-111-7/+8
|\ | | | | | | Change-Id: Ibcf748d5f0d172ad5c77bdcd41806009ff6914e3
| * Fix disabling redirection for providers that have no local fallbackMÃ¥rten Nordheim2017-09-111-7/+8
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Add camera capabilities + metadata to QGeoMapType/QDeclarativeGeoMapTypePaolo Angelelli2017-07-311-18/+8
|/ | | | | | | | | | | | | | 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>
* Add pluginName to QGeoMapType and check against it in setActiveMapTypePaolo Angelelli2017-05-071-9/+10
| | | | | | | | | | | 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>
* Allow overzooming when setting zoomLevel directly in a MapPaolo Angelelli2017-04-121-0/+1
| | | | | | | | | | | | | 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>
* Replace QGeoMapType argument of cameraCapabilitiesPaolo Angelelli2017-04-121-5/+5
| | | | | | | | | | Since the only part of QGeoMapType used in the method is mapId, there's no need to pass the whole map type as argument. The benefit is that the camera caps can be requested solely based on the info in QGeoTileSpec. Change-Id: Iafd0e2a1d4d45fbf02b862efe56841001cbebd75 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add parameter to control prefetching in tile-based geoservice pluginsPaolo Angelelli2017-03-271-0/+12
| | | | | Change-Id: I18fc1788f7af0efe76f97257ffe739eb1a96e6cc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Make QGeoCameraCapabilities independent of the enginePaolo Angelelli2017-02-281-8/+18
| | | | | | | | | | | | | | 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>
* Add rotation/tilting support to QGeoTiledMapScene/QGeoCameraTilesPaolo Angelelli2017-01-261-0/+6
| | | | | | | | | | | | This patch adds rotation and tilting support to QGeoTiledMapScene and QGeoCameraTiles. It also adds the related capabilities to the geoservice plugins mapping managers QML Api is added in a separate patch Change-Id: I3de1b52a9928c4856f6ee57ad39191acebe0f770 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Prevent destroying QGeoTileProviderOsm before QGeoFileTileCacheOsmPaolo Angelelli2017-01-171-1/+1
| | | | | | | | | | | | | | Parenting QGeoTileProviderOsm under QGeoMappingManagerEngine puts them at the same level in the qobject tree as QGeoFileTileCacheOsm. Since the latter uses the providers in the destructor, it might end up calling the destructor with providers already destroyed. This patch parents the providers under the file tile cache, so that they will be destroyed after the cache. Task-number: QTBUG-58124 Change-Id: Id2fc04da58e1ba9c80a4b6c4ebeaf98cccc7d872 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add cache cost strategy parameters to all geoservice pluginsPaolo Angelelli2016-11-241-1/+39
| | | | | | | | This patch adds the possibility to change the cost strategy on all the geoservice plugins Change-Id: I0903d931ea228cc468216780fb87b466bc383063 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Evict obsolete provider data on init()Paolo Angelelli2016-11-081-15/+29
| | | | | | | | | | | | | | | | | | | | | | 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-9/+12
| | | | | | | | | | | | | | | | | 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>
* Add OSM plugin parameter osm.mapping.highdpi_tilesPaolo Angelelli2016-08-301-60/+85
| | | | | | | | | | | | | | | | | | | 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 HighDpi support for OpenStreetMapPaolo Angelelli2016-08-051-2/+2
| | | | | | | | This patch changes the osm providers repository to /osm/5.8/ where a provider with @2x tiles is used for the street style Change-Id: I9b2cd9e8f385506d153b9c430c1f99f7f6e7946c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Version tile cache with qt version and evict obsolete data on init()Paolo Angelelli2016-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch changes the base cache directory to a new scheme containing the qt version. At the time of commit, this would be "QtLocation/5.8/tiles/" This versioning does not have to change at every release, but when there are changes in the caching scheme. The reason for this is that, otherwise, it becomes difficult to clean up old cache data. QGeoFileTileCache::init already clean up old tile cache from 5.4 or older, where the cache data wasn't organized under a directory for each plugin. In 5.8 different naming scheme are introduced for mapbox tiles (with @1x,@2x) , here maps (with ppi), and soon for OSM too (with an identifier for the actual provider, not only the mapId). With this patch it will become easier and cleaner to upgrade the cache data without leaving residues. Change-Id: I89aeac0aaf1408d119cde5792fc69a64d5d89c3a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-021-9/+37
|\ | | | | | | Change-Id: I9bfe99e7e619cbf03cda73c3df4f2f51851474ae
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-9/+37
| |\ | | | | | | | | | Change-Id: I4f29307985225a723304783e00a6844a1b9ee825
| | * Enable dynamic addition/removal of map types by the mapping managerPaolo Angelelli2016-07-291-9/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Map types are currently fixed in the constructor, regardless of whether they were available, or, now, whether they are enabled or not. This patch makes the geomappingmanager notify (e.g., emit a signal) when the available map types change at runtime. This is used in the OSM mappingmanagerengine, which can now disable map types if provider records turn out to be invalid or disabled after they have been fetched. Change-Id: I8e0e75504c882609f91c6d1ceb88424eee656f26 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Merge remote-tracking branch 'gerrit/5.7' into devAlex Blasche2016-07-291-19/+134
|\| | | | | | | | | | | Change-Id: I6a1a72547077c628429ee9a0781070ad3ae787f1
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Michal Klocek2016-07-281-16/+134
| |\| | | | | | | | | | Change-Id: I37542960aa091ab2074914a2cebb8c5114237a26
| | * Add indirection for osm providersPaolo Angelelli2016-07-271-16/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | OSM Geoservice plugin improvements, including offline data supportPaolo Angelelli2016-07-211-0/+34
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains improvements for the OSM geoservice plugin, in form of property-controllable disk cache, and the support for a directory containing an offline dataset. The offline directory can contain subdirectories also in form of symlinks. If duplicate tiles are present, the newest is used. The population of the offline tiles registry is offloaded to a thread to prevent blocking the startup of the application. No synchronization is used (except on cache destruction), so that, as the tiles are being indexed, they can be used in the application. For the time being, no support is given to populate such directory (mostly due to current API limitations), but tiles can be placed manually, for example copying them from the disk cache directory. Task-number: QTBUG-45284 Change-Id: I518980669a3ee474545025adf05adc69cdd29781 Reviewed-by: Paolo Angelelli <paolo.angelelli@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* / 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>
* OSM supports up to zoom level 19Alex Blasche2015-07-221-1/+1
| | | | | | | | Change-Id: I803716afdd7ca9c2693c6236f5e741174d58a3f6 Task-number: QTBUG-47322 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com> Reviewed-by: Harald Meyer <dev@meh.at> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Use "osm" prefix for osm plugin parametersAlex Blasche2015-05-271-7/+7
| | | | | | | Task-number: QTBUG-42151 Change-Id: I58648bac947b19e675f129d78bec61e079a93d2c Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Allow custom URLs for OSM tilesWolfgang Bremer2015-05-081-0/+13
| | | | | | | | | | | | This enables the usage of various mapping services which use the OSM API for tile distribution. One only needs to set the urlprefix parameter to a correct url and the activeMapType to the "Custom URL Map". Task-number: QTBUG-32937 Change-Id: Ib24da19dc598ccc288047ce2651e6c1792ae2054 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
* Set shorter name for class names with 'MapData'Michal Klocek2015-05-041-5/+5
| | | | | | | | Rename all references and files with 'MapData' to use shorter name 'Map'. Change-Id: I8ab790146ee28e540e6866ba0218eea61bae6e64 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Remove QGeoMapData class.Michal Klocek2015-05-041-1/+1
| | | | | | | | | Since QGeoMap class does not have any subclasses, there is no need for keeping the bridge in form of QGeoMapData. This commit basically renames QGeoMapData to be QGeoMap. Change-Id: I6eb2f56f7ea83663034f4a8297e8e8f7f185d6a9 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Update LGPLv2.1 header for OSM plugin headerAlex Blasche2015-02-181-5/+5
| | | | | Change-Id: Idf94d346f90531f1453cff154f909d8fc64ab58c Reviewed-by: Maurice Kalinowski <maurice.kalinowski@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>
* Add support for more tile types to OSM plugin.Aaron McCarthy2015-01-281-3/+10
| | | | | | | | | | | | | | | | | | In addition to the existing MapQuest tile set make the ThunderForest tile set also available as additional supported map types. This change adds the following map types to the OSM plugin: StreetMap - from MapQuest SatelliteMapDay - from MapQueset CycleMap - from ThunderForest TransitMap (day) - from ThunderForest TransitMap (night) - from ThunderForest TerrainMap - from ThunderForest PedestrianMap - from ThunderForeset Change-Id: I663b275689ee55929d0afa7da20ed3c57c78e037 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Update license headers and add new license filesAntti Kokko2014-08-241-18/+10
| | | | | | | | | - 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>
* Add night property to MapType.Aaron McCarthy2014-07-211-2/+2
| | | | | | | | Similar to the mobile property this property allows applications to determine if the tile set is optimized for night time use. Change-Id: Ibaaffe6f745d90817b5938f493742fb019be0312 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Fix translatable strings and cleanup unnecessary stringsAlex Blasche2014-02-261-2/+2
| | | | | | | | | | | | 1.) Reduces the amount of translatable strings as console/qmlInfo() output is not translated. 2.) Unused error messages have been removed 3.) Additional translation hints have been added. Change-Id: I59ef36bd75ab1f6d4878657212884e1251b8a04e Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
* Switch to MapQuest tileserverFabian Bumberger2014-02-041-0/+1
| | | | | | | | | | | | | The official OSM tile server should not be used in applications. MapQuest is free and also allows to display a satellite map (which unfortunately only goes to zoomLevel 10). More info: http://wiki.openstreetmap.org/wiki/Tile_usage_policy Change-Id: Ia5e0d2c99ea4d8f3989f8460c778bf748c5b68b5 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Open Street Maps plugin.Aaron McCarthy2013-02-201-0/+86
A geo services plugin for Open Street Maps. Plugin currently only supports fetching online map tiles. Change-Id: I2a80633554d4049872fc58e48ff6b273dc1ea688 Reviewed-by: Alex <ablasche@gmail.com>