Marble

KmlLatLonBoxWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2012 Shou Ya <[email protected]>
4 //
5 
6 #include "KmlLatLonBoxWriter.h"
7 
8 #include "GeoDataLatLonBox.h"
9 #include "GeoDataTypes.h"
10 #include "GeoWriter.h"
11 #include "KmlElementDictionary.h"
12 #include "KmlObjectTagWriter.h"
13 
14 namespace Marble
15 {
16 
17 static GeoTagWriterRegistrar s_writerLookAt(
18  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataLatLonBoxType,
19  kml::kmlTag_nameSpaceOgc22 ),
20  new KmlLatLonBoxWriter );
21 
22 bool KmlLatLonBoxWriter::write( const GeoNode *node,
23  GeoWriter& writer ) const
24 {
25  const GeoDataLatLonBox *lat_lon_box =
26  static_cast<const GeoDataLatLonBox*>( node );
27 
28  writer.writeStartElement( kml::kmlTag_LatLonBox );
29  KmlObjectTagWriter::writeIdentifiers( writer, lat_lon_box );
30 
31  writer.writeTextElement( "north",
32  QString::number(lat_lon_box->north( GeoDataCoordinates::Degree )) );
33  writer.writeTextElement( "south",
34  QString::number(lat_lon_box->south( GeoDataCoordinates::Degree )) );
35  writer.writeTextElement( "east",
36  QString::number(lat_lon_box->east( GeoDataCoordinates::Degree )) );
37  writer.writeTextElement( "west",
38  QString::number(lat_lon_box->west( GeoDataCoordinates::Degree )) );
39  writer.writeOptionalElement( "rotation",
40  QString::number(lat_lon_box->rotation( GeoDataCoordinates::Degree )), "0" );
41 
42  writer.writeEndElement();
43 
44  return true;
45 }
46 
47 }
48 
49 
QString number(int n, int base)
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Definition: GeoTagWriter.h:44
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.