Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Maps and Navigation (QML)

Maps and Navigation provides QtQuick user interface elements for displaying geographic information on a map, as well as allowing user interaction with map overlay objects and the display itself. It also contains utilities for geocoding (finding a geographic coordinate from a street address) and navigation (including driving and walking directions).

It builds upon the API concepts and elements in the QML Positioning API.

Maps

Displaying Maps

Displaying a map is done using the Map QML element. The Map element supports user interaction through the MapFlickable and MapPinchArea QML elements. The Map element draws the map on-screen using OpenGL (ES), allowing for hardware-accelerated rendering where available.

Key Elements

PluginA location-based services plugin provides data including map data which is then displayed in a Map element.
MapQtQuick item to display a map on-screen.
MapFlickableInteraction helper for the "flick" panning gesture on a Map.
MapPinchAreaInteraction helper for the "pinch to zoom" gesture on a Map.

Note that the client must create a Plugin element prior to using a Map element in order to have access to map data to display.

Putting Objects on a Map (Map Overlay Objects)

Maps can also contain map overlay objects, which are used to display information on its surface. There is a set of basic pre-defined map overlay objects, as well as the ability to implement custom map overlay objects using the MapQuickItem element, which can contain any standard QtQuick item.

Key Elements

MapCircleA geographic circle (all points at a set distance from a center), optionally with a border.
MapRectangleA rectangle whose top left and bottom right points are specified as Coordinate elements, optionally with a border.
MapPolygonA polygon made of an arbitrary list of Coordinate elements.
MapPolylineA polyline made of an arbitrary list of Coordinate elements.
MapQuickItemTurns any arbitrary QtQuick Item into a map overlay object. MapQuickItem is an enabler for specifying custom map overlay objects.

Model-View Design with Map Overlay Objects

To automatically generate map overlay objects based on the contents of a QtQuick model (for example a ListModel item), the MapItemView element is available. It accepts any map overlay object as its delegate, and can only be created within a Map.

Key Elements

MapItemViewPopulates a Map with map overlay objects based on the data provided by a model.

Interaction with Map Overlay Objects

Interaction with the pre-defined map overlay object types is done using the MapMouseArea element, which behaves much like a normal QtQuick MouseArea. MapQuickItems can also contain MapMouseArea elements, but can additionally use normal QtQuick MouseAreas to provide interaction.

Properties of map overlay objects that influence their appearance on the display can be changed at any time, and many can also be used in animations. Animating coordinate-based map overlay objects, such as MapPolygon and MapPolyline, is not yet available.

Key Elements

MapMouseAreaAccepts mouse events for a pre-defined map overlay object (for example MapCircle).
MapMouseEventProvides additional information unique to mouse events on a Map.

Geocoding -- Address to Coordinate and Vice Versa

Geocoding is the translation of geographic coordinates into addresses, or vice versa. Such a translation usually involves sending the source data to a server which then performs the translation and returns the results, although some location-based service provider plugins may be able to provide some geocoding functionality without sending data to a remote server. The availability and accuracy of the translation usually depends on the location or address being translated, as different areas of the Earth are mapped to varying degrees of accuracy.

A geocoding query in QML is performed using the GeocodeModel element. For an address-to-coordinate query, its query property may be set to either an Address element or a string containing the textual form of the address to search for. To perform the reverse, the same property can be set to a Coordinate instead. Results are made available in the contents of the model.

Key Elements

PluginA location-based services plugin provides data including geocoding translation results which are exposed to clients via a GeocodeModel.
GeocodeModelQueries the Plugin for geocoding translations and provides access to results via indexes in the model.
AddressStructured address for use in queries and results of geocoding.

Note that the client must create a Plugin element prior to using a GeocodeModel element in order to have access to geocoding translation services and thus data to display.

Routing and Navigation

Routing is the determination of a navigable path from one point to another on a map. Given a map that is aware of features that aid or hinder navigation, such as bridges, waterways and so on, a series of segments that make up the journey can be constructed. If these RouteSegments are simple then we can add navigation information at the connecting points, RouteManeuvers, between the segments.

Key Elements

RoutingThe entire path to be navigated.
SegmentsThe individual components of a route.
ManeuversThe navigation information that joins segments.
RouteModelThe means of making requests on the backend to supply route information.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web