Marble

DgmlLayerTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2011 Utku Aydın <utkuaydin34@gmail.com>
4//
5
6#include "DgmlLayerTagWriter.h"
7
8#include "GeoSceneTypes.h"
9#include "GeoWriter.h"
10#include "GeoSceneAbstractDataset.h"
11#include "GeoSceneLayer.h"
12#include "DgmlElementDictionary.h"
13
14namespace Marble
15{
16
17static GeoTagWriterRegistrar s_writerLayer( GeoTagWriter::QualifiedName( GeoSceneTypes::GeoSceneLayerType, dgml::dgmlTag_nameSpace20 ),
18 new DgmlLayerTagWriter() );
19
20bool DgmlLayerTagWriter::write(const GeoNode *node, GeoWriter& writer) const
21{
22 const GeoSceneLayer *layer = static_cast<const GeoSceneLayer*>( node );
23 writer.writeStartElement( dgml::dgmlTag_Layer );
24 writer.writeAttribute( "name", layer->name() );
25 writer.writeAttribute( "backend", layer->backend() );
26 if( !layer->role().isEmpty() )
27 {
28 writer.writeAttribute( "role", layer->role() );
29 }
30
31 for( int i = 0; i < layer->datasets().count(); ++i )
32 {
33 writeElement( layer->datasets().at( i ), writer );
34 }
35
36 writer.writeEndElement();
37 return true;
38}
39
40}
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 7 2024 12:03:13 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.