QtMobility Reference Documentation

QGeoTiledMapData Class Reference

The QGeoTiledMapData class is a subclass of QGeoMapData provided to make working with tile based mapping services more convenient. More...

 #include <QGeoTiledMapData>

Inherits: QGeoMapData.

This class was introduced in Qt Mobility 1.1.

Public Functions

QGeoTiledMapData ( QGeoMappingManagerEngine * engine )
virtual ~QGeoTiledMapData ()
virtual QPoint coordinateToWorldReferencePosition ( const QGeoCoordinate & coordinate ) const
void triggerUpdateMapDisplay ( const QRectF & target = QRectF() )
virtual QGeoCoordinate worldReferencePositionToCoordinate ( const QPoint & pixel ) const
QSize worldReferenceSize () const
QPoint worldReferenceViewportCenter () const
QRect worldReferenceViewportRect () const
int zoomFactor () const

Reimplemented Public Functions

virtual QGeoCoordinate center () const
virtual QPointF coordinateToScreenPosition ( const QGeoCoordinate & coordwgs ) const
virtual void fitInViewport ( const QGeoBoundingBox & bounds, bool preserveViewportCenter = false )
virtual QList<QGeoMapObject *> mapObjectsAtScreenPosition ( const QPointF & screenPosition ) const
virtual QList<QGeoMapObject *> mapObjectsInScreenRect ( const QRectF & screenRect ) const
virtual void pan ( int dx, int dy )
virtual QGeoCoordinate screenPositionToCoordinate ( const QPointF & screenPosition ) const
virtual void setCenter ( const QGeoCoordinate & center )
virtual void setConnectivityMode ( QGraphicsGeoMap::ConnectivityMode connectivityMode )
virtual void setMapType ( QGraphicsGeoMap::MapType mapType )
virtual void setWindowSize ( const QSizeF & size )
virtual void setZoomLevel ( qreal zoomLevelf )
virtual QGeoBoundingBox viewport () const
  • 36 public functions inherited from QGeoMapData
  • 29 public functions inherited from QObject

Reimplemented Protected Functions

virtual QGeoMapObjectInfo * createMapObjectInfo ( QGeoMapObject * mapObject )
virtual void paintMap ( QPainter * painter, const QStyleOptionGraphicsItem * option )
virtual void paintObjects ( QPainter * painter, const QStyleOptionGraphicsItem * option )
  • 7 protected functions inherited from QGeoMapData
  • 7 protected functions inherited from QObject

Additional Inherited Members

Detailed Description

The QGeoTiledMapData class is a subclass of QGeoMapData provided to make working with tile based mapping services more convenient.

This class assumes that at a zoom level of z the world is represented as a 2^z by 2^z grid of tiles, and that the Mercator projection is used to map back and forth between coordinate and positions on the map.

Different projections can be provided by reimplementing coordinateToWorldReferencePosition() and worldReferencePositionToCoordinate().

Many of the internal calculations deal with positions as though they are pixel positions on the map at the maximum zoom level. Several functions are provided which expose information about the map and the viewport onto the map in these terms for use with custom QGeoMapObjectInfo subclasses.

These functions include worldReferenceViewportCenter(), worldReferenceSize() and worldReferenceViewportRect().

NOTE: QGeoTiledMapData blocks property change signals from QGeoMapData by calling QGeoMapData::setBlockPropertyChangeSignals() with true. Changing this in QGeoTiledMapData subclasses will cause the signals being emitted at wrong time.

Member Function Documentation

QGeoTiledMapData::QGeoTiledMapData ( QGeoMappingManagerEngine * engine )

Constructs a new tiled map data object, which makes use of the functionality provided by engine.

QGeoTiledMapData::~QGeoTiledMapData () [virtual]

Destroys this tiled map data object.

QGeoCoordinate QGeoTiledMapData::center () const [virtual]

Reimplemented from QGeoMapData::center().

This function was introduced in Qt Mobility 1.1.

See also setCenter().

QPointF QGeoTiledMapData::coordinateToScreenPosition ( const QGeoCoordinate & coordwgs ) const [virtual]

Reimplemented from QGeoMapData::coordinateToScreenPosition().

This function was introduced in Qt Mobility 1.1.

QPoint QGeoTiledMapData::coordinateToWorldReferencePosition ( const QGeoCoordinate & coordinate ) const [virtual]

Converts the coordinate coordinate to a pixel position on the entire map at the maximum zoom level.

The default implementation is based on the Mercator projection.

This function was introduced in Qt Mobility 1.1.

QGeoMapObjectInfo * QGeoTiledMapData::createMapObjectInfo ( QGeoMapObject * mapObject ) [virtual protected]

Reimplemented from QGeoMapData::createMapObjectInfo().

This function was introduced in Qt Mobility 1.1.

void QGeoTiledMapData::fitInViewport ( const QGeoBoundingBox & bounds, bool preserveViewportCenter = false ) [virtual]

Reimplemented from QGeoMapData::fitInViewport().

This function was introduced in Qt Mobility 1.1.

QList<QGeoMapObject *> QGeoTiledMapData::mapObjectsAtScreenPosition ( const QPointF & screenPosition ) const [virtual]

Reimplemented from QGeoMapData::mapObjectsAtScreenPosition().

This function was introduced in Qt Mobility 1.1.

QList<QGeoMapObject *> QGeoTiledMapData::mapObjectsInScreenRect ( const QRectF & screenRect ) const [virtual]

Reimplemented from QGeoMapData::mapObjectsInScreenRect().

This function was introduced in Qt Mobility 1.1.

void QGeoTiledMapData::paintMap ( QPainter * painter, const QStyleOptionGraphicsItem * option ) [virtual protected]

Reimplemented from QGeoMapData::paintMap().

This function was introduced in Qt Mobility 1.1.

void QGeoTiledMapData::paintObjects ( QPainter * painter, const QStyleOptionGraphicsItem * option ) [virtual protected]

Reimplemented from QGeoMapData::paintObjects().

This function was introduced in Qt Mobility 1.1.

void QGeoTiledMapData::pan ( int dx, int dy ) [virtual]

Reimplemented from QGeoMapData::pan().

This function was introduced in Qt Mobility 1.1.

QGeoCoordinate QGeoTiledMapData::screenPositionToCoordinate ( const QPointF & screenPosition ) const [virtual]

Reimplemented from QGeoMapData::screenPositionToCoordinate().

This function was introduced in Qt Mobility 1.1.

void QGeoTiledMapData::setCenter ( const QGeoCoordinate & center ) [virtual]

Reimplemented from QGeoMapData::setCenter().

This function was introduced in Qt Mobility 1.1.

See also center().

void QGeoTiledMapData::setConnectivityMode ( QGraphicsGeoMap::ConnectivityMode connectivityMode ) [virtual]

Reimplemented from QGeoMapData::setConnectivityMode().

void QGeoTiledMapData::setMapType ( QGraphicsGeoMap::MapType mapType ) [virtual]

Reimplemented from QGeoMapData::setMapType().

This function was introduced in Qt Mobility 1.1.

void QGeoTiledMapData::setWindowSize ( const QSizeF & size ) [virtual]

Reimplemented from QGeoMapData::setWindowSize().

This function was introduced in Qt Mobility 1.1.

void QGeoTiledMapData::setZoomLevel ( qreal zoomLevelf ) [virtual]

Reimplemented from QGeoMapData::setZoomLevel().

This function was introduced in Qt Mobility 1.1.

void QGeoTiledMapData::triggerUpdateMapDisplay ( const QRectF & target = QRectF() )

Forces the map display to update in the region specified by target.

If target is empty the entire map display will be updated.

This function was introduced in Qt Mobility 1.1.

QGeoBoundingBox QGeoTiledMapData::viewport () const [virtual]

Reimplemented from QGeoMapData::viewport().

This function was introduced in Qt Mobility 1.1.

QGeoCoordinate QGeoTiledMapData::worldReferencePositionToCoordinate ( const QPoint & pixel ) const [virtual]

Converts the pixel position pixel on the map to a coordinate.

The pixel position is relative the entire map at the maximum zoom level.

The default implementation is based on the Mercator projection.

This function was introduced in Qt Mobility 1.1.

QSize QGeoTiledMapData::worldReferenceSize () const

Returns the size, in pixels, of the entire map as a pixmap at the maximum zoom level.

This function was introduced in Qt Mobility 1.1.

QPoint QGeoTiledMapData::worldReferenceViewportCenter () const

Returns the center of the viewport, in pixels on the entire map as a pixmap at the maximum zoom level.

This function was introduced in Qt Mobility 1.1.

QRect QGeoTiledMapData::worldReferenceViewportRect () const

Returns the visible screen rectangle, in pixels on the entire map as a pixmap at the maximum zoom level.

This function was introduced in Qt Mobility 1.1.

int QGeoTiledMapData::zoomFactor () const

Returns the ratio between a single pixel on the screen and a pixel on the entire map as a pixmap at the maximum zoom level.

This function was introduced in Qt Mobility 1.1.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.