diff options
author | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2016-09-15 23:12:42 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2016-10-05 11:30:12 +0000 |
commit | 218e208bbf1c3112d2ea5781debc605fc76db80a (patch) | |
tree | 34812fb7c66e401bc288d4916ec6fed58d443022 /src/plugins/geoservices/osm/qgeotileproviderosm.h | |
parent | a65d9b7acf62fdafd670b40c01425cedff61106c (diff) | |
download | qtlocation-218e208bbf1c3112d2ea5781debc605fc76db80a.tar.gz |
Fix cache mixing with high-dpi and low-dpi osm providers
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>
Diffstat (limited to 'src/plugins/geoservices/osm/qgeotileproviderosm.h')
-rw-r--r-- | src/plugins/geoservices/osm/qgeotileproviderosm.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.h b/src/plugins/geoservices/osm/qgeotileproviderosm.h index 3e887965..cea832f0 100644 --- a/src/plugins/geoservices/osm/qgeotileproviderosm.h +++ b/src/plugins/geoservices/osm/qgeotileproviderosm.h @@ -62,12 +62,13 @@ public: TileProvider(); // "Online" constructor. Needs resolution to fetch the parameters - TileProvider(const QUrl &urlRedirector); + TileProvider(const QUrl &urlRedirector, bool highDpi = false); // Offline constructor. Doesn't need URLRedirector and networkmanager TileProvider(const QString &urlTemplate, const QString &format, const QString ©RightMap, const QString ©RightData, + bool highDpi = false, int minimumZoomLevel = 0, int maximumZoomLevel = 19); @@ -89,6 +90,7 @@ public: inline QString format() const; inline int minimumZoomLevel() const; inline int maximumZoomLevel() const; + inline bool isHighDpi() const; QUrl tileAddress(int x, int y, int z) const; // Optional properties, not needed to construct a provider @@ -106,6 +108,7 @@ public: QString m_urlSuffix; int m_minimumZoomLevel; int m_maximumZoomLevel; + bool m_highDpi; int paramsLUT[3]; //Lookup table to handle possibly shuffled x,y,z QString paramsSep[2]; // what goes in between %x, %y and %z @@ -145,6 +148,7 @@ public: QString format() const; int minimumZoomLevel() const; int maximumZoomLevel() const; + bool isHighDpi() const; const QGeoMapType &mapType() const; bool isValid() const; bool isResolved() const; @@ -152,6 +156,7 @@ public: Q_SIGNALS: void resolutionFinished(const QGeoTileProviderOsm *provider); void resolutionError(const QGeoTileProviderOsm *provider); + void resolutionRequired(); public Q_SLOTS: void resolveProvider(); |