11 import com.nokia.meego 1.0
12 import org.kde.edu.marble 0.11
19 id: routingActivityPage
22 property bool horizontal: width / height > 1.20
24 tools: ToolBarLayout {
26 iconSource:
main.
icon(
"actions/go-home", 48 );
31 iconSource:
main.
icon(
"actions/go-up", 48 );
38 iconSource:
main.
icon(
"places/user-identity", 48 );
40 marbleWidget.centerOn( marbleWidget.tracking.lastKnownPosition.longitude, marbleWidget.tracking.lastKnownPosition.latitude )
41 if (marbleWidget.zoom < 22026 ) {
42 marbleWidget.zoom = 86250
47 iconSource:
main.
icon(
"devices/network-wireless", 48 );
49 checked: !settings.workOffline
50 onCheckedChanged: settings.workOffline = !checked
56 iconSource:
main.
icon(
"actions/show-menu", 48 );
59 pageMenu.visualParent = menuIcon
70 text:
"Start Navigation"
71 onClicked: openActivity(
"Navigation" )
75 text:
"Prepare Offline Usage"
76 onClicked: downloadSheet.open()
82 saveRouteDialog.filename =
"route-" + Qt.formatDateTime(
new Date(),
"yyyy-MM-dd_hh.mm.ss") +
".kml"
83 saveRouteDialog.open()
88 text:
"Save Route to Cloud"
89 onClicked: marbleWidget.cloudSync.uploadRoute()
90 visible: settings.owncloudSync
95 onClicked: openRouteDialog.open()
100 onClicked: manageRoutesSheet.open()
101 visible: settings.owncloudSync
105 text:
"Elevation Profile"
108 var plugins = settings.activeRenderPlugins
110 plugins.push(
"elevationprofile")
112 settings.removeElementsFromArray(plugins, [
"elevationprofile"])
114 settings.activeRenderPlugins = plugins
115 marbleWidget.setGeoSceneProperty(
"hillshading", checked )
124 contentHeight: routeEditor.height + waypointListView.height
126 property bool minimized: !minimizeButton.
checked
129 anchors.bottom: routingActivityPage.bottom
130 anchors.left: routingActivityPage.left
131 width: routingActivityPage.horizontal ? (minimized ? 0 : routingActivityPage.width / 2) : routingActivityPage.width
132 height: routingActivityPage.horizontal ? routingActivityPage.height : (minimized ? 0 : routingActivityPage.height / 2)
135 enabled: !routingActivityPage.horizontal;
137 easing.type: Easing.InOutQuad;
144 anchors.top: parent.top
145 anchors.left: parent.left
146 anchors.right: parent.right
152 anchors.top: routeEditor.bottom
153 anchors.left: parent.left
154 anchors.right: parent.right
158 model: marbleWidget.routing.waypointModel()
159 delegate: turnTypeDelegate
161 highlightMoveDuration: 200
170 flickableItem: searchResultView
177 anchors.left: routingActivityPage.horizontal ? searchResultView.right : routingActivityPage.left
178 anchors.bottom: routingActivityPage.horizontal ? routingActivityPage.bottom : searchResultView.top
179 anchors.right: routingActivityPage.right
180 anchors.top: routingActivityPage.top
182 function embedMarbleWidget() {
183 marbleWidget.parent = mapContainer
184 settings.projection =
"Mercator"
185 var plugins = settings.defaultRenderPlugins
186 settings.removeElementsFromArray(plugins, [
"coordinate-grid",
"sun",
"stars",
"compass"])
187 settings.activeRenderPlugins = plugins
188 settings.mapTheme = settings.streetMapTheme
189 settings.gpsTracking =
true
190 settings.showPositionIndicator =
true
192 settings.showTrack =
false
193 marbleWidget.visible =
true
196 Component.onDestruction: {
197 if ( marbleWidget.parent === mapContainer ) {
198 marbleWidget.parent = null
199 marbleWidget.visible =
false
207 folder:
"/home/user/MyDocs"
209 nameFilters: [
"*.kml" ]
211 onAccepted: { marbleWidget.routing.saveRoute( folder +
"/" + filename ); }
217 folder:
"/home/user/MyDocs"
218 nameFilters: [
"*.kml",
"*.gpx" ]
220 onAccepted: { marbleWidget.routing.openRoute( folder +
"/" + filename ); }
235 width: 64; height: 64
236 source:
"qrc" + turnTypeIcon
240 anchors.verticalCenter: parent.verticalCenter
243 width: parent.width - turnIcon.width - 20
244 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
249 waypointListView.currentIndex = index
250 marbleWidget.centerOn(longitude, latitude)
258 width: parent.width - 20
266 if ( status === PageStatus.Activating ) {
267 mapContainer.embedMarbleWidget()
272 id: manageRoutesSheet
273 rejectButtonText:
"Back"
281 model: marbleWidget.cloudSync.routeModel
282 delegate: routeViewDelegate
285 color:
"lightsteelblue"
292 id: routeViewDelegate
295 property bool selected: routeView.currentIndex === index
299 onClicked: routeView.currentIndex = index
302 width: routeView.width
303 height: routeTopBox.height + (selected ? routeControlBox.height + 15 : 10)
308 anchors.top: parent.top
309 anchors.left: parent.left
310 anchors.right: parent.right
311 height: previewImage.height
316 width: 128; height: 128
322 anchors.left: previewImage.right
323 anchors.leftMargin: 5
324 anchors.right: parent.right
325 anchors.top: parent.top
326 anchors.bottom: parent.bottom
331 anchors.centerIn: parent
332 width: parent.width - 20
333 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
343 anchors.top: routeTopBox.bottom
344 anchors.left: parent.left
345 anchors.right: parent.right
348 height: openButton.height
356 marbleWidget.cloudSync.openRoute( identifier )
357 manageRoutesSheet.close()
362 anchors.right: parent.right
366 width: cacheControlBox.width + 12
367 height: cacheControlBox.height - 1
370 anchors.right: parent.right
373 anchors.verticalCenter: parent.verticalCenter
374 text: isCached ?
"On device" :
"Not on device"
380 iconSource:
main.
icon(
"actions/download", 32 )
382 marbleWidget.cloudSync.downloadRoute( identifier )
389 iconSource:
main.
icon(
"actions/dialog-cancel", 32 )
391 marbleWidget.cloudSync.removeRouteFromDevice( identifier )
399 width: cloudControlBox.width + 12
400 height: cloudControlBox.height - 1
403 anchors.right: parent.right
406 anchors.verticalCenter: parent.verticalCenter
407 text: isOnCloud ?
"In cloud" :
"Not in cloud"
413 iconSource:
main.
icon(
"actions/upload", 32 )
415 marbleWidget.cloudSync.uploadRoute( identifier )
422 iconSource:
main.
icon(
"actions/dialog-cancel", 32 )
424 marbleWidget.cloudSync.deleteRouteFromCloud( identifier )
438 acceptButtonText:
"Download"
439 rejectButtonText:
"Cancel"
448 text:
"<font size=\"-1\">Select the map images to download for offline usage. Note that routing data and voice navigation speakers must be downloaded in the Preferences.</font>"
453 Label { text:
"Download Mode" }
456 id: downloadTypeSwitch
457 checkedButton: routeButton
458 property bool routeMode: checkedButton === routeButton
473 text: downloadTypeSwitch.routeMode ?
"The current route area is downloaded" :
"The currently visible map area is downloaded"
475 wrapMode: Text.WordWrap
478 Label { text:
"Level of detail" }
483 valueIndicatorVisible:
true
487 valueIndicatorText:
"tile level " + value
492 anchors.left: tileSlider.left
493 anchors.right: tileSlider.right
497 function humanValue() {
498 switch (tileSlider.value) {
499 case 11:
return "Very coarse"
500 case 12:
return "Cities with names"
501 case 13:
return "Villages and suburbs with names"
502 case 14:
return "Important streets with names"
503 case 15:
return "Many streets with names"
504 case 16:
return "Most streets with names"
511 visible: downloadTypeSwitch.routeMode
516 visible: downloadTypeSwitch.routeMode
518 valueIndicatorVisible:
true
519 valueIndicatorText: value +
" meter"
529 if (downloadTypeSwitch.routeMode) {
530 marbleWidget.downloadRoute( offsetSlider.value, 0, tileSlider.value )
532 marbleWidget.downloadArea( 0, tileSlider.value )
static qreal radius(qreal zoom)