QGeoMapData Class ReferenceThe QGeoMapData class are used as a bridge between QGraphicsGeoMap and QGeoMappingManager. More... #include <QGeoMapData> Inherits QObject. Inherited by QGeoTiledMapData. Properties
Public Functions
Signals
Protected Functions
Additional Inherited Members
Detailed DescriptionThe 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 overridden. 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 createMapObjectInfo() so that QGeoMapObjectInfo instances will be created for each QGeoMapObject type in order to provide the QGeoMapData subclass specific behaviours for the map objects. Property Documentation
|
virtual QGeoCoordinate | center () const |
virtual void | setCenter ( const QGeoCoordinate & center ) |
Notifier signal:
void | centerChanged ( const QGeoCoordinate & coordinate ) |
Returns the connectivity mode for this map.
Access functions:
virtual QGraphicsGeoMap::ConnectivityMode | connectivityMode () const |
virtual void | setConnectivityMode ( QGraphicsGeoMap::ConnectivityMode connectivityMode ) |
Notifier signal:
void | connectivityModeChanged ( QGraphicsGeoMap::ConnectivityMode connectivityMode ) |
Returns the type of map data which is being displayed.
Access functions:
virtual QGraphicsGeoMap::MapType | mapType () const |
virtual void | setMapType ( QGraphicsGeoMap::MapType mapType ) |
Notifier signal:
void | mapTypeChanged ( QGraphicsGeoMap::MapType mapType ) |
Returns the size of the map viewport.
The size will be adjusted by the associated QGraphicsGeoMap as it resizes.
Access functions:
virtual QSizeF | windowSize () const |
virtual void | setWindowSize ( const QSizeF & size ) |
Notifier signal:
void | windowSizeChanged ( const QSizeF & windowSize ) |
Returns the zoom level of the map.
Larger values of the zoom level correspond to more detailed views of the map.
Access functions:
virtual qreal | zoomLevel () const |
virtual void | setZoomLevel ( qreal zoomLevel ) |
Notifier signal:
void | zoomLevelChanged ( qreal zoomLevel ) |
Constructs a new map data object, which 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.
This signal is emitted when the center of the map has changed.
The new value is coordinate.
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.
This signal is emitted when the connectivity mode used to fetch the map data has changed.
The new value is connectivityMode.
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.
Attempts to fit the bounding box bounds into the viewport of the map.
This method will change the zoom level to the maximum zoom level such that all of bounds is visible within the resulting viewport.
If preserveViewportCenter is false the map will be centered on the bounding box bounds before the zoom level is changed, otherwise the center of the map will not be changed.
This function is run after the QGeoMapData instance has been constructed.
Any subclasses which override this function should make sure that QGeoMapData::init() is called within the body of the overridding function.
Returns the map objects associated with this map.
Returns the list of visible map objects managed by this map which contain the point screenPosition within their boundaries.
Returns the list of visible map objects managed by this map which are displayed at least partially within the on screen rectangle screenRect.
Returns the list of visible map objects manager by this widget which are displayed at least partially within the viewport of the map.
Returns the map overlays associated with this map.
This signal is emitted when the type of the map has changes.
The value is mapType.
Paints the map and everything associated with it on painter, using the options option.
This will paint the map with paintMap(), then the map overlays with QGeoMapOverlay::paint(), then the map objects with paintObjects(), and finally paintProviderNotices().
Paints the map on painter, using the options option.
The map overlays, map objects and the provider notices (such as copyright and powered by notices) are painted in separate methods, which are combined in the paint() method.
The default implementation does not paint anything.
Paints the map objects on painter, using the options option.
The default implementation does not paint anything.
Paints the provider notices on painter, using the options option.
The provider notices are things like the copyright and powered by notices.
The provider may not want the client developers to be able to move the notices from their standard positions and so we have not provided API support for specifying the position of the notices at this time.
If support for hinting at the position of the notices is to be provided by plugin parameters, the suggested parameter keys are "mapping.notices.copyright.alignment" and "mapping.notices.poweredby.alignment", with type Qt::Alignment.
The default implementation does not paint anything.
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.
Subclasses should call QGeoMapData::setCenter() when the pan has completed.
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.
Sets whether changes to properties will trigger their corresponding signals to block.
By default the QGeoMapData implementations of the property functions are used which cause the property notification signals to be emitted immediately.
Calling this function with block set to false will prevent these signals from being called, which will allow a subclass to defer the emission of the signal until a later time.
If this function needs to be called it should be used as soon as possible, preferably in the constructor of the QGeoMapData subclass.
This signal is emitted when the region target of the window which contains the map needs to be updated.
If target is empty then the entire map will be updated.
Returns a bounding box corresponding to the physical area displayed in the viewport of the map.
The bounding box which is returned is defined by the upper left and lower right corners of the visible area of the map.
This signal is emitted when the size of the window which contains the map has changed.
The new value is windowSize.
This signal is emitted when the zoom level of the map has changed.
The new value is zoomLevel.