QML MapPolygon ElementThe MapPolygon element displays a polygon on a map. More... Properties
MethodsDetailed DescriptionThe polygon is specified in terms of an ordered list of coordinates. Any invalid coordinates in the list will be ignored. If the list contains less than 3 valid coordinates the polygon will not be displayed. Simplistic example to illustrate, this element could be defined in Map body: MapPolygon { id: polygon color: "blue" Coordinate { id: topLeftCoordinate latitude: -28.35 longitude: 153.4 } Coordinate { id: rightCoordinate latitude: -28.34 longitude: 153.45 } Coordinate { id: bottomLeftCoordinate latitude: -28.33 longitude: 153.4 } } The MapPolygon element is part of the QtMobility.location 1.2 module. Property DocumentationThese 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. This documentation was introduced in Qt Mobility Mobility 1.2. This property holds the color used to fill the circle. The default value corresponds to a transparent color. This documentation was introduced in Qt Mobility Mobility 1.2. This property holds the ordered list of coordinates which define the polygon. This documentation was introduced in Qt Mobility Mobility 1.2. This property holds a boolean corresponding to whether or not the polygon is visible. This documentation was introduced in Qt Mobility Mobility 1.2. This property holds the z-value of the polygon. Map objects are drawn in z-value order, and objects with the same z-value will be drawn in insertion order. This documentation was introduced in Qt Mobility Mobility 1.2. Method DocumentationAdds coordinate to the path. The resulting path is derived from values at the time of assignment, meaning that later changes in values are not reflected in the path. onButton1Clicked: { polygon.addCoordinate(map.center) } This documentation was introduced in Qt Mobility Mobility 1.2. See also removeCoordinate. Remove coordinate from the path. Removed Coordinate is not deleted. If there are multiple instances of the same coordinate, the one added last is removed. onButton2Clicked: { polygon.removeCoordinate(map.center) } If more finetuned control is needed, one can also iterate and/or use the inherent index property of the path list. onButton1Clicked: { for (var index = 0; index < polyline.path.length; index++) { console.log("Index, latitude:" + index + " , " + polyline.path[index].latitude); } polyline.removeCoordinate(polyline.path[2]) } This documentation was introduced in Qt Mobility Mobility 1.2. See also addCoordinate. |
Publicité
Best OfActualités les plus luesSemaine
Mois
Année
![]()
![]() Le Qt Developer Network au hasard![]() Utiliser QML et QtWebKit avec PySideLe Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.
CommunautéRessources
Liens utilesContact
Qt dans le magazine |
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 qtmobility-1.2 | |
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 ! |
Copyright © 2000-2012 - www.developpez.com