MapPolylineThe MapPolyline element displays a polyline on a map. More... Inherits Item This type was introduced in Qt Location 5.0. Properties
Methods
Detailed DescriptionThe MapPolyline element displays a polyline on a map, specified in terms of an ordered list of Coordinate elements. The Coordinate elements on the path can be changed after being added to the Polyline, and these changes will be reflected in the next frame on the display. Coordinates can also be added and removed at any time using the addCoordinate and removeCoordinate methods. By default, the polyline is displayed as a 1-pixel thick black line. This can be changed using the line.width and line.color properties. PerformanceMapPolylines have a rendering cost that is O(n) with respect to the number of vertices. This means that the per frame cost of having a polyline on the Map grows in direct proportion to the number of points in the polyline. Like the other map objects, MapPolyline 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 hardware in use. NOTE: MapPolylines are implemented using the OpenGL GL_LINES primitive. There have been occasional reports of issues and rendering inconsistencies on some (particularly quite old) platforms. No workaround is yet available for these issues. Example UsageThe following snippet shows a MapPolyline with 4 points, making a shape like the top part of a "question mark" (?), near Brisbane, Australia. The line drawn is 3 pixels in width and green in color. Map { MapPolyline { line.width: 3 line.color: 'green' path: [ Coordinate { latitude: -27; longitude: 153.0 }, Coordinate { latitude: -27; longitude: 154.1 }, Coordinate { latitude: -28; longitude: 153.5 }, Coordinate { latitude: -29; longitude: 153.5 } ] } }
Property DocumentationThese properties hold the width and color used to draw the line. 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 property holds the ordered list of coordinates which define the polyline. Method DocumentationAdds a coordinate to the path. See also removeCoordinate and path. Removes a coordinate from the path. If there are multiple instances of the same coordinate, the one added last is removed. See also addCoordinate and path. |