-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.qml
More file actions
72 lines (58 loc) · 1.85 KB
/
map.qml
File metadata and controls
72 lines (58 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import QtQuick
import QtLocation
import QtPositioning
// Root item
Item {
width: 800
height: 600
Plugin {
id: offlineOsm
name: "osm"
PluginParameter {
name: "osm.mapping.offline.directory";
value: Qt.resolvedUrl("mapa_menor")
}
PluginParameter {
name: "osm.mapping.offline.enabled";
value: true
}
// Adicione esta linha para garantir que o Qt não busque dados de roteamento online, etc.
PluginParameter { name: "osm.mapping.providersrepository.disabled"; value: true }
}
// The Map component
Map {
id: map
anchors.fill: parent
plugin: offlineOsm
// Center the map on the current position from the Python backend
center: map_backend.currentPosition
zoomLevel: 18 // Initial zoom
// --- 1. The Path Polyline ---
// This draws the recorded path
MapPolyline {
id: pathLine
// Bind the 'path' property directly to our Python property
path: map_backend.pathModel
line.width: 4
line.color: "blue"
}
// --- 2. The Current Position Marker ---
// This shows a red circle at the current GPS location
MapQuickItem {
id: currentPosMarker
// Bind the 'coordinate' property to our Python property
coordinate: map_backend.currentPosition
// Center the marker on the coordinate
anchorPoint.x: sourceItem.width / 2
anchorPoint.y: sourceItem.height / 2
sourceItem: Rectangle {
width: 16
height: 16
radius: 8
color: "red"
border.color: "white"
border.width: 2
}
}
}
}