Qt Mobility 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.

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 & coordinate ) 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 setMapType ( QGraphicsGeoMap::MapType mapType )
virtual void setWindowSize ( const QSizeF & size )
virtual void setZoomLevel ( qreal zoomLevel )
virtual QGeoBoundingBox viewport () const
  • 28 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().

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().

See also setCenter().

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

Reimplemented from QGeoMapData::coordinateToScreenPosition().

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.

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

Reimplemented from QGeoMapData::createMapObjectInfo().

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

Reimplemented from QGeoMapData::fitInViewport().

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

Reimplemented from QGeoMapData::mapObjectsAtScreenPosition().

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

Reimplemented from QGeoMapData::mapObjectsInScreenRect().

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

Reimplemented from QGeoMapData::paintMap().

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

Reimplemented from QGeoMapData::paintObjects().

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

Reimplemented from QGeoMapData::pan().

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

Reimplemented from QGeoMapData::screenPositionToCoordinate().

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

Reimplemented from QGeoMapData::setCenter().

See also center().

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

Reimplemented from QGeoMapData::setMapType().

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

Reimplemented from QGeoMapData::setWindowSize().

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

Reimplemented from QGeoMapData::setZoomLevel().

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.

QGeoBoundingBox QGeoTiledMapData::viewport () const [virtual]

Reimplemented from QGeoMapData::viewport().

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.

QSize QGeoTiledMapData::worldReferenceSize () const

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

QPoint QGeoTiledMapData::worldReferenceViewportCenter () const

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

QRect QGeoTiledMapData::worldReferenceViewportRect () const

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

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.

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.