QGraphicsGeoMap Class ReferenceThe QGraphicsGeoMap class is used to display a map and manager the interactions between the user and the map. More... #include <QGraphicsGeoMap> Inherits QGraphicsWidget. Public Types
Properties
Public Functions
Reimplemented Public Functions
Public Slots
Signals
Reimplemented Protected Functions
Additional Inherited Members
Detailed DescriptionThe QGraphicsGeoMap class is used to display a map and manager the interactions between the user and the map. Most of the functionality is provided by QGeoMappingManager, which handles most aspects of the display. The map viewport can be panned, the zoom level can be changed and the center coordinate of the viewport can be set explicitly. The screenPositionToCoordinate() and coordinateToScreenPoisition() functions can be used to convert between positions on the screen and global coordinates. Mouse and keyboard events should be handled by subclassing QGraphicsGeoMap and providing implementations of the event handling functions present in QGraphicsWidget. Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QGraphicsGeoMap::NoConnectivity | 0 | There is no map data. |
QGraphicsGeoMap::OfflineMode | 1 | The map data will come from an offline source. |
QGraphicsGeoMap::OnlineMode | 2 | The map data will come from an online source. |
QGraphicsGeoMap::HybridMode | 3 | The map data will come from a combination of offline and online sources. |
Describes a type of map data.
Constant | Value | Description |
---|---|---|
QGraphicsGeoMap::NoMap | 0 | Indicates a lack of map valid data. |
QGraphicsGeoMap::StreetMap | 1 | The map data is a graphical representation of streets and building boundaries. |
QGraphicsGeoMap::SatelliteMapDay | 2 | The map data is composed of images collected by satellites during the daytime. |
QGraphicsGeoMap::SatelliteMapNight | 3 | The map data is composed of images collected by satellites during the nighttime. |
QGraphicsGeoMap::TerrainMap | 4 | The map data is a graphical representation of terrain features. This may also include some of the information provided by QGraphicsGeoMap::StreetMap. |
This property holds this property holds the coordinate at the center of the map viewport.
Panning the map can be more efficient than changing the center by small increments.
Access functions:
QGeoCoordinate | center () const |
void | setCenter ( const QGeoCoordinate & center ) |
Notifier signal:
void | centerChanged ( const QGeoCoordinate & coordinate ) |
This property holds this property holds the connectivity mode used to obtain the map data.
Setting connectivityMode to a mode not present in supportedConnectivityModes() will do nothing.
Access functions:
ConnectivityMode | connectivityMode () const |
void | setConnectivityMode ( ConnectivityMode connectivityMode ) |
Notifier signal:
void | connectivityModeChanged ( QGraphicsGeoMap::ConnectivityMode connectivityMode ) |
This property holds this property holds the type of map data displayed by the map.
Setting mapType to a type not present in supportedMapTypes() will do nothing.
Access functions:
MapType | mapType () const |
void | setMapType ( MapType mapType ) |
Notifier signal:
void | mapTypeChanged ( QGraphicsGeoMap::MapType mapType ) |
This property holds this property holds the maximum zoom level supported by the QGeoMappingManager associated with this widget.
Larger values of the zoom level correspond to more detailed views of the map.
Access functions:
qreal | maximumZoomLevel () const |
This property holds this property holds the minimum zoom level supported by the QGeoMappingManager associated with this widget.
Larger values of the zoom level correspond to more detailed views of the map.
Access functions:
qreal | minimumZoomLevel () const |
This property holds this property holds the zoom level of the map.
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.
Access functions:
qreal | zoomLevel () const |
void | setZoomLevel ( qreal zoomLevel ) |
Notifier signal:
void | zoomLevelChanged ( qreal zoomLevel ) |
Creates a new mapping widget, with the mapping operations managed by manager, and the specified parent.
Note that the manager will typically be accessed from an instance of QGeoServiceProvider:
QGeoServiceProvider serviceProvider("nokia"); QGeoMappingManager *manager = serviceProvider.mappingManager(); QGraphicsGeoMap *widget = new QGraphicsGeoMap(manager);
Destroys this map widget.
Adds mapObject to the list of map objects managed by this widget.
If mapObject is within the viewport of the map and QGeoMapObject::isVisible() returns true then the map will display the map object immediately.
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 changes.
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 changes.
The new value is connectivityMode.
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.
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.
Returns the map objects associated with this map.
Returns the list of visible map objects managed by this widget which contain the point screenPosition within their boundaries.
Returns the list of visible map objects managed by this widget 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 map type changes.
The new value is mapType.
Reimplemented from QGraphicsItem::paint().
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.
After the panning has occurred the centerChanged() signal will be emitted.
Removes mapObject from the list of map objects managed by this widget.
If mapObject is within the viewport of the map and QGeoMapObject::isVisible() returns true then the map will stop displaying the map object immediately.
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.
Reimplemented from QGraphicsWidget::resizeEvent().
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.
Reimplemented from QGraphicsItem::shape().
Returns the connectivity modes supported by the QGeoMappingManager associated with this widget.
Returns the map types supported by the QGeoMappingManager associated with this widget.
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 zoom level of the map changes.
The new value is zoomLevel.