summaryrefslogtreecommitdiff
path: root/tests/baseline/mapitems/data/circle_greatCircle/circle_concentric4.qml
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2023-02-22 18:23:44 +0100
committerMatthias Rauter <matthias.rauter@qt.io>2023-04-11 07:59:01 +0100
commitbd3ca9bd2158c2271cc76173fd747679d7fbd76c (patch)
tree9fee399b8d4d8ff084fc5e42d86086741b1087eb /tests/baseline/mapitems/data/circle_greatCircle/circle_concentric4.qml
parentfbe6f3f4b9456467baa772c6efe40b80aefd1414 (diff)
downloadqtlocation-bd3ca9bd2158c2271cc76173fd747679d7fbd76c.tar.gz
Polygons/lines can now be rendered following the shortest path on the globe
This is enabled by interpolating the lines of polygons and paths. The interpolating is done following the greater circle navigation and the connection between corners of the polygon appear curved on the projected map. This behavior can be turned on by setting a new property, called referenceSurface. It can be set to ReferenceSurface.Map, drawing paths as lines on the map or to ReferenceSurface.Globe, drawing path on the globe leading to curves on the map. It is set to ReferenceSurface.Map on default, reproducing the old implementation for polygons, polylines and rectangles. The circle item was already using the great circle path before this change. Its standard implementation was changed to draw a circle in map coordinates with approximated radius. This should be sufficient for many cases. To get the old implementation, referenceSurface has to be set to ReferenceSurface.Map. Fixes: QTBUG-94785 Change-Id: Ifdd1597a7116c3d220462f063656b04becb6422f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/baseline/mapitems/data/circle_greatCircle/circle_concentric4.qml')
-rw-r--r--tests/baseline/mapitems/data/circle_greatCircle/circle_concentric4.qml48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/baseline/mapitems/data/circle_greatCircle/circle_concentric4.qml b/tests/baseline/mapitems/data/circle_greatCircle/circle_concentric4.qml
new file mode 100644
index 00000000..d856414e
--- /dev/null
+++ b/tests/baseline/mapitems/data/circle_greatCircle/circle_concentric4.qml
@@ -0,0 +1,48 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+import QtQuick
+import QtLocation
+import QtPositioning
+
+Map {
+ width: 512
+ height: 512
+
+ center: QtPositioning.coordinate(0, -110)
+
+ id: map
+ plugin: Plugin {
+ name: "itemsoverlay"
+ }
+ zoomLevel: 1
+ copyrightsVisible: false
+
+ Repeater {
+ id: c
+ property var colors: [
+ "#30ff0000",
+ "#30ffa500",
+ "#30ffff00",
+ "#3000ff00",
+ "#300000ff",
+ "#30ee82ee"
+ ]
+ property int count: 20
+ model: count
+ MapCircle
+ {
+ center
+ {
+ longitude: 170
+ latitude: 30
+ }
+ radius: ((c.count-index-1)/(c.count-1)*(6371-1000)+500)*Math.PI*1000
+ color: c.colors[Math.floor(index%c.colors.length)]
+ border.width: 1
+ autoFadeIn: false
+ referenceSurface: QtLocation.ReferenceSurface.Globe
+ opacity: 1
+ }
+ }
+}