The QGeoMapData class are used as a bridge between QGraphicsGeoMap and QGeoMappingManager. More...
#include <QGeoMapData>
Inherited by QGeoTiledMapData.
QGeoMapData ( QGeoMappingManagerEngine * engine, QGraphicsGeoMap * geoMap ) | |
virtual | ~QGeoMapData () |
void | addMapObject ( QGeoMapObject * mapObject ) |
void | addMapOverlay ( QGeoMapOverlay * overlay ) |
void | associateMapObject ( QGeoMapObject * mapObject ) |
virtual QGeoCoordinate | center () const |
void | clearMapObjects () |
void | clearMapOverlays () |
virtual QPointF | coordinateToScreenPosition ( const QGeoCoordinate & coordinate ) const = 0 |
QList<QGeoMapObject *> | mapObjects () const |
virtual QList<QGeoMapObject *> | mapObjectsAtScreenPosition ( const QPointF & screenPosition ) |
virtual QList<QGeoMapObject *> | mapObjectsInScreenRect ( const QRectF & screenRect ) |
QList<QGeoMapOverlay *> | mapOverlays () const |
virtual QGraphicsGeoMap::MapType | mapType () const |
virtual void | paint ( QPainter * painter, const QStyleOptionGraphicsItem * option ) |
virtual void | pan ( int dx, int dy ) |
void | removeMapObject ( QGeoMapObject * mapObject ) |
void | removeMapOverlay ( QGeoMapOverlay * overlay ) |
virtual QGeoCoordinate | screenPositionToCoordinate ( const QPointF & screenPosition ) const = 0 |
virtual void | setCenter ( const QGeoCoordinate & center ) |
virtual void | setMapType ( QGraphicsGeoMap::MapType mapType ) |
virtual void | setViewportSize ( const QSizeF & size ) |
virtual void | setZoomLevel ( qreal zoomLevel ) |
virtual QSizeF | viewportSize () const |
virtual qreal | zoomLevel () const |
QGeoMapObject * | containerObject () |
virtual QGeoMapObjectInfo * | createMapObjectInfo ( QGeoMapObject * object ) |
QGeoMappingManagerEngine * | engine () const |
QGraphicsGeoMap * | geoMap () const |
The QGeoMapData class are used as a bridge between QGraphicsGeoMap and QGeoMappingManager.
Instances of QGeoMapData are created with QGeoMappingManager::createMapData(), and are used internally by QGraphicsGeoMap to manage the state of the map and the associated QGeoMapObject instances.
Plugin implementers will need to provide implementations of coordinateToScreenPosition(const QGeoCoordinate &coordinate) and QGeoCoordinate screenPositionToCoordinate(const QPointF &screenPosition).
The other virtual functions can be overriden. If the screen position to coordinate tranformations are expensive then overriding these functions may allow optimizations based on caching parts of the geometry information.
Subclasses should override createMapObjecInfo() so that QGeoMapObjectInfo instances will be created for each QGeoMapObject type in order to provide the QGeoMapData subclass specific behaviours for the map objects.
Constructs a new map data object, which stores the map data required by geoMap and makes use of the functionality provided by engine.
Destroys this map data object.
Adds mapObject to the list of map objects managed by this map.
The children objects are drawn in order of the QGeoMapObject::zValue() value. Children objects having the same z value will be drawn in the order they were added.
The map will take ownership of the mapObject.
Adds overlay to the list of map overlays associated with this map.
The overlays will be drawn in the order in which they were added.
The map will take ownership of overlay.
Sets up the associated between the map object mapObject and this map.
This will setup an instance of a QGeoMapObjectInfo subclass for mapObject which will handle any of the map object behaviour which is specifical to this QGeoMapData subclass.
This function uses createMapObjectInfo as a factory for the QGeoMapObjectInfo instance, and so subclasses should reimplement createMapObjectInfo to create the appropriate QGeoMapObjectInfo objects.
Returns the coordinate of the point in the center of the map viewport.
See also setCenter().
Clears the map objects associated with this map.
The map objects will be deleted.
Clears the map overlays associated with this map.
The map overlays will be deleted.
Returns the QGeoMapObject which acts as the parent to all QGeoMapObject instances which are added to the map by the user.
Returns the position on the screen at which coordinate is displayed.
An invalid QPointF will be returned if coordinate is invalid or is not within the current viewport.
Creates a QGeoMapObjectInfo instance which implements the behaviours of the map object object which are specific to this QGeoMapData.
The default implementation returns 0.
Returns the mapping engine that this map data object is associated with.
Returns the QGraphicsGeoMap instance that this map data object is associated with.
Returns the map objects associated with this map.
Returns the list of map objects managed by this map which contain the point screenPosition within their boundaries.
Returns the list of map objects managed by this map which are displayed at least partially within the on screen rectangle screenRect.
Returns the map overlays associated with this map.
Returns the type of map data which is being displayed.
See also setMapType().
Paints the map on painter, using the options option.
This should handle the painting of the map overlays and the map objects as well.
The default implementation just draws the overlays.
Pans the map view dx pixels in the x direction and dy pixels in the y direction.
The x and y axes are specified in Graphics View Framework coordinates. By default this will mean that positive values of dx move the viewed area to the right and that positive values of dy move the viewed area down.
Removes mapObject from the list of map objects managed by this map. The map will release ownership of the mapObject.
Removes overlay from the list of map overlays associated with this map.
The map will release ownership of overlay.
Returns the coordinate corresponding to the point in the viewport at screenPosition.
An invalid QGeoCoordinate will be returned if screenPosition is invalid or is not within the current viewport.
Centers the map viewport on the coordinate center.
See also center().
Changes the type of map data to display to mapType.
See also mapType().
Sets the size of the map viewport to size.
The size will be adjusted by the associated QGraphicsGeoMap as it resizes.
See also viewportSize().
Sets the zoom level of the map to zoomLevel.
Larger values of the zoom level correspond to more detailed views of the map.
If zoomLevel is less than minimumZoomLevel() then minimumZoomLevel() will be used, and if zoomLevel is larger than maximumZoomLevel() then maximumZoomLevel() will be used.
See also zoomLevel().
Returns the size of the map viewport.
The size will be adjusted by the associated QGraphicsGeoMap as it resizes.
See also setViewportSize().
Returns the zoom level of the map.
Larger values of the zoom level correspond to more detailed views of the map.
See also setZoomLevel().