7#include "KmlPolygonTagHandler.h"
9#include "MarbleDebug.h"
11#include "GeoDataMultiGeometry.h"
12#include "GeoDataPlacemark.h"
13#include "GeoDataPolygon.h"
14#include "KmlElementDictionary.h"
15#include "KmlObjectTagHandler.h"
23KML_DEFINE_TAG_HANDLER(Polygon)
25GeoNode *KmlPolygonTagHandler::parse(GeoParser &parser)
const
27 Q_ASSERT(parser.isStartElement() && parser.isValidElement(
QLatin1StringView(kmlTag_Polygon)));
29 GeoStackItem parentItem = parser.parentElement();
31 auto polygon =
new GeoDataPolygon;
32 KmlObjectTagHandler::parseIdentifiers(parser, polygon);
34 if (parentItem.represents(kmlTag_Placemark)) {
35 parentItem.nodeAs<GeoDataPlacemark>()->setGeometry(polygon);
36 return parentItem.nodeAs<GeoDataPlacemark>()->geometry();
38 }
else if (parentItem.represents(kmlTag_MultiGeometry)) {
39 parentItem.nodeAs<GeoDataMultiGeometry>()->append(polygon);
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 Dec 6 2024 12:08:53 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.