summaryrefslogtreecommitdiff
path: root/src/mbgl/map/tile_worker.hpp
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2016-01-13 21:39:42 -0800
committerAnsis Brammanis <brammanis@gmail.com>2016-01-14 17:51:29 -0800
commite44db93f1cb3276dcdc7de8400ca96beda1b1d30 (patch)
treee3c8397172664c099a61c4b5787380859317c7d1 /src/mbgl/map/tile_worker.hpp
parent15f4ca51f919758a0c99951881edd1e49a6a179b (diff)
downloadqtlocation-mapboxgl-e44db93f1cb3276dcdc7de8400ca96beda1b1d30.tar.gz
[core] place symbol layers in correct order
Previously, the placement of symbols depended on the order in which the glyphs they need were loaded. The placement order should be based on the style. To fix this, symbol layers are placed in `placementPending` after they are parsed. After all layers are parsed, symbol layers (stored in `placementPending`) are placed and returned.
Diffstat (limited to 'src/mbgl/map/tile_worker.hpp')
-rw-r--r--src/mbgl/map/tile_worker.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mbgl/map/tile_worker.hpp b/src/mbgl/map/tile_worker.hpp
index 74894a9eb8..a5e892e2b6 100644
--- a/src/mbgl/map/tile_worker.hpp
+++ b/src/mbgl/map/tile_worker.hpp
@@ -53,7 +53,7 @@ public:
const GeometryTile&,
PlacementConfig);
- TileParseResult parsePendingLayers();
+ TileParseResult parsePendingLayers(PlacementConfig);
void redoPlacement(const std::unordered_map<std::string, std::unique_ptr<Bucket>>*,
PlacementConfig);
@@ -61,6 +61,7 @@ public:
private:
void parseLayer(const StyleLayer*, const GeometryTile&);
void insertBucket(const std::string& name, std::unique_ptr<Bucket>);
+ void placeLayers(PlacementConfig);
const TileID id;
const std::string sourceID;
@@ -74,12 +75,15 @@ private:
bool partialParse = false;
std::vector<std::unique_ptr<StyleLayer>> layers;
- std::unique_ptr<CollisionTile> collisionTile;
// Contains buckets that we couldn't parse so far due to missing resources.
// They will be attempted on subsequent parses.
std::list<std::pair<const SymbolLayer*, std::unique_ptr<Bucket>>> pending;
+ // Contains buckets that have been parsed, but still need placement.
+ // They will be placed when all buckets have been parsed.
+ std::unordered_map<std::string, std::unique_ptr<Bucket>> placementPending;
+
// Temporary holder
TileParseResultBuckets result;
};