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  · 

MapCircle

The MapCircle element displays a geographic circle on a Map. More...

Inherits Item

This type was introduced in Qt Location 5.0.

Properties

Detailed Description

The MapCircle element displays a geographic circle on a Map, which consists of all points that are within a set distance from one central point. Depending on map projection, a geographic circle may not always be a perfect circle on the screen: for instance, in the Mercator projection, circles become ovoid in shape as they near the poles. To display a perfect screen circle around a point, use a MapQuickItem containing a relevant QML element instead.

By default, the circle is displayed as a 1 pixel black border with no fill. To change its appearance, use the color, border.color and border.width properties.

Internally, a MapCircle is implemented as a many-sided polygon. To calculate the radius points it uses a spherical model of the Earth, similar to the atDistanceAndAzimuth method of the QML Coordinate element. These two things can occasionally have implications for the accuracy of the circle's shape, depending on position and map projection.

Performance

MapCircle performance is almost equivalent to that of a MapPolygon with 125 vertices. There is a small amount of additional overhead with respect to calculating the vertices first.

Like the other map objects, MapCircle is normally drawn without a smooth appearance. Setting the opacity property will force the object to be blended, which decreases performance considerably depending on the graphics hardware in use.

Example Usage

The following snippet shows a map containing a MapCircle, centered at the coordinate (-27, 153) with a radius of 5km. The circle is filled in green, with a 3 pixel black border.

 Map {
     MapCircle {
         center: Coordinate { latitude: -27; longitude: 153.0 }
         radius: 5000.0
         color: 'green'
         border.width: 3
     }
 }

Property Documentation

border.width : int

border.color : color

These properties hold the width and color used to draw the border of the circle. The width is in pixels and is independent of the zoom level of the map.

The default values correspond to a black border with a width of 1 pixel. For no line, use a width of 0 or a transparent color.


center : Coordinate

This property holds the central point about which the circle is defined.

See also radius.


color : color

This property holds the fill color of the circle when drawn. For no fill, use a transparent color.


opacity : real

This property holds the opacity of the item. Opacity is specified as a number between 0 (fully transparent) and 1 (fully opaque). The default is 1.

If an item's opacity is set to 0, the item will no longer receive mouse events. Similarly, setting the visible property to false stops mouse events.


radius : qreal

This property holds the radius of the circle, in meters on the ground.

See also center.


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