Marble

KmlIconTagHandler.cpp
1 /*
2  SPDX-FileCopyrightText: 2008 Patrick Spendrin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "KmlIconTagHandler.h"
8 
9 #include "MarbleDebug.h"
10 
11 #include "KmlElementDictionary.h"
12 #include "GeoDataIconStyle.h"
13 #include "GeoDataGroundOverlay.h"
14 #include "GeoDataPhotoOverlay.h"
15 #include "GeoDataScreenOverlay.h"
16 #include "GeoParser.h"
17 
18 namespace Marble
19 {
20 namespace kml
21 {
22 KML_DEFINE_TAG_HANDLER( Icon )
23 
24 GeoNode* KmlIconTagHandler::parse( GeoParser& parser ) const
25 {
26  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_Icon)));
27 
28  GeoStackItem parentItem = parser.parentElement();
29 
30  if ( parentItem.represents( kmlTag_IconStyle ) ) {
31  return parentItem.nodeAs<GeoDataIconStyle>();
32  } else if ( parentItem.represents( kmlTag_GroundOverlay ) ) {
33  return parentItem.nodeAs<GeoDataGroundOverlay>();
34  } else if ( parentItem.represents( kmlTag_PhotoOverlay ) ) {
35  return parentItem.nodeAs<GeoDataPhotoOverlay>();
36  } else if ( parentItem.represents( kmlTag_ScreenOverlay ) ) {
37  return parentItem.nodeAs<GeoDataScreenOverlay>();
38  }
39  return nullptr;
40 }
41 
42 }
43 }
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:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.