Marble

KmlFlyToTagHandler.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
4
5#include "KmlFlyToTagHandler.h"
6#include "GeoDataFlyTo.h"
7#include "GeoDataPlaylist.h"
8#include "GeoParser.h"
9#include "KmlElementDictionary.h"
10#include "KmlObjectTagHandler.h"
11
12namespace Marble
13{
14namespace kml
15{
16
17KML_DEFINE_TAG_HANDLER_GX22(FlyTo)
18
19GeoNode *KmlFlyToTagHandler::parse(GeoParser &parser) const
20{
21 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(kmlTag_FlyTo)));
22
23 GeoStackItem parentItem = parser.parentElement();
24
25 if (parentItem.is<GeoDataPlaylist>()) {
26 auto flyTo = new GeoDataFlyTo;
27 KmlObjectTagHandler::parseIdentifiers(parser, flyTo);
28 parentItem.nodeAs<GeoDataPlaylist>()->addPrimitive(flyTo);
29 return flyTo;
30 }
31
32 return nullptr;
33}
34
35}
36}
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.