summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/osm/qgeomapreplyosm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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-1/+1
| | | | | | | | 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-1/+1
| | | | | | | | | Which is QNetworkReply::error(). Use QNetworkReply::networkError() instead. Task-number: QTBUG-80369 Change-Id: Id41166a72c0d14bc77d9ec853db2f665617195ee Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Refactoring: removing m_reply from GeoReply classesPaolo Angelelli2016-11-291-38/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch tries to simplify the code removing the contained m_reply from all the Geo[Map,Route,Geocode,Places]Reply classes. The need for m_reply was associated to the "abort" method, but this can be solved by emitting a signal in the superclass abort() method, and connecting that to QNetworkReply::abort() in the constructor. Since QNetworkReplyHttpImpl always sends an OperationCanceledError it should then be safe to call deleteLater() on the network reply in the slot connected to QNetworkReply::error This patch also prevents the series of "QCoreApplication::postEvent: Unexpected null receiver" warnings that are generated due to deletingLater already deleted objects (abort() emits an error, the reply is destroyed inside the onError slot, but also in the abort() method). Finally, this patch removes the setFinished() call in QGeoRouteReply::abort() since the documentation does not mention this, and all the subclasses do not perform this operation and emit the corresponding signal. tst_qgeoroutereply has been adapted accordingly. Change-Id: I226ee163e7bed784dd7f0da1522e651459543bca Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Michal Klocek2016-07-281-8/+9
|\ | | | | | | Change-Id: I37542960aa091ab2074914a2cebb8c5114237a26
| * Add indirection for osm providersPaolo Angelelli2016-07-271-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | 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>
* Fix disfunctional disk cache with OSMLaszlo Agocs2015-09-071-1/+5
| | | | | | | | | | | | | | | | | | | | | The MapQuest servers use JPEG, not PNG. The disk cache, unlike the memory one, passed in the extension as the format to loadFromData(). This failed for JPEG files with an extension of .png. In addition, using split('.')[1] to determine the file extension is bogus. On Linux for example, a directory of "$HOME/.cache/QtLocation/..." results in putting "cache/..." into format which is then conveniently ignored by QImageReader. On OS X however there is no dot, so it "correctly" picks "png" for the JPEG data, hence the console is flooded with warnings about failed tile loading. On top of the above, the disk cache is made more robust by not relying on the format string. As long as only formats supported by QImageReader are in use, it can recognize the correct format from the data. (the memory cache does this already anyway) Change-Id: I90ece5bd157d457afa0025527c84070427a60313 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>
* Remove connection to non-existing slotAlex Blasche2015-01-291-1/+0
| | | | | | | This is a cleanup after d8d9c4fbb6047b59b98108d6e3221206aa926ccd Change-Id: I99007e78ad47c68445e219e79d56bd2336ff6738 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
* Add support for more tile types to OSM plugin.Aaron McCarthy2015-01-281-10/+1
| | | | | | | | | | | | | | | | | | 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>
* Don't reparent network replies away from their owning network managerLars Knoll2015-01-261-5/+0
| | | | | | | | | | | | This can cause bad things to happen when the network manager owning the replies gets deleted. The network manager destructor usually cleans up it's own replies. When reparenting them away that won't happen, but the replies might still have pending events and have pointers back into the network manager. Change-Id: I1d8330a198e9225a557d127f4a91247bcfa4812f Reviewed-by: Lars Knoll <lars.knoll@digia.com> 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>
* Switch to MapQuest tileserverFabian Bumberger2014-02-041-0/+3
| | | | | | | | | | | | | 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/+117
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>