Marble
7 #include "KmlStyleTagHandler.h"
9 #include "MarbleDebug.h"
11 #include "KmlElementDictionary.h"
12 #include "KmlObjectTagHandler.h"
13 #include "GeoDataStyle.h"
14 #include "GeoDataFeature.h"
15 #include "GeoParser.h"
16 #include "GeoDataDocument.h"
22 KML_DEFINE_TAG_HANDLER( Style )
24 GeoNode* KmlStyleTagHandler::parse( GeoParser& parser )
const
26 Q_ASSERT(parser.isStartElement() && parser.isValidElement(
QLatin1String(kmlTag_Style)));
29 GeoStackItem parentItem = parser.parentElement();
31 if( parentItem.represents( kmlTag_Document ) ) {
32 GeoDataStyle::Ptr style(
new GeoDataStyle);
33 KmlObjectTagHandler::parseIdentifiers( parser, style.data() );
34 parentItem.nodeAs<GeoDataDocument>()->addStyle( style );
35 return parentItem.nodeAs<GeoDataDocument>()->style( style->id() ).data();
37 else if ( parentItem.represents( kmlTag_Placemark ) ) {
38 GeoDataStyle::Ptr style(
new GeoDataStyle);
39 KmlObjectTagHandler::parseIdentifiers( parser, style.data() );
40 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-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:09 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.