Marble

KmlOverlayTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#include "KmlOverlayTagWriter.h"
7
8#include "GeoDataTypes.h"
9#include "GeoDataOverlay.h"
10#include "GeoWriter.h"
11#include "KmlElementDictionary.h"
12#include "KmlColorStyleTagWriter.h"
13
14namespace Marble
15{
16
17KmlOverlayTagWriter::KmlOverlayTagWriter(const QString &elementName)
18 : KmlFeatureTagWriter( elementName )
19{
20 // nothing to do
21}
22
23bool KmlOverlayTagWriter::writeMid( const Marble::GeoNode *node, GeoWriter &writer ) const
24{
25 GeoDataOverlay const *overlay = static_cast<const GeoDataOverlay*>(node);
26
27 QString const color = KmlColorStyleTagWriter::formatColor( overlay->color() );
28 writer.writeOptionalElement( kml::kmlTag_color, color, "ffffffff" );
29 QString const drawOrder = QString::number( overlay->drawOrder() );
30 writer.writeOptionalElement( kml::kmlTag_drawOrder, drawOrder, "0" );
31
32 if ( !overlay->iconFile().isEmpty() ) {
33 writer.writeStartElement( kml::kmlTag_Icon );
34 writer.writeStartElement( kml::kmlTag_href );
35 writer.writeCharacters( overlay->iconFile() );
36 writer.writeEndElement();
37 writer.writeEndElement();
38 }
39
40 return true;
41}
42
43}
A shared base class for all classes that are mapped to a specific tag (ie.
Definition GeoDocument.h:35
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 Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.