mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-03-02 21:51:05 +01:00
Compare commits
4 Commits
c1c8f6303c
...
11ac5da640
Author | SHA1 | Date | |
---|---|---|---|
11ac5da640 | |||
112dc59cf2 | |||
aa892f6c3f | |||
4e1b696869 |
@ -1,4 +1,4 @@
|
|||||||
version: 13.12.{build}
|
version: 13.13.{build}
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
|
@ -3,7 +3,7 @@ unix:!macx:!android {
|
|||||||
} else {
|
} else {
|
||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
}
|
}
|
||||||
VERSION = 13.12
|
VERSION = 13.13
|
||||||
|
|
||||||
|
|
||||||
QT += core \
|
QT += core \
|
||||||
|
@ -37,7 +37,7 @@ Unicode true
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "13.12"
|
!define VERSION "13.13"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
: QPageSize::PageSizeId::A4)
|
: QPageSize::PageSizeId::A4)
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_OS_ANDROID
|
||||||
#define PIXMAP_CACHE 256
|
#define PIXMAP_CACHE 384
|
||||||
#define DEM_CACHE 128
|
#define DEM_CACHE 128
|
||||||
#else // Q_OS_ANDROID
|
#else // Q_OS_ANDROID
|
||||||
#define PIXMAP_CACHE 512
|
#define PIXMAP_CACHE 512
|
||||||
|
@ -295,7 +295,7 @@ int AQMMap::zoomFit(const QSize &size, const RectC &rect)
|
|||||||
qreal AQMMap::resolution(const QRectF &rect)
|
qreal AQMMap::resolution(const QRectF &rect)
|
||||||
{
|
{
|
||||||
const Zoom &z = _zooms.at(_zoom);
|
const Zoom &z = _zooms.at(_zoom);
|
||||||
return OSM::resolution(rect.center(), z.zoom, z.tileSize);
|
return OSM::resolution(rect.center(), z.zoom, tileSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
int AQMMap::zoomIn()
|
int AQMMap::zoomIn()
|
||||||
|
@ -128,7 +128,7 @@ GEMFMap::GEMFMap(const QString &fileName, QObject *parent)
|
|||||||
|
|
||||||
qreal GEMFMap::resolution(const QRectF &rect)
|
qreal GEMFMap::resolution(const QRectF &rect)
|
||||||
{
|
{
|
||||||
return OSM::resolution(rect.center(), _zooms.at(_zi).level, _tileSize);
|
return OSM::resolution(rect.center(), _zooms.at(_zi).level, tileSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
int GEMFMap::zoomFit(const QSize &size, const RectC &rect)
|
int GEMFMap::zoomFit(const QSize &size, const RectC &rect)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "osm.h"
|
#include "osm.h"
|
||||||
#include "mbtilesmap.h"
|
#include "mbtilesmap.h"
|
||||||
|
|
||||||
#define MAX_OVERZOOM 3
|
#define MAX_TILE_SIZE 4096
|
||||||
#define META_TYPE(type) static_cast<QMetaType::Type>(type)
|
#define META_TYPE(type) static_cast<QMetaType::Type>(type)
|
||||||
|
|
||||||
static RectC str2bounds(const QString &str)
|
static RectC str2bounds(const QString &str)
|
||||||
@ -79,24 +79,15 @@ bool MBTilesMap::getZooms()
|
|||||||
" WHERE zoom_level = %1 LIMIT 1").arg(i);
|
" WHERE zoom_level = %1 LIMIT 1").arg(i);
|
||||||
QSqlQuery query(sql, _db);
|
QSqlQuery query(sql, _db);
|
||||||
if (query.first())
|
if (query.first())
|
||||||
_zooms.append(Zoom(i, i));
|
_zoomsBase.append(Zoom(i, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_zooms.size()) {
|
if (!_zoomsBase.size()) {
|
||||||
_errorString = "Empty tile set";
|
_errorString = "Empty tile set";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_scalable) {
|
_zi = _zoomsBase.size() - 1;
|
||||||
for (int i = _zooms.last().base + 1; i <= OSM::ZOOMS.max(); i++) {
|
|
||||||
Zoom z(i, _zooms.last().base);
|
|
||||||
if (z.z - z.base > MAX_OVERZOOM)
|
|
||||||
break;
|
|
||||||
_zooms.append(Zoom(i, _zooms.last().base));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_zi = _zooms.size() - 1;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -114,7 +105,7 @@ bool MBTilesMap::getBounds()
|
|||||||
} else {
|
} else {
|
||||||
qWarning("%s: missing bounds metadata", qPrintable(path()));
|
qWarning("%s: missing bounds metadata", qPrintable(path()));
|
||||||
|
|
||||||
int z = _zooms.first().z;
|
int z = _zoomsBase.first().z;
|
||||||
QString sql = QString("SELECT min(tile_column), min(tile_row), "
|
QString sql = QString("SELECT min(tile_column), min(tile_row), "
|
||||||
"max(tile_column), max(tile_row) FROM tiles WHERE zoom_level = %1")
|
"max(tile_column), max(tile_row) FROM tiles WHERE zoom_level = %1")
|
||||||
.arg(z);
|
.arg(z);
|
||||||
@ -222,12 +213,12 @@ MBTilesMap::MBTilesMap(const QString &fileName, QObject *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTileFormat();
|
getTileFormat();
|
||||||
|
if (!getTileSize())
|
||||||
|
return;
|
||||||
if (!getZooms())
|
if (!getZooms())
|
||||||
return;
|
return;
|
||||||
if (!getBounds())
|
if (!getBounds())
|
||||||
return;
|
return;
|
||||||
if (!getTileSize())
|
|
||||||
return;
|
|
||||||
getTilePixelRatio();
|
getTilePixelRatio();
|
||||||
getName();
|
getName();
|
||||||
|
|
||||||
@ -243,10 +234,18 @@ void MBTilesMap::load(const Projection &in, const Projection &out,
|
|||||||
Q_UNUSED(out);
|
Q_UNUSED(out);
|
||||||
|
|
||||||
_mapRatio = hidpi ? deviceRatio : 1.0;
|
_mapRatio = hidpi ? deviceRatio : 1.0;
|
||||||
|
_zooms = _zoomsBase;
|
||||||
|
|
||||||
if (_scalable) {
|
if (_scalable) {
|
||||||
_scaledSize = _tileSize * deviceRatio;
|
_scaledSize = _tileSize * deviceRatio;
|
||||||
_tileRatio = deviceRatio;
|
_tileRatio = deviceRatio;
|
||||||
|
|
||||||
|
for (int i = _zooms.last().base + 1; i <= OSM::ZOOMS.max(); i++) {
|
||||||
|
Zoom z(i, _zooms.last().base);
|
||||||
|
if (_tileSize * _tileRatio * (1U<<(z.z - z.base)) > MAX_TILE_SIZE)
|
||||||
|
break;
|
||||||
|
_zooms.append(Zoom(i, _zooms.last().base));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_db.open();
|
_db.open();
|
||||||
@ -286,7 +285,7 @@ int MBTilesMap::zoomFit(const QSize &size, const RectC &rect)
|
|||||||
|
|
||||||
qreal MBTilesMap::resolution(const QRectF &rect)
|
qreal MBTilesMap::resolution(const QRectF &rect)
|
||||||
{
|
{
|
||||||
return OSM::resolution(rect.center(), _zooms.at(_zi).z, _tileSize);
|
return OSM::resolution(rect.center(), _zooms.at(_zi).z, tileSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
int MBTilesMap::zoomIn()
|
int MBTilesMap::zoomIn()
|
||||||
|
@ -146,7 +146,7 @@ private:
|
|||||||
|
|
||||||
QString _name;
|
QString _name;
|
||||||
RectC _bounds;
|
RectC _bounds;
|
||||||
QVector<Zoom> _zooms;
|
QVector<Zoom> _zooms, _zoomsBase;
|
||||||
int _zi;
|
int _zi;
|
||||||
int _tileSize;
|
int _tileSize;
|
||||||
qreal _mapRatio, _tileRatio;
|
qreal _mapRatio, _tileRatio;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "onlinemap.h"
|
#include "onlinemap.h"
|
||||||
|
|
||||||
|
|
||||||
#define MAX_OVERZOOM 3
|
#define MAX_TILE_SIZE 4096
|
||||||
|
|
||||||
OnlineMap::OnlineMap(const QString &fileName, const QString &name,
|
OnlineMap::OnlineMap(const QString &fileName, const QString &name,
|
||||||
const QString &url, const Range &zooms, const RectC &bounds, qreal tileRatio,
|
const QString &url, const Range &zooms, const RectC &bounds, qreal tileRatio,
|
||||||
@ -24,10 +24,7 @@ OnlineMap::OnlineMap(const QString &fileName, const QString &name,
|
|||||||
_tileLoader->setHeaders(headers);
|
_tileLoader->setHeaders(headers);
|
||||||
connect(_tileLoader, &TileLoader::finished, this, &OnlineMap::tilesLoaded);
|
connect(_tileLoader, &TileLoader::finished, this, &OnlineMap::tilesLoaded);
|
||||||
|
|
||||||
if (_scalable) {
|
_baseZoom = _zooms.max();
|
||||||
_baseZoom = _zooms.max();
|
|
||||||
_zooms.setMax(qMin(_zooms.max() + MAX_OVERZOOM, OSM::ZOOMS.max()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF OnlineMap::bounds()
|
QRectF OnlineMap::bounds()
|
||||||
@ -61,7 +58,7 @@ int OnlineMap::zoomFit(const QSize &size, const RectC &rect)
|
|||||||
|
|
||||||
qreal OnlineMap::resolution(const QRectF &rect)
|
qreal OnlineMap::resolution(const QRectF &rect)
|
||||||
{
|
{
|
||||||
return OSM::resolution(rect.center(), _zoom, _tileSize);
|
return OSM::resolution(rect.center(), _zoom, tileSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
int OnlineMap::zoomIn()
|
int OnlineMap::zoomIn()
|
||||||
@ -87,10 +84,17 @@ void OnlineMap::load(const Projection &in, const Projection &out,
|
|||||||
Q_UNUSED(out);
|
Q_UNUSED(out);
|
||||||
|
|
||||||
_mapRatio = hidpi ? deviceRatio : 1.0;
|
_mapRatio = hidpi ? deviceRatio : 1.0;
|
||||||
|
_zooms.setMax(_baseZoom);
|
||||||
|
|
||||||
if (_scalable) {
|
if (_scalable) {
|
||||||
_scaledSize = _tileSize * deviceRatio;
|
_scaledSize = _tileSize * deviceRatio;
|
||||||
_tileRatio = deviceRatio;
|
_tileRatio = deviceRatio;
|
||||||
|
|
||||||
|
for (int i = _baseZoom + 1; i <= OSM::ZOOMS.max(); i++) {
|
||||||
|
if (_tileSize * _tileRatio * (1U<<(i - _baseZoom)) > MAX_TILE_SIZE)
|
||||||
|
break;
|
||||||
|
_zooms.setMax(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +172,7 @@ void OnlineMap::cancelJobs(bool wait)
|
|||||||
|
|
||||||
void OnlineMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
void OnlineMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
||||||
{
|
{
|
||||||
int baseZoom = _scalable ? qMin(_baseZoom, _zoom) : _zoom;
|
int baseZoom = qMin(_baseZoom, _zoom);
|
||||||
unsigned overzoom = _zoom - baseZoom;
|
unsigned overzoom = _zoom - baseZoom;
|
||||||
unsigned f = 1U<<overzoom;
|
unsigned f = 1U<<overzoom;
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ int OsmdroidMap::zoomFit(const QSize &size, const RectC &rect)
|
|||||||
|
|
||||||
qreal OsmdroidMap::resolution(const QRectF &rect)
|
qreal OsmdroidMap::resolution(const QRectF &rect)
|
||||||
{
|
{
|
||||||
return OSM::resolution(rect.center(), _zoom, _tileSize);
|
return OSM::resolution(rect.center(), _zoom, tileSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
int OsmdroidMap::zoomIn()
|
int OsmdroidMap::zoomIn()
|
||||||
|
@ -146,7 +146,7 @@ int SqliteMap::zoomFit(const QSize &size, const RectC &rect)
|
|||||||
|
|
||||||
qreal SqliteMap::resolution(const QRectF &rect)
|
qreal SqliteMap::resolution(const QRectF &rect)
|
||||||
{
|
{
|
||||||
return OSM::resolution(rect.center(), _zoom, _tileSize);
|
return OSM::resolution(rect.center(), _zoom, tileSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
int SqliteMap::zoomIn()
|
int SqliteMap::zoomIn()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user