Commit 6490ce19 authored by Dennis Nienhüser's avatar Dennis Nienhüser
Browse files

Use a set of discrete tile levels 13, 15, 17 for now

parent c8156f7d
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<vectortile name="geojson_data" expire="604800" > <vectortile name="geojson_data" expire="604800" >
<sourcedir format="OSM.ZIP"> earth/vectorosm </sourcedir> <sourcedir format="OSM.ZIP"> earth/vectorosm </sourcedir>
<tileSize width="256" height="256" /> <tileSize width="256" height="256" />
<storageLayout levelZeroColumns="1" levelZeroRows="1" minimumTileLevel="18" maximumTileLevel="18" mode="OpenStreetMap" /> <storageLayout levelZeroColumns="1" levelZeroRows="1" tileLevels="13,15,17" mode="OpenStreetMap" />
<projection name="Mercator" /> <projection name="Mercator" />
<downloadUrl protocol="http" host="maps.kde.org" path="/earth/vectorosm/" /> <downloadUrl protocol="http" host="maps.kde.org" path="/earth/vectorosm/" />
<downloadPolicy usage="Browse" maximumConnections="20" /> <downloadPolicy usage="Browse" maximumConnections="20" />
......
...@@ -88,8 +88,12 @@ void VectorTileModel::setViewport( const GeoDataLatLonBox &bbox, int radius ) ...@@ -88,8 +88,12 @@ void VectorTileModel::setViewport( const GeoDataLatLonBox &bbox, int radius )
// roughly equals the global texture width // roughly equals the global texture width
if ( tileZoomLevel > m_layer->maximumTileLevel() ) QVector<int> tileLevels = m_layer->tileLevels();
tileZoomLevel = m_layer->maximumTileLevel(); auto iter = qLowerBound(tileLevels, tileZoomLevel);
if (*iter != tileZoomLevel && iter != tileLevels.begin()) {
--iter;
tileZoomLevel = *iter;
}
// if zoom level has changed, empty vectortile cache // if zoom level has changed, empty vectortile cache
if ( tileZoomLevel != m_tileZoomLevel ) { if ( tileZoomLevel != m_tileZoomLevel ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment