Marble
7#include "KmlHotSpotTagHandler.h"
9#include "GeoDataHotSpot.h"
10#include "GeoDataIconStyle.h"
12#include "KmlElementDictionary.h"
18KML_DEFINE_TAG_HANDLER(hotSpot)
20GeoNode *KmlhotSpotTagHandler::parse(GeoParser &parser)
const
22 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(kmlTag_hotSpot)));
24 GeoStackItem parentItem = parser.parentElement();
26 if (parentItem.represents(kmlTag_IconStyle)) {
27 QPointF pf(parser.attribute(
"x").trimmed().toFloat(), parser.attribute(
"y").trimmed().toFloat());
28 QString xu = parser.attribute(
"xunits").trimmed();
29 QString yu = parser.attribute(
"yunits").trimmed();
31 GeoDataHotSpot::Units xunits;
32 GeoDataHotSpot::Units yunits;
34 if (xu == QLatin1StringView(
"pixels")) {
35 xunits = GeoDataHotSpot::Pixels;
36 }
else if (xu == QLatin1StringView(
"insetPixels")) {
37 xunits = GeoDataHotSpot::InsetPixels;
39 xunits = GeoDataHotSpot::Fraction;
42 if (yu == QLatin1StringView(
"pixels")) {
43 yunits = GeoDataHotSpot::Pixels;
44 }
else if (yu == QLatin1StringView(
"insetPixels")) {
45 yunits = GeoDataHotSpot::InsetPixels;
47 yunits = GeoDataHotSpot::Fraction;
50 parentItem.nodeAs<GeoDataIconStyle>()->setHotSpot(pf, xunits, yunits);
Binds a QML item to a specific geodetic location in screen coordinates.
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.