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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • apps
  • marble-touch
  • activities
Geocaching.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 // Copyright 2011 Daniel Marth <danielmarth@gmx.at>
9 
10 import QtQuick 1.0
11 import com.nokia.meego 1.0
12 import org.kde.edu.marble 0.11
13 import ".."
14 
15 /*
16  * Page for geocaching activity.
17  */
18 Page {
19  id: geocachingActivityPage
20  anchors.fill: parent
21 
22  tools: ToolBarLayout {
23  MarbleToolIcon {
24  iconSource: main.icon( "actions/go-home", 48 );
25  onClicked: main.showNavigation()
26  }
27  ToolButton {
28  id: searchButton
29  checkable: true
30  width: 60
31  flat: true
32  iconSource: main.icon( "actions/edit-find", 48 );
33  }
34  }
35 
36  Column {
37  width: parent.width
38  height: parent.height
39 
40  SearchField {
41  id: searchField
42  visible: searchButton.checked
43  width: parent.width
44  onSearch: {
45  searchField.busy = true
46  marbleWidget.find( term )
47  }
48 
49  Component.onCompleted: {
50  marbleWidget.search.searchFinished.connect( searchFinished )
51  }
52 
53  function searchFinished() {
54  searchField.busy = false
55  }
56  }
57 
58  Item {
59  clip: true
60  id: mapContainer
61  width: parent.width
62  height: parent.height - searchField.height
63 
64  function embedMarbleWidget() {
65  marbleWidget.parent = mapContainer
66  settings.projection = "Mercator"
67  var plugins = settings.defaultRenderPlugins
68  settings.removeElementsFromArray(plugins, ["coordinate-grid", "sun", "stars", "compass"])
69  plugins.push( "opencaching" )
70  settings.activeRenderPlugins = plugins
71  settings.mapTheme = settings.streetMapTheme
72  settings.gpsTracking = true
73  settings.showPositionIndicator = true
74  marbleWidget.tracking.positionMarkerType = Tracking.Arrow
75  settings.showTrack = true
76  marbleWidget.visible = true
77  }
78 
79  Component.onDestruction: {
80  if ( marbleWidget.parent === mapContainer ) {
81  marbleWidget.parent = null
82  marbleWidget.visible = false
83  }
84  }
85  }
86  }
87 
88  onStatusChanged: {
89  if ( status === PageStatus.Activating ) {
90  mapContainer.embedMarbleWidget()
91  }
92  }
93 }
Tracking
Definition: Tracking.qml:16
ToolButton
SearchField
Definition: SearchField.qml:14
Tracking::Arrow
Definition: Tracking.h:49
Item
MarbleWindow::icon
void icon(name, size)
MarbleToolIcon
Definition: harmattan/MarbleToolIcon.qml:10
MarbleWindow::showNavigation
void showNavigation()
main
Definition: main.qml:12
SearchField::busy
bool busy
Definition: SearchField.qml:19
Page
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:49 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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