Marble

KmlStyleMapTagHandler.cpp
1 /*
2  SPDX-FileCopyrightText: 2008-2009 Patrick Spendrin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "KmlStyleMapTagHandler.h"
8 
9 #include "MarbleDebug.h"
10 
11 #include "KmlElementDictionary.h"
12 #include "KmlObjectTagHandler.h"
13 #include "GeoDataFeature.h"
14 #include "GeoDataDocument.h"
15 #include "GeoDataStyleMap.h"
16 
17 #include "GeoParser.h"
18 
19 namespace Marble
20 {
21 namespace kml
22 {
23 KML_DEFINE_TAG_HANDLER( StyleMap )
24 
25 GeoNode* KmlStyleMapTagHandler::parse( GeoParser& parser ) const
26 {
27  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_StyleMap)));
28 
29  GeoStackItem parentItem = parser.parentElement();
30 
31  if( parentItem.represents( kmlTag_Document ) ) {
32  GeoDataStyleMap styleMap;
33  KmlObjectTagHandler::parseIdentifiers( parser, &styleMap );
34  parentItem.nodeAs<GeoDataDocument>()->addStyleMap( styleMap );
35  return &parentItem.nodeAs<GeoDataDocument>()->styleMap( styleMap.id() );
36  } else if( parentItem.is<GeoDataFeature>() ) {
37 /* GeoDataStyleMap styleMap;
38  parentItem.nodeAs<GeoDataFeature>()->setStyleMap( styleMap );*/
39  }
40 
41  return nullptr;
42 }
43 
44 }
45 }
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 Wed Oct 4 2023 04:09:42 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.