forked from ernesst/ActivityTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQMLMap.qml
More file actions
79 lines (70 loc) · 2.13 KB
/
QMLMap.qml
File metadata and controls
79 lines (70 loc) · 2.13 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
73
74
75
76
77
78
79
import QtQuick 2.4
import QtPositioning 5.6
import Ubuntu.Components 1.3
import QtQuick.Layouts 1.1
import io.thp.pyotherside 1.5
import QtSystemInfo 5.0
import QtLocation 5.6
import Ubuntu.Components.ListItems 1.3 as ListItem
import Ubuntu.Components.Popups 1.3
import "./lib/polyline.js" as Pl
import Ubuntu.Web 0.2
Page {
header: PageHeader {
id: webmap_header
title: i18n.tr("Activity Map")
}
id: mainPage
property var polyline;
Python {
id: pygpx
Component.onCompleted: {
addImportPath(Qt.resolvedUrl('py/'));
importModule("geepeeex", function() {
console.warn("calling python script to load the gpx file")
pygpx.call("geepeeex.visu_gpx", [polyline], function(result) {
var t = new Array (0)
//map.center = QtPositioning.coordinate(result[10].latitude,result[10].longitude); // Allow a delay in case of the recording start with cell tower position
for (var i=0; i<result.length; i++) {
pline.addCoordinate(QtPositioning.coordinate(result[i].latitude,result[i].longitude));
}
map.center = QtPositioning.coordinate(result[i/2].latitude,result[i/2].longitude); // Center the map on the center of the track
});
});
}//Component.onCompleted
}
/*ListView {
id: whattheproblem
whattheproblem.model:
id: gpxmodel
whattheproblem.delegate: Component {
Text {
latitude: gpxmodel.latitude
longitude: gpxmodel.longitude
}
}
}*/
Plugin {
id: mapPlugin
name: "osm"
}
Map {
id: map
anchors.fill: parent
center: QtPositioning.coordinate(29.62289936, -95.64410114) // Oslo
zoomLevel: map.maximumZoomLevel - 5
plugin : Plugin {
id: plugin
allowExperimental: true
preferred: ["osm"]
required.mapping: Plugin.AnyMappingFeatures
required.geocoding: Plugin.AnyGeocodingFeatures
}
MapPolyline {
id: pline
line.width: 4
line.color: 'red'
path: []
}
}
}