From 361bb262127eb17e41841a5d694a8c6f16106f68 Mon Sep 17 00:00:00 2001 From: Kevin Finisterre Date: Thu, 14 May 2015 01:47:55 -0400 Subject: [PATCH] attempt to get Pergo Turkish maps working. Still buggy. Unable to search and auto zoom. Initial map render works mostly --- .../src/libs/opmapcontrol/src/core/urlfactory.cpp | 10 +++++++--- .../src/libs/opmapcontrol/src/internals/core.cpp | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/urlfactory.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/urlfactory.cpp index a1c2867eb..8bcb5101b 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/urlfactory.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/urlfactory.cpp @@ -73,6 +73,8 @@ QString UrlFactory::TileXYToQuadKey(const int &tileX, const int &tileY, const in } int UrlFactory::GetServerNum(const Point &pos, const int &max) const { + qDebug() << QString("%1").arg(pos.X()); + qDebug() << QString("%1").arg(pos.Y()); return (pos.X() + 2 * pos.Y()) % max; } void UrlFactory::setIsCorrectGoogleVersions(bool value) @@ -475,9 +477,11 @@ QString UrlFactory::MakeImageUrl(const MapType::Types &type, const Point &pos, c QString y = QString("%1").arg(QString::number(pos.Y()), 9, (QChar)'0'); y.insert(3, "/").insert(7, "/"); // "http://map03.pergo.com.tr/tile/2/000/000/003/000/000/002.png" - // This has changed map03 does not exist. (neither does map3) Servers have changed to map1 and map2? - qDebug() << QString("http://map%1.pergo.com.tr/tile/%2/%3/%4.png").arg(GetServerNum(pos, 4)).arg(zoom, 2, 10, (QChar)'0').arg(x).arg(y); - return QString("http://map%1.pergo.com.tr/tile/%2/%3/%4.png").arg(GetServerNum(pos, 4)).arg(zoom, 2, 10, (QChar)'0').arg(x).arg(y); + // This has changed map03 does not exist. (neither does map3) Servers have changed to map1 and map2 or maps? + + qDebug() << QString("http://maps.pergo.com.tr/tile/%1/%2/%3.png").arg(zoom, 2, 10, (QChar)'0').arg(x).arg(y); + return QString("http://maps.pergo.com.tr/tile/%1/%2/%3.png").arg(zoom, 2, 10, (QChar)'0').arg(x).arg(y); + } break; case MapType::SigPacSpainMap: diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/core.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/core.cpp index b3d48c00a..ea0e98d84 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/core.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/internals/core.cpp @@ -295,7 +295,7 @@ void Core::SetMapType(const MapType::Types &value) { if (Projection()->Type() != "PlateCarreeProjectionPergo") { SetProjection(new PlateCarreeProjectionPergo()); - maxzoom = 17; + maxzoom = 18; } } break;