[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.
This commit is contained in:
Ansis Brammanis
2016-01-13 21:39:42 -08:00
parent 15f4ca51f9
commit e44db93f1c
9 changed files with 51 additions and 37 deletions

View File

@@ -102,7 +102,7 @@ bool VectorTileData::parsePending(std::function<void()> callback) {
}
workRequest.reset();
workRequest = worker.parsePendingGeometryTileLayers(tileWorker, [this, callback] (TileParseResult result) {
workRequest = worker.parsePendingGeometryTileLayers(tileWorker, targetConfig, [this, callback, config = targetConfig] (TileParseResult result) {
workRequest.reset();
if (state == State::obsolete) {
return;
@@ -118,6 +118,10 @@ bool VectorTileData::parsePending(std::function<void()> callback) {
buckets[bucket.first] = std::move(bucket.second);
}
// Persist the configuration we just placed so that we can later check whether we need to
// place again in case the configuration has changed.
placedConfig = config;
// The target configuration could have changed since we started placement. In this case,
// we're starting another placement run.
if (placedConfig != targetConfig) {