Marble

KmlMarblePlacemarkTagHandler.cpp
1/*
2 SPDX-FileCopyrightText: 2008 Patrick Spendrin <ps_ml@gmx.de>
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 "GeoDataContainer.h"
15#include "GeoDataPlacemark.h"
16#include "GeoParser.h"
17
18namespace Marble
19{
20namespace kml
21{
22KML_DEFINE_TAG_HANDLER(MarblePlacemark)
23
24GeoNode *KmlMarblePlacemarkTagHandler::parse(GeoParser &parser) const
25{
26 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(kmlTag_MarblePlacemark)));
27
28 GeoStackItem parentItem = parser.parentElement();
29
30 if (parentItem.represents(kmlTag_Folder) || parentItem.represents(kmlTag_Document)) {
31 auto placemark = new GeoDataPlacemark;
32 parentItem.nodeAs<GeoDataContainer>()->append(placemark);
33 return placemark;
34
35 } else {
36 return nullptr;
37 }
38}
39
40}
41}
42
43#endif
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 Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.