• 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
  • examples
  • qml
  • data-layers
DynamicLayer.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 2012 Dennis Nienhüser <earthwings@gentoo.org>
8 
9 import QtQuick 1.1
10 import org.kde.edu.marble 0.11
11 
12 MarbleWidget {
13  width: 800;
14  height: 600
15 
16  center: Coordinate { longitude: 142.2; latitude: 11.35 }
17 
18  dataLayers: [
19  DataLayer{
20  id: layer
21  // The model defines the data that will appear. The lon and lat
22  // property of its items define their position
23  // See EarthquakesModel.qml for details
24  model: EarthquakesModel {
25  id: earthquakes
26  }
27 
28  // The delegate is the component that shows the items from the
29  // model on top of the map. Their position and visibility is managed
30  // automatically by Marble
31  delegate: Rectangle {
32  width: magnitude * 10;
33  height: width
34  radius: width / 2;
35  color: magnitude < 5.0 ? "green" : ( magnitude < 6.0 ? "orange" : "red" )
36  opacity: 0.67
37 
38  Text {
39  anchors.centerIn: parent
40  font.bold: true
41  text: magnitude
42  }
43  }
44 
45  // Marble informs us with this signal that new data is needed for the given
46  // bounding box (north, south, east, west, each in degree). We retrieve new
47  // data from our model (which calls geonames.org) in that case
48  onDataRequest: {
49  earthquakes.north = north
50  earthquakes.south = south
51  earthquakes.east = east
52  earthquakes.west = west
53  earthquakes.update()
54  }
55  }
56  ]
57 
62  Connections {
63  target: earthquakes
64  onStatusChanged: {
65  if ( earthquakes.status == XmlListModel.Ready ) {
66  layer.model = earthquakes
67  }
68  }
69  }
70 }
EarthquakesModel
Definition: EarthquakesModel.qml:9
Coordinate
Represents a coordinate with the properties of a name and coordinates.
Definition: Coordinate.h:28
Rectangle
XmlListModel
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