Move the coordinate <-> item position conversion to QGeoProjection
This patch simplifies the QGeoMap API removing all the API
necessary to convert to and from screen.
This is now demanded to a specific QGeoProjection class, that will
be independent of the map, except for using the same Geo projection
(currently only WebMercator, or EPSG:3857, although we use a sphere
instead of an ellipsoid, i believe)
The benefits are
- This relieves subclasses of QGeoMap from implementing a
GeoProjection API, especially since QtLocation currently supports
only WebMercator, and reimplementations would have to anyway
produce the same results as the inbuilt one.
- This avoids the several indirection steps previously necessary
to perform a map projection (qgeotiledmap -> private->mapscene->
private). Since these operation are quite frequent one per
map item coordinate at every redraw, shortening the indirection
chain is beneficial
- It simplifies the highly complex QGeoTiledMapScene, separating
all the logic that is not needed to draw the scene, but only
to perform geo coordinate <-> screen coordinate conversion
Change-Id: I9e3ca5280166f2d6430a32deb44c030d02d9d4e1
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| commit | 762dc9dd2b47f908c3739173aa1e108dd7386717 |
| parent | 45b1f2c23cf0e782c0b99f38e4d01a88da765753 |
| author | Paolo Angelelli <paolo.angelelli@qt.io> |
| committer | Paolo Angelelli <paolo.angelelli@qt.io> |
| commit time | Mon, 16 Jan 2017 16:18:27 +0000 |
- M src/imports/location/qdeclarativecirclemapitem.cpp
- M src/imports/location/qdeclarativegeomap.cpp
- M src/imports/location/qdeclarativegeomapitembase.cpp
- M src/imports/location/qdeclarativegeomapquickitem.cpp
- M src/imports/location/qdeclarativepolygonmapitem.cpp
- M src/imports/location/qdeclarativepolylinemapitem.cpp
- M src/imports/location/qdeclarativerectanglemapitem.cpp
- M src/imports/location/qgeomapitemgeometry.cpp
- M src/imports/location/qquickgeomapgesturearea.cpp
- M src/location/maps/maps.pri
- M src/location/maps/qgeocameradata_p.h
- M src/location/maps/qgeomap.cpp
- M src/location/maps/qgeomap_p.h
- M src/location/maps/qgeomap_p_p.h
- A src/location/maps/qgeoprojection.cpp
- A src/location/maps/qgeoprojection_p.h
- M src/location/maps/qgeotiledmap.cpp
- M src/location/maps/qgeotiledmap_p.h
- M src/location/maps/qgeotiledmap_p_p.h
- M src/location/maps/qgeotiledmapscene.cpp
- M src/location/maps/qgeotiledmapscene_p.h
- M tests/auto/qgeocameradata/qgeocameradata.pro
- M tests/auto/qgeocameratiles/qgeocameratiles.pro
- M tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp
- M tests/auto/qgeotiledmapscene/qgeotiledmapscene.pro
- M tests/auto/qgeotiledmapscene/tst_qgeotiledmapscene.cpp