Marble

KmlNetworkLinkTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Adrian Draghici <draghici.adrian.b@gmail.com>
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
14namespace Marble
15{
16
17static GeoTagWriterRegistrar s_writerNetworkLink(
18 GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataNetworkLinkType,
19 kml::kmlTag_nameSpaceOgc22 ),
20 new KmlNetworkLinkTagWriter );
21
22bool 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}
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.
QString number(double n, char format, int precision)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:49:24 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.