• 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
  • plugins
  • runner
  • latlon
LatLonRunner.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2008 Henry de Valence <hdevalence@gmail.com>
9 
10 #include "LatLonRunner.h"
11 
12 #include "GeoDataFeature.h"
13 #include "GeoDataPlacemark.h"
14 #include "GeoDataCoordinates.h"
15 
16 #include "MarbleDebug.h"
17 #include <QString>
18 #include <QStringList>
19 #include <QVector>
20 
21 #include <QtDebug>
22 
23 namespace Marble
24 {
25 
26 LatLonRunner::LatLonRunner(QObject *parent) :
27  SearchRunner(parent)
28 {
29 }
30 
31 
32 LatLonRunner::~LatLonRunner()
33 {
34 }
35 
36 void LatLonRunner::search( const QString &searchTerm, const GeoDataLatLonBox & )
37 {
38  QVector<GeoDataPlacemark*> vector;
39 
40  bool successful = false;
41  const GeoDataCoordinates coord = GeoDataCoordinates::fromString( searchTerm, successful );
42 
43  if( successful ) {
44  GeoDataPlacemark *placemark = new GeoDataPlacemark;
45  placemark->setName( searchTerm );
46  qreal lon, lat;
47  coord.geoCoordinates( lon, lat );
48  placemark->setCoordinate( lon, lat );
49  placemark->setVisualCategory( GeoDataFeature::Coordinate );
50  placemark->setPopularity( 1000000000 );
51  placemark->setZoomLevel( 1 );
52  vector.append( placemark );
53  }
54 
55  emit searchFinished( vector );
56 }
57 
58 }
59 
60 #include "LatLonRunner.moc"
LatLonRunner.h
GeoDataCoordinates.h
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
QVector::append
void append(const T &value)
Marble::GeoDataFeature::setVisualCategory
void setVisualCategory(GeoDataVisualCategory category)
Sets the symbol index of the placemark.
Definition: GeoDataFeature.cpp:770
Marble::SearchRunner::searchFinished
void searchFinished(QVector< GeoDataPlacemark * > result)
This is emitted to indicate that the runner has finished the placemark search.
Marble::GeoDataFeature::Coordinate
Definition: GeoDataFeature.h:125
Marble::LatLonRunner::search
virtual void search(const QString &searchTerm, const GeoDataLatLonBox &preferred)
Start a placemark search.
Definition: LatLonRunner.cpp:36
Marble::GeoDataPlacemark::setCoordinate
void setCoordinate(qreal longitude, qreal latitude, qreal altitude=0, GeoDataCoordinates::Unit _unit=GeoDataCoordinates::Radian)
Set the coordinate of the placemark in longitude and latitude.
Definition: GeoDataPlacemark.cpp:215
MarbleDebug.h
GeoDataFeature.h
Marble::GeoDataFeature::setPopularity
void setPopularity(qint64 popularity)
Sets the popularity of the feature.
Definition: GeoDataFeature.cpp:813
Marble::GeoDataCoordinates::geoCoordinates
void geoCoordinates(qreal &lon, qreal &lat, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
use this function to get the longitude and latitude with one call - use the unit parameter to switch ...
Definition: GeoDataCoordinates.cpp:715
Marble::GeoDataFeature::setName
void setName(const QString &value)
Set a new name for this feature.
Definition: GeoDataFeature.cpp:549
QObject
QString
GeoDataPlacemark.h
Marble::LatLonRunner::~LatLonRunner
~LatLonRunner()
Definition: LatLonRunner.cpp:32
QVector
Marble::GeoDataFeature::setZoomLevel
void setZoomLevel(int index)
Sets the popularity index of the placemark.
Definition: GeoDataFeature.cpp:802
Marble::GeoDataCoordinates::fromString
static GeoDataCoordinates fromString(const QString &string, bool &successful)
try to parse the string into a coordinate pair
Definition: GeoDataCoordinates.cpp:909
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
Marble::SearchRunner
Definition: SearchRunner.h:30
Marble::LatLonRunner::LatLonRunner
LatLonRunner(QObject *parent=0)
Definition: LatLonRunner.cpp:26
Marble::GeoDataLatLonBox
A class that defines a 2D bounding box for geographic data.
Definition: GeoDataLatLonBox.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:40 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