• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • apps
  • marble-touch
RouteEditor.qml
Go to the documentation of this file.
1 // This file is part of the Marble Virtual Globe.
2 //
3 // This program is free software licensed under the GNU LGPL. You can
4 // find a copy of this license in LICENSE.txt in the top directory of
5 // the source code.
6 //
7 // Copyright 2011 Dennis Nienhüser <earthwings@gentoo.org>
8 
9 import QtQuick 1.0
10 import com.nokia.meego 1.0
11 import org.kde.edu.marble 0.11
12 
13 Item {
14  id: root
15  z: 10
16  height: content.height
17  property string searchTerm: ""
18 
19  function calculateRoute() {
20  marbleWidget.routing.routingProfile = routingTypeOptions.routingType
21  marbleWidget.routing.updateRoute()
22  }
23 
24  RouteRequestModel {
25  id: routeRequestModel
26  routing: marbleWidget.routing;
27  }
28 
29  Column {
30  id: content
31  width: parent.width
32  anchors.margins: 5
33  spacing: 5
34 
35  Repeater {
36  id: listView
37  width: parent.width
38  model: routeRequestModel
39 
40  ViaPointEditor {
41  id: sourcePoint
42  width: content.width
43 
44  Component.onCompleted: marbleWidget.mouseClickGeoPosition.connect(retrieveInput)
45  onPositionChanged: {
46  routeRequestModel.setPosition(index, lon, lat)
47  root.calculateRoute()
48  }
49  }
50  }
51 
52  Row {
53  id: routeActions
54  width: parent.width
55  Button {
56  text: "Add"
57  width: parent.width / 3 - 5
59  onClicked: marbleWidget.routing.addVia(marbleWidget.getCenter().longitude, marbleWidget.getCenter().latitude)
60  }
61 
62  Button {
63  text: "Reverse"
64  width: parent.width / 3 - 5
65  onClicked: marbleWidget.routing.reverseRoute()
66  }
67 
68  Button {
69  text: "Clear"
70  width: parent.width / 3 - 5
71  onClicked: marbleWidget.routing.clearRoute()
72  }
73  }
74 
75  ButtonRow {
76  width: parent.width - 20
77  id: routingTypeOptions
78  checkedButton: routingMotorcarButton
79  property string routingType: checkedButton.routingType
80  Button {
81  id: routingMotorcarButton
82  iconSource: "qrc:/icons/routing-motorcar.svg"
83  property string routingType: "Motorcar"
84  }
85 
86  Button {
87  id: routingBikeButton
88  iconSource: "qrc:/icons/routing-bike.svg"
89  property string routingType: "Bicycle"
90  }
91 
92  Button {
93  id: routingPedestrianButton
94  iconSource: "qrc:/icons/routing-pedestrian.svg"
95  property string routingType: "Pedestrian"
96  }
97  }
98  }
99 
100  Connections { target: routingTypeOptions; onRoutingTypeChanged: root.calculateRoute() }
101 
102  Component.onCompleted: {
103  if (routeRequestModel.count === 0) {
104  marbleWidget.routing.addVia(marbleWidget.tracking.lastKnownPosition.longitude, marbleWidget.tracking.lastKnownPosition.latitude)
105  }
106  }
107 }
RouteRequestModel::routing
Routing routing
Definition: RouteRequestModel.h:23
Button
Definition: cloud-sync/Button.qml:11
RouteRequestModel
Definition: RouteRequestModel.h:19
ViaPointEditor
Definition: ViaPointEditor.qml:10
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal