[Marble-commits] KDE/kdeedu/marble/src/lib/geodata/handlers/gpx
tackat at t-online.de
tackat at t-online.de
Mon Jun 7 22:04:01 CEST 2010
Please ... Never use Qt-colors for Marble! Not even temporarily! Use the normal Oxygen palette instead! Thanks.
-Urspr. Mitteilung-
Betreff: [Marble-commits] KDE/kdeedu/marble/src/lib/geodata/handlers/gpx
Von: Thibaut Gridel <tgridel at free.fr>
Datum: 07.06.2010 21:13
SVN commit 1135618 by tgridel:
gpx: set a green track in the kml styling for now
M +16 -0 GPXgpxTagHandler.cpp
M +1 -0 GPXtrkTagHandler.cpp
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/gpx/GPXgpxTagHandler.cpp #1135617:1135618
@@ -27,6 +27,8 @@
#include "GeoDataParser.h"
#include "GeoDataDocument.h"
+#include "GeoDataStyle.h"
+#include "GeoDataStyleMap.h"
namespace Marble
{
@@ -37,6 +39,20 @@
GeoNode* GPXgpxTagHandler::parse(GeoParser& parser) const
{
GeoDataDocument* doc = geoDataDoc( parser );
+
+ GeoDataStyle *style = new GeoDataStyle();
+ GeoDataLineStyle lineStyle;
+ lineStyle.setColor(Qt::green);
+ lineStyle.setWidth(2);
+ style->setLineStyle(lineStyle);
+ style->setStyleId("track");
+
+ GeoDataStyleMap *styleMap = new GeoDataStyleMap();
+ styleMap->setStyleId("map-track");
+ styleMap->insert("normal", QString("#").append(style->styleId()));
+ doc->addStyleMap(*styleMap);
+ doc->addStyle(*style);
+
#ifdef DEBUG_TAGS
mDebug() << "Parsed <" << gpxTag_gpx << "> document: " << doc;
#endif
--- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/gpx/GPXtrkTagHandler.cpp #1135617:1135618
@@ -44,6 +44,7 @@
GeoDataPlacemark placemark;
GeoDataMultiGeometry multigeometry;
placemark.setGeometry(multigeometry);
+ placemark.setStyleUrl("#map-track");
doc->append(placemark);
#ifdef DEBUG_TAGS
_______________________________________________
Marble-commits mailing list
Marble-commits at kde.org
https://mail.kde.org/mailman/listinfo/marble-commits
More information about the Marble-commits
mailing list