From ee20b02dfa184be35fb185897f0fdcd4ac8ee22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 17 Nov 2024 17:11:14 +0100 Subject: [PATCH] Better POI id --- src/map/mapsforge/mapdata.cpp | 5 +++-- src/map/mapsforge/mapdata.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/map/mapsforge/mapdata.cpp b/src/map/mapsforge/mapdata.cpp index 89d66857..0908e841 100644 --- a/src/map/mapsforge/mapdata.cpp +++ b/src/map/mapsforge/mapdata.cpp @@ -697,11 +697,12 @@ bool MapData::readPoints(const VectorTile *tile, int zoom, QList *list) for (unsigned i = 0; i < points[zoom - info.min]; i++) { qint32 lat, lon; + Point p(subfile.pos()); if (!(subfile.readVInt32(lat) && subfile.readVInt32(lon))) return false; - Point p(Coordinates(tile->pos.lon() + MD(lon), - tile->pos.lat() + MD(lat))); + p.coordinates = Coordinates(tile->pos.lon() + MD(lon), + tile->pos.lat() + MD(lat)); if (!subfile.readByte(sb)) return false; diff --git a/src/map/mapsforge/mapdata.h b/src/map/mapsforge/mapdata.h index 7ebf37ad..f1043a16 100644 --- a/src/map/mapsforge/mapdata.h +++ b/src/map/mapsforge/mapdata.h @@ -37,7 +37,7 @@ public: }; struct Point { - Point(const Coordinates &c) : id(qHash(c)), coordinates(c) {} + Point(quint64 id) : id(id) {} quint64 id; Coordinates coordinates;