diff --git a/src/map/mapsforge/mapdata.cpp b/src/map/mapsforge/mapdata.cpp index 0908e841..a3ae938a 100644 --- a/src/map/mapsforge/mapdata.cpp +++ b/src/map/mapsforge/mapdata.cpp @@ -613,8 +613,8 @@ bool MapData::readPaths(const VectorTile *tile, int zoom, QList *list) paths.reserve(paths[zoom - info.min]); for (unsigned i = 0; i < paths[zoom - info.min]; i++) { - Path p; qint32 lon = 0, lat = 0; + Path p(subfile.pos()); if (!(subfile.readVUInt32(unused) && subfile.readUInt16(bitmap) && subfile.readByte(sb))) diff --git a/src/map/mapsforge/mapdata.h b/src/map/mapsforge/mapdata.h index f1043a16..49b1459a 100644 --- a/src/map/mapsforge/mapdata.h +++ b/src/map/mapsforge/mapdata.h @@ -46,6 +46,9 @@ public: }; struct Path { + Path(quint64 id) : id(id) {} + + quint64 id; Polygon poly; QVector tags; Coordinates labelPos; diff --git a/src/map/mapsforge/rastertile.cpp b/src/map/mapsforge/rastertile.cpp index 04d0314d..70843960 100644 --- a/src/map/mapsforge/rastertile.cpp +++ b/src/map/mapsforge/rastertile.cpp @@ -16,9 +16,10 @@ using namespace Mapsforge; static double LIMIT = cos(deg2rad(170)); -static bool rectNearPolygon(const QPainterPath &path, const QRectF &rect) +static bool rectNearPolygon(const QRectF &tileRect, const QPainterPath &path, + const QRectF &rect) { - return (path.boundingRect().contains(rect) + return ((tileRect.contains(rect) || path.boundingRect().contains(rect)) && (path.contains(rect.topLeft()) || path.contains(rect.topRight()) || path.contains(rect.bottomLeft()) || path.contains(rect.bottomRight()))); } @@ -100,12 +101,14 @@ static QPainterPath parallelPath(const QPainterPath &p, double dy) return h; } -void RasterTile::processPointLabels(const QList &points, - QList &textItems) const +void RasterTile::processLabels(const QList &points, + const QVector &paths, QList &textItems) const { - QList labels(_style->pointLabels(_zoom)); - QList symbols(_style->pointSymbols(_zoom)); - QList items; + QList