diff --git a/gpxsee.qrc b/gpxsee.qrc index a42c6007..0c5d86cb 100644 --- a/gpxsee.qrc +++ b/gpxsee.qrc @@ -55,6 +55,11 @@ icons/GUI/transform-move_32@2x.png + + + icons/map/arrow.png + + icons/map/POI/airfield-11.png diff --git a/icons/map/arrow.png b/icons/map/arrow.png new file mode 100644 index 00000000..db82e180 Binary files /dev/null and b/icons/map/arrow.png differ diff --git a/src/map/IMG/mapdata.h b/src/map/IMG/mapdata.h index 7959cf2f..2d523f04 100644 --- a/src/map/IMG/mapdata.h +++ b/src/map/IMG/mapdata.h @@ -25,6 +25,8 @@ class MapData { public: struct Poly { + Poly() : oneway(false) {} + /* QPointF insted of Coordinates for performance reasons (no need to duplicate all the vectors for drawing). Note, that we do not want to ll2xy() the points in the MapData class as this can not be done in @@ -34,6 +36,7 @@ public: Raster raster; quint32 type; RectC boundingRect; + bool oneway; bool operator<(const Poly &other) const {return type > other.type;} diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index a382c28d..dfecb211 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -25,6 +25,12 @@ static const QColor shieldBgColor1("#dd3e3e"); static const QColor shieldBgColor2("#379947"); static const QColor shieldBgColor3("#4a7fc1"); +static const QImage *arrow() +{ + static QImage img(":/map/arrow.png"); + return &img; +} + static QFont pixelSizeFont(int pixelSize) { QFont f; @@ -327,14 +333,25 @@ void RasterTile::processStreetNames(const QList &lines, const QFont *fnt = font(style.textFontSize(), Style::Small); const QColor *color = style.textColor().isValid() ? &style.textColor() : 0; + const QColor *hColor = Style::isContourLine(poly.type) ? 0 : &haloColor; + const QImage *img = poly.oneway ? arrow() : 0; TextPathItem *item = new TextPathItem(poly.points, - &poly.label.text(), _rect, fnt, color, Style::isContourLine(poly.type) - ? 0 : &haloColor); + &poly.label.text(), _rect, fnt, color, hColor, img); if (item->isValid() && !item->collides(textItems)) textItems.append(item); - else + else { delete item; + + if (img) { + TextPathItem *item = new TextPathItem(poly.points, 0, _rect, 0, + 0, 0, img); + if (item->isValid() && !item->collides(textItems)) + textItems.append(item); + else + delete item; + } + } } } diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index 4b60accf..5a425677 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -292,6 +292,8 @@ bool RGNFile::polyObjects(Handle &hdl, const SubDiv *subdiv, poly.type = (segmentType == Polygon) ? ((quint32)(type & 0x7F)) << 8 : ((quint32)(type & 0x3F)) << 8; + if (segmentType == Line && type & 0x40) + poly.oneway = true; QPoint pos(subdiv->lon() + LS(lon, 24-subdiv->bits()),