Marble
7#include "DgmlGeodataTagHandler.h"
11#include "MarbleDebug.h"
13#include "DgmlAttributeDictionary.h"
14#include "DgmlAuxillaryDictionary.h"
15#include "DgmlElementDictionary.h"
17#include "GeoSceneDocument.h"
18#include "GeoSceneGeodata.h"
19#include "GeoSceneLayer.h"
20#include "GeoSceneSettings.h"
27DGML_DEFINE_TAG_HANDLER(Geodata)
29GeoNode *DgmlGeodataTagHandler::parse(GeoParser &parser)
const
32 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(dgmlTag_Geodata)));
34 const QString
name = parser.attribute(dgmlAttr_name).
trimmed();
36 const QString
property = parser.attribute(dgmlAttr_property).
trimmed();
38 const QString colorize = parser.attribute(dgmlAttr_colorize).
trimmed();
40 const QString expireStr = parser.attribute(dgmlAttr_expire).
trimmed();
41 int expire = std::numeric_limits<int>::max();
43 expire = expireStr.
toInt();
45 GeoSceneGeodata *dataSource =
nullptr;
48 GeoStackItem parentItem = parser.parentElement();
52 if (parentItem.represents(dgmlTag_Layer) && parentItem.nodeAs<GeoSceneLayer>()->backend() ==
QString::fromLatin1(dgmlValue_geodata)) {
53 dataSource =
new GeoSceneGeodata(name);
54 dataSource->setProperty(property);
55 dataSource->setColorize(colorize);
56 dataSource->setExpire(expire);
57 parentItem.nodeAs<GeoSceneLayer>()->addDataset(dataSource);
QString name(StandardAction id)
Binds a QML item to a specific geodetic location in screen coordinates.
QString fromLatin1(QByteArrayView str)
bool isEmpty() const const
int toInt(bool *ok, int base) const const
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:09 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.