Marble

KmlLocationTagHandler.cpp
1
2// SPDX-License-Identifier: LGPL-2.1-or-later
3//
4// SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <sanjiban22393@gmail.com>
5//
6
7#include "KmlLocationTagHandler.h"
8
9#include "MarbleDebug.h"
10
11#include "KmlElementDictionary.h"
12#include "KmlObjectTagHandler.h"
13#include "GeoDataLocation.h"
14#include "GeoDataGeometry.h"
15#include "GeoDataModel.h"
16#include "GeoDataParser.h"
17
18namespace Marble
19{
20namespace kml
21{
22KML_DEFINE_TAG_HANDLER( Location )
23
24GeoNode* KmlLocationTagHandler::parse( GeoParser& parser ) const
25{
26 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_Location)));
27
28 GeoDataLocation location;
29 KmlObjectTagHandler::parseIdentifiers( parser, &location );
30 GeoStackItem parentItem = parser.parentElement();
31
32 if( parentItem.represents( kmlTag_Model ) ) {
33 parentItem.nodeAs<GeoDataModel>()->setLocation(location);
34 return &parentItem.nodeAs<GeoDataModel>()->location();
35 }
36 else{
37 return nullptr;
38 }
39}
40
41}
42}
QVariant location(const QVariant &res)
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 Fri Jun 21 2024 12:00:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.