Custom Qt 5.0 Location geoservices plugin with QREAL/DOUBLE zoomLevel and bearing support
-
Hi All.
I'm working on custom tiled map plugin that load tiles from local hard drive. This map should animate zoomLevel changes and support bearing (rotation around the map center).
How it can be done? I found that private QGeoMapScene and QGeoTiledMapData classes use INT zoomLevel and doesn't support bearing. But I need these features ASAP and can't wait for Qt 5.0/5.1 release. I'm using Nokia geoservices plugin as an example.
Thanks!
-
Is this running in Widgets or Quick gui? In QtQuick, you can easily get zoom and bearing using scale and transform properties.
-
I'm using QtQuick. Scale and rotation transformations are no so smooth as we want. Sometimes there are jitters appear.
-
That depends a bit on settings, and whether you are using Qt Quick 1 or 2. If you are using QML2, and experience the jitter, then you should consider checking out threaded scenegraph experiment: "link":http://labs.qt.nokia.com/2012/08/20/render-thread-animations-in-qt-quick-2-0/.
-
sierdzio, thanks for your replies!
I'm using Quick 2 and will go on with default Tile based classes and will use scale and rotation of Map component itself. If I'll way to use double zoom and bearing I'll write about it :)
-
Two types are used for zoom level in Qt Location. Public API classes use double, allowing applications to zoom to any level. Internally integers are used as a tile based mapping service will have a discrete set zoom levels that it provides pre-rendered tiles for. For non-integer zoom levels the tiles are transformed as necessary.
-
Thank all! I found manual changing of rotation and scale is quite enough. But I have "another question about map component":http://qt-project.org/forums/viewthread/20107/.