Marble

KmlNetworkLinkTagWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Adrian Draghici <[email protected]>
4 //
5 
6 #include "KmlNetworkLinkTagWriter.h"
7 
8 #include "GeoDataNetworkLink.h"
9 #include "GeoDataTypes.h"
10 #include "GeoDataLink.h"
11 #include "GeoWriter.h"
12 #include "KmlElementDictionary.h"
13 
14 namespace Marble
15 {
16 
17 static GeoTagWriterRegistrar s_writerNetworkLink(
18  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataNetworkLinkType,
19  kml::kmlTag_nameSpaceOgc22 ),
20  new KmlNetworkLinkTagWriter );
21 
22 bool KmlNetworkLinkTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
23 {
24 
25  const GeoDataNetworkLink *networkLink = static_cast<const GeoDataNetworkLink*>( node );
26 
27  writer.writeStartElement( kml::kmlTag_NetworkLink );
28 
29  writer.writeOptionalElement( kml::kmlTag_name, networkLink->name() );
30 
31  writer.writeOptionalElement( kml::kmlTag_visibility, QString::number( networkLink->isVisible() ), "1");
32 
33  writer.writeOptionalElement( kml::kmlTag_refreshVisibility, QString::number( networkLink->refreshVisibility() ), "0" );
34 
35  writer.writeOptionalElement( kml::kmlTag_flyToView, QString::number( networkLink->flyToView() ), "0" );
36 
37  writeElement( &networkLink->link(), writer);
38 
39  writer.writeEndElement();
40 
41  return true;
42 }
43 
44 }
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.