1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-28 03:59:15 +02:00

Enable world basemap projection in web mercator projection

This commit is contained in:
2020-02-17 09:47:47 +01:00
parent 27edc4d6b5
commit 2c503a2406
3 changed files with 15 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include <QXmlStreamReader>
#include <QDir>
#include "map/osm.h"
#include "vectortile.h"
#include "gmap.h"
@ -103,6 +104,11 @@ bool GMAP::loadTile(const QDir &dir, bool baseMap)
if (tile->zooms().min() < _zooms.min())
_zooms.setMin(tile->zooms().min());
// Limit world maps bounds so that the maps can be projected using
// the default Web Mercator projection
if (_bounds.height() > 120)
_bounds &= OSM::BOUNDS;
return true;
}

View File

@ -1,5 +1,6 @@
#include <QMap>
#include <QtEndian>
#include "map/osm.h"
#include "vectortile.h"
#include "img.h"
@ -168,6 +169,11 @@ IMG::IMG(const QString &fileName) : _file(fileName)
tile->markAsBasemap();
}
// Limit world maps bounds so that the maps can be projected using
// the default Web Mercator projection
if (_bounds.height() > 120)
_bounds &= OSM::BOUNDS;
if (!_tileTree.Count())
_errorString = "No usable map tile found";
else