7#include "KmlStyleTagHandler.h"
9#include "MarbleDebug.h"
11#include "GeoDataDocument.h"
12#include "GeoDataFeature.h"
13#include "GeoDataStyle.h"
15#include "KmlElementDictionary.h"
16#include "KmlObjectTagHandler.h"
22KML_DEFINE_TAG_HANDLER(
Style)
24GeoNode *KmlStyleTagHandler::parse(GeoParser &parser)
const
26 Q_ASSERT(parser.isStartElement() && parser.isValidElement(
QLatin1StringView(kmlTag_Style)));
28 GeoStackItem parentItem = parser.parentElement();
30 if (parentItem.represents(kmlTag_Document)) {
31 GeoDataStyle::Ptr style(
new GeoDataStyle);
32 KmlObjectTagHandler::parseIdentifiers(parser, style.data());
33 parentItem.nodeAs<GeoDataDocument>()->addStyle(style);
34 return parentItem.nodeAs<GeoDataDocument>()->style(style->id()).data();
35 }
else if (parentItem.represents(kmlTag_Placemark)) {
36 GeoDataStyle::Ptr style(
new GeoDataStyle);
37 KmlObjectTagHandler::parseIdentifiers(parser, style.data());
38 parentItem.nodeAs<GeoDataFeature>()->setStyle(style);
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 Nov 8 2024 12:02:43 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.