Marble

KmlDataTagWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Gaurav Gupta <[email protected]>
4 //
5 
6 
7 #include "KmlDataTagWriter.h"
8 
9 #include "GeoDataTypes.h"
10 #include "GeoWriter.h"
11 #include "KmlElementDictionary.h"
12 #include "GeoDataData.h"
13 
14 namespace Marble
15 {
16 
17 static GeoTagWriterRegistrar s_writerData( GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataDataType,
18  kml::kmlTag_nameSpaceOgc22 ),
19  new KmlDataTagWriter() );
20 
21 
22 bool KmlDataTagWriter::write( const GeoNode *node,
23  GeoWriter& writer ) const
24 {
25  const GeoDataData *data = static_cast<const GeoDataData*>( node );
26 
27  writer.writeStartElement( kml::kmlTag_Data );
28  writer.writeAttribute( "name", data->name() );
29  writer.writeOptionalElement( kml::kmlTag_displayName, data->displayName() );
30  writer.writeElement( "value", data->value().toString() );
31  writer.writeEndElement();
32 
33  return true;
34 }
35 
36 }
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 Mon Oct 2 2023 03:52:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.