summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeocameratiles.cpp
diff options
context:
space:
mode:
authorDavid Laing <david.laing@nokia.com>2012-02-01 15:16:28 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-02 07:34:20 +0100
commit8981b5a525849718c1ba601da2ad7478c15b5702 (patch)
treebd39b6baab25a1f19f4ad1d60ea5497ec86059bb /src/location/maps/qgeocameratiles.cpp
parentbbacf2e03133f014cd7edf0bc9110714d00e37f8 (diff)
downloadqtlocation-8981b5a525849718c1ba601da2ad7478c15b5702.tar.gz
Cleans up the projection code.
There was no longer any point in providing the screen <-> 3d scene position functions, which meant that the projection class was just doing coordinate <-> mercator conversions and intepolating coordinates. The interpolation code was moved out and the mercator conversions were made static. We have future changes coming which will allow people who want different projections to provide them, so it's not to big a deal to specialize the class towards the mercator projection. There were some other small changes made which make the map actually pay attention to the size of the tiles and the maximum zoom level as per the plugin. Actually enforcing the tilt / bearing / zoom parameters will appear in a separate commit before very long. Change-Id: I31dc39165bde123fbe8e3e2e70e401c5d73932b3 Reviewed-by: Alex Wilson <alex.wilson@nokia.com>
Diffstat (limited to 'src/location/maps/qgeocameratiles.cpp')
-rw-r--r--src/location/maps/qgeocameratiles.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/location/maps/qgeocameratiles.cpp b/src/location/maps/qgeocameratiles.cpp
index 0cca35b9..73e40a22 100644
--- a/src/location/maps/qgeocameratiles.cpp
+++ b/src/location/maps/qgeocameratiles.cpp
@@ -72,10 +72,9 @@ typedef QVector<QDoubleVector3D> Polygon;
class QGeoCameraTilesPrivate {
public:
- QGeoCameraTilesPrivate(QSharedPointer<QGeoProjection> projection);
+ QGeoCameraTilesPrivate();
~QGeoCameraTilesPrivate();
- QSharedPointer<QGeoProjection> projection_;
QString pluginString_;
QGeoMapType mapType_;
QGeoCameraData camera_;
@@ -125,8 +124,8 @@ public:
};
};
-QGeoCameraTiles::QGeoCameraTiles(QSharedPointer<QGeoProjection> projection)
- : d_ptr(new QGeoCameraTilesPrivate(projection)) {}
+QGeoCameraTiles::QGeoCameraTiles()
+ : d_ptr(new QGeoCameraTilesPrivate()) {}
QGeoCameraTiles::~QGeoCameraTiles()
{
@@ -211,8 +210,7 @@ QPair<QSet<QGeoTileSpec>, QSet<QGeoTileSpec> > QGeoCameraTiles::tilesSplitByDate
return QPair<QSet<QGeoTileSpec>, QSet<QGeoTileSpec> >(d->tilesLeft_, d->tilesRight_);
}
-QGeoCameraTilesPrivate::QGeoCameraTilesPrivate(QSharedPointer<QGeoProjection> projection)
- : projection_(projection) {}
+QGeoCameraTilesPrivate::QGeoCameraTilesPrivate() {}
QGeoCameraTilesPrivate::~QGeoCameraTilesPrivate() {}
@@ -292,7 +290,7 @@ Frustum QGeoCameraTilesPrivate::frustum() const
{
int zpow2 = 1 << camera_.zoomLevel();
- QDoubleVector3D center = zpow2 * projection_->coordToMercator(camera_.center());
+ QDoubleVector3D center = zpow2 * QGeoProjection::coordToMercator(camera_.center());
center.setZ(0.0);
double f = qMin(screenSize_.width(), screenSize_.height()) / (1.0 * tileSize_);