The QtPositioning global object provides useful functions for working with location-based types in QML. More...

Import Statement: | import QtPositioning 5.11 |

Since: | Qt 5.2 |

- geocircle
(coordinate**circle***center*, real*radius*) - geocircle
()**circle** - coordinate
(real**coordinate***latitude*, real*longitue*, real*altitude*) - coordinate
()**coordinate** - geopath
()**path** - geopolygon
(list<coordinate>**polygon***coordinates*) - geopolygon
()**polygon** - georectangle
(coordinate**rectangle***topLeft*, coordinate*bottomRight*) - georectangle
(coordinate**rectangle***center*, real*width*, real*height*) - georectangle
()**rectangle** - geoshape
()**shape** - geocircle
(geoshape**shapeToCircle***shape*) - geopath
(geoshape**shapeToPath***shape*) - geopolygon
(geoshape**shapeToPolygon***shape*) - georectangle
(geoshape**shapeToRectangle***shape*)

import QtPositioning 5.2 Item { property variant coordinate: QtPositioning.coordinate(-27.5, 153.1) }

geocircle circle(coordinate *center*, real *radius*)

Constructs a geocircle centered at *center* with a radius of *radius* meters.

geocircle circle()

Constructs an invalid geocircle.

**See also **geocircle.

coordinate coordinate(real *latitude*, real *longitue*, real *altitude*)

Constructs a coordinate with the specified *latitude*, *longitude* and optional *altitude*. Both *latitude* and *longitude* must be valid, otherwise an invalid coordinate is returned.

**See also **coordinate.

coordinate coordinate()

Constructs an invalid coordinate.

geopath path()

Constructs an empty geopath.

This QML method was introduced in Qt 5.9.

**See also **geopath.

geopolygon polygon(list<coordinate> *coordinates*)

Constructs a polygon from coordinates.

This QML method was introduced in Qt 5.10.

**See also **geopolygon.

geopolygon polygon()

Constructs an empty polygon.

This QML method was introduced in Qt 5.10.

**See also **geopolygon.

georectangle rectangle(coordinate *topLeft*, coordinate *bottomRight*)

Constructs a georectangle with its top left corner positioned at *topLeft* and its bottom right corner positioned at *bottomLeft*.

**See also **georectangle.

georectangle rectangle(coordinate *center*, real *width*, real *height*)

Constructs a georectangle centered at *center* with a width of *width* degrees and a hight of *height* degrees.

**See also **georectangle.

georectangle rectangle()

Constructs an invalid georectangle.

**See also **georectangle.

geoshape shape()

Constructs an invalid geoshape.

**See also **geoshape.

geocircle shapeToCircle(geoshape *shape*)

Converts *shape* to a geocircle.

This QML method was introduced in Qt 5.5.

**See also **geocircle.

geopath shapeToPath(geoshape *shape*)

Converts *shape* to a geopath.

This QML method was introduced in Qt 5.9.

**See also **geopath.

geopolygon shapeToPolygon(geoshape *shape*)

Converts *shape* to a polygon.

This QML method was introduced in Qt 5.10.

**See also **geopolygon.

georectangle shapeToRectangle(geoshape *shape*)

Converts *shape* to a georectangle.

This QML method was introduced in Qt 5.5.

**See also **georectangle.

© The Qt Company Ltd

Licensed under the GNU Free Documentation License, Version 1.3.

https://doc.qt.io/qt-5/qml-qtpositioning-qtpositioning.html