Marble

KmlSchemaDataTagWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2014 Abhinav Gangwar <[email protected]>
4 //
5 
6 #include "KmlSchemaDataTagWriter.h"
7 
8 #include <QString>
9 
10 #include "KmlElementDictionary.h"
11 
12 #include "GeoWriter.h"
13 
14 #include "GeoDataTypes.h"
15 
16 #include "GeoDataSchemaData.h"
17 #include "GeoDataSimpleData.h"
18 
19 namespace Marble
20 {
21 
22 static GeoTagWriterRegistrar s_writerSchemaData(
23  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataSchemaDataType,
24  kml::kmlTag_nameSpaceOgc22 ),
25  new KmlSchemaDataTagWriter );
26 
27 bool KmlSchemaDataTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
28 {
29  const GeoDataSchemaData *schemaData = static_cast<const GeoDataSchemaData*>( node );
30  writer.writeStartElement( kml::kmlTag_SchemaData );
31  QString schemaUrl = schemaData->schemaUrl();
32  writer.writeAttribute( "schemaUrl", schemaUrl );
33 
34  for( const GeoDataSimpleData& data: schemaData->simpleDataList() ) {
35  writeElement( &data, writer );
36  }
37  writer.writeEndElement();
38 
39  return true;
40 }
41 
42 }
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 Wed Oct 4 2023 04:09:42 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.