MapRectangleThe MapRectangle element displays a rectangle on a Map. More... Inherits Item This type was introduced in Qt Location 5.0. Properties
Detailed DescriptionThe MapRectangle element displays a rectangle on a Map. Rectangles are a special case of Polygon with exactly 4 vertices and "straight" sides. In this case, "straight" means that the top-left point has the same latitude as the top-right point (the top side), and the bottom-left point has the same latitude as the bottom-right point (the bottom side). Similarly, the points on the left side have the same longitude, and the points on the right side have the same longitude. To specify the rectangle, it requires a topLeft and bottomRight point, both given by Coordinate elements. By default, the rectangle is displayed with transparent fill and a 1-pixel thick black border. This can be changed using the color, border.color and border.width properties. PerformanceMapRectangles have a rendering cost identical to a MapPolygon with 4 vertices. Like the other map objects, MapRectangle 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. Example UsageThe following snippet shows a map containing a MapRectangle, spanning from (-27, 153) to (-28, 153.5), near Brisbane, Australia. The rectangle is filled in green, with a 2 pixel black border. Map { MapRectangle { color: 'green' border.width: 2 topLeft: Coordinate { latitude: -27; longitude: 153 } bottomRight: Coordinate { latitude: -28; longitude: 153.5 } } }
Property DocumentationThese properties hold the width and color used to draw the border of the rectangle. 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. Holds the bottom-right coordinate of the MapRectangle which can be used to retrieve longitude, latitude and altitude of the coordination. This property holds the fill color of the rectangle. For no fill, use a transparent color. 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. Holds the top-left coordinate of the MapRectangle which can be used to retrieve longitude, latitude and altitude of the coordination. |