Marble

KmlMarblePlacemarkTagHandler.cpp
1 /*
2  SPDX-FileCopyrightText: 2008 Patrick Spendrin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifdef KML_LAZY_IMP
8 #include "KmlMarblePlacemarkTagHandler.h"
9 
10 #include "MarbleDebug.h"
11 
12 #include "KmlElementDictionary.h"
13 
14 #include "GeoParser.h"
15 #include "GeoDataPlacemark.h"
16 #include "GeoDataContainer.h"
17 
18 namespace Marble
19 {
20 namespace kml
21 {
22 KML_DEFINE_TAG_HANDLER( MarblePlacemark )
23 
24 GeoNode* KmlMarblePlacemarkTagHandler::parse( GeoParser& parser ) const
25 {
26  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_MarblePlacemark)));
27 
28 
29  GeoStackItem parentItem = parser.parentElement();
30 
31  if( parentItem.represents( kmlTag_Folder ) || parentItem.represents( kmlTag_Document ) ) {
32  GeoDataPlacemark *placemark = new GeoDataPlacemark;
33  parentItem.nodeAs<GeoDataContainer>()->append( placemark );
34  return placemark;
35 
36  } else {
37  return nullptr;
38  }
39 }
40 
41 }
42 }
43 
44 #endif
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 Thu Sep 21 2023 04:12:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.