Marble
7 #include "DgmlGeodataTagHandler.h"
11 #include "MarbleDebug.h"
13 #include "DgmlElementDictionary.h"
14 #include "DgmlAttributeDictionary.h"
15 #include "DgmlAuxillaryDictionary.h"
16 #include "GeoParser.h"
17 #include "GeoSceneDocument.h"
18 #include "GeoSceneLayer.h"
19 #include "GeoSceneSettings.h"
20 #include "GeoSceneGeodata.h"
27 DGML_DEFINE_TAG_HANDLER(Geodata)
29 GeoNode* DgmlGeodataTagHandler::parse(GeoParser& parser)
const
32 Q_ASSERT(parser.isStartElement() && parser.isValidElement(
QLatin1String(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)
53 && parentItem.nodeAs<GeoSceneLayer>()->backend() == dgmlValue_geodata) {
54 dataSource =
new GeoSceneGeodata( name );
55 dataSource->setProperty( property );
56 dataSource->setColorize( colorize );
57 dataSource->setExpire( expire );
58 parentItem.nodeAs<GeoSceneLayer>()->addDataset( dataSource );
QString trimmed() const const
bool isEmpty() const const
int toInt(bool *ok, int base) const const
Binds a QML item to a specific geodetic location in screen coordinates.
const char * name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:25 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.