Marble

KmlIconTagHandler.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#include "KmlIconTagHandler.h"
8
9#include "MarbleDebug.h"
10
11#include "GeoDataGroundOverlay.h"
12#include "GeoDataIconStyle.h"
13#include "GeoDataPhotoOverlay.h"
14#include "GeoDataScreenOverlay.h"
15#include "GeoParser.h"
16#include "KmlElementDictionary.h"
17
18namespace Marble
19{
20namespace kml
21{
22KML_DEFINE_TAG_HANDLER(Icon)
23
24GeoNode *KmlIconTagHandler::parse(GeoParser &parser) const
25{
26 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(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-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.