Marble

KmlFlyToTagHandler.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Mayank Madan <[email protected]>
4 
5 #include "KmlFlyToTagHandler.h"
6 #include "KmlObjectTagHandler.h"
7 #include "GeoDataFlyTo.h"
8 #include "GeoDataPlaylist.h"
9 #include "GeoParser.h"
10 #include "MarbleDebug.h"
11 #include "KmlElementDictionary.h"
12 
13 namespace Marble
14 {
15 namespace kml
16 {
17 
18 KML_DEFINE_TAG_HANDLER_GX22( FlyTo )
19 
20 GeoNode* KmlFlyToTagHandler::parse( GeoParser& parser ) const
21 {
22  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_FlyTo)));
23 
24  GeoStackItem parentItem = parser.parentElement();
25 
26  if (parentItem.is<GeoDataPlaylist>()) {
27  GeoDataFlyTo *flyTo = new GeoDataFlyTo;
28  KmlObjectTagHandler::parseIdentifiers( parser, flyTo );
29  parentItem.nodeAs<GeoDataPlaylist>()->addPrimitive( flyTo );
30  return flyTo;
31  }
32 
33  return nullptr;
34 }
35 
36 }
37 }
38 
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 Sep 25 2023 03:50:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.