Marble

KmlOverlayTagWriter.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2012 Dennis Nienhüser <[email protected]>
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 
14 namespace Marble
15 {
16 
17 KmlOverlayTagWriter::KmlOverlayTagWriter(const QString &elementName)
18  : KmlFeatureTagWriter( elementName )
19 {
20  // nothing to do
21 }
22 
23 bool 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 }
QString number(int n, int base)
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:34
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 Mon Sep 25 2023 03:50:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.