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  · 

Positioning (QML)

Location Positioning

Location data involves a precisely specified position on the Earth's surface — as provided by a latitude-longitude coordinate — along with associated data, such as:

  • The date and time at which the position was reported
  • The velocity of the device that reported the position
  • The altitude of the reported position (height above sea level)
  • The bearing of the device in degrees, relative to true north

This data can be extracted through a variety of methods. One of the most well known methods of positioning is GPS (Global Positioning System), a publicly available system that uses radiowave signals received from Earth-orbiting satellites to calculate the precise position and time of the receiver. Another popular method is 'Cell Identifier Positioning', which uses the cell identifier of the cell site that is currently serving the receiving device to calculate its approximate location. These and other positioning methods can all be used with the Location API; the only requirement for a location data source within the API is that it provides a latitude-longitude coordinate with a date/time value, with the option of providing the other attributes listed above.

Example: Centering the Map on the Current Position

Here is an example of a client that uses a position source to center a map on the current position:

 Rectangle {

     import QtLocation 5.0
     ...

     map : Map {
         // initialize map
         ...
     }

     PositionSource {
         onPositionChanged: {
             // center the map on the current position
             map.center = position.coordinate
         }
     }
 }

Flickr Example

The Flickr Example uses the Location to download thumbnail images from Flickr relevant to the current location.

Position QML Components

QtLocation5::Address

The Address QML element represents a specific location as a street address.

QtLocation5::BoundingArea

The BoundingArea element represents an abstract geographic area.

QtLocation5::BoundingBox

The BoundingBox element represents a rectangular geographic area.

QtLocation5::BoundingCircle

The BoundingCircle element represents a circular geographic area.

QtLocation5::Coordinate

The Coordinate element represents and stores a geographic position.

QtLocation5::Location

The Location element holds location data.

QtLocation5::Position

The Position element holds positional data at a particular point in time, such as coordinate (longitude, latitude, altitude) and speed.

QtLocation5::PositionSource

The PositionSource element provides the device's current position.

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