summaryrefslogtreecommitdiff
path: root/examples/location/mapviewer/map/CircleItem.qml
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-12-07 16:28:01 +0100
committerMatthias Rauter <matthias.rauter@qt.io>2023-02-20 11:26:58 +0100
commite770809db4b6c92ee4be22b5ea021ccc505cec8f (patch)
tree110122860d4e06db68ebe06309bcc5167352382f /examples/location/mapviewer/map/CircleItem.qml
parent51a895b3d280ce5103785e016e82b77676c26c5f (diff)
downloadqtlocation-e770809db4b6c92ee4be22b5ea021ccc505cec8f.tar.gz
Update location examples to work with MapView/Handlers
MapView replaces Map in the examples to reintroduce event handling. Some of the functionality is still in mapview.map and the code has to be adjusted respectivly. The following examples are affected: mapviewer, places, places_map. The mapviewer example has a new menu to draw mapitems. The places example draws places icons instead of a fixed marker. Fixes: QTBUG-111005 Change-Id: I15ca2b3d3ecb7c35684b9fd4c2b7a86249add11c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'examples/location/mapviewer/map/CircleItem.qml')
-rw-r--r--examples/location/mapviewer/map/CircleItem.qml25
1 files changed, 16 insertions, 9 deletions
diff --git a/examples/location/mapviewer/map/CircleItem.qml b/examples/location/mapviewer/map/CircleItem.qml
index e647d248..a5cae752 100644
--- a/examples/location/mapviewer/map/CircleItem.qml
+++ b/examples/location/mapviewer/map/CircleItem.qml
@@ -3,19 +3,26 @@
import QtQuick
import QtLocation
-//TODO: remove/refactor me when items are integrated
-
MapCircle {
- color: "#46a2da"
- border.color: "#190a33"
+ color: "#da5546"
+ border.color: "#330a0a"
border.width: 2
smooth: true
- opacity: 0.25
+ opacity: 0.75
+
+ function setGeometry(anchorCoordinate) {
+ center = anchorCoordinate
+ }
+
+ function addGeometry(newCoordinate, changeLast){
+ radius = center.distanceTo(newCoordinate)
+ return true
+ }
- function setGeometry(markers, index){
- center.latitude = markers[index].coordinate.latitude
- center.longitude = markers[index].coordinate.longitude
- radius= center.distanceTo(markers[index + 1].coordinate)
+ function finishAddGeometry(){
+ color = "#46a2da"
+ border.color = "#190a33"
+ opacity = 0.25
}
}