From 31cca05fc6a9d08d3b0028149f7ef2f2348b18e9 Mon Sep 17 00:00:00 2001 From: ryanhamley Date: Thu, 30 Aug 2018 17:18:29 -0700 Subject: Port symbol-z-order symbol layout style-spec property to Native --- src/mbgl/layout/symbol_layout.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mbgl/layout/symbol_layout.cpp') diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index 344a76bbe9..74abd74f01 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -401,10 +401,11 @@ std::vector CalculateTileDistances(const GeometryCoordinates& line, const } void SymbolLayout::createBucket(const ImagePositions&, std::unique_ptr&, std::unordered_map>& buckets, const bool firstLoad, const bool showCollisionBoxes) { - const bool mayOverlap = layout.get() || layout.get() || - layout.get() || layout.get(); + const bool zOrderByViewport = layout.get() == SymbolZOrderType::ViewportY; + const bool sortFeaturesByY = zOrderByViewport && (layout.get() || layout.get() || + layout.get() || layout.get()); - auto bucket = std::make_shared(layout, layerPaintProperties, textSize, iconSize, zoom, sdfIcons, iconsNeedLinear, mayOverlap, bucketLeaderID, std::move(symbolInstances)); + auto bucket = std::make_shared(layout, layerPaintProperties, textSize, iconSize, zoom, sdfIcons, iconsNeedLinear, sortFeaturesByY, bucketLeaderID, std::move(symbolInstances)); for (SymbolInstance &symbolInstance : bucket->symbolInstances) { -- cgit v1.2.1