From 75ed16f3db666177525ead4af2273ef09062733e Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Mon, 30 Oct 2017 11:07:56 -0700 Subject: Store sourceID in IndexedSubfeature so that queryRenderedSymbols can filter to appropriate source. TODO: should sourceID have a stronger type than std::string? --- src/mbgl/layout/symbol_layout.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 c18b800c21..58c06aa923 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -179,7 +179,7 @@ bool SymbolLayout::hasSymbolInstances() const { void SymbolLayout::prepare(const GlyphMap& glyphMap, const GlyphPositions& glyphPositions, const ImageMap& imageMap, const ImagePositions& imagePositions, - const OverscaledTileID& tileID) { + const OverscaledTileID& tileID, const std::string& sourceID) { const bool textAlongLine = layout.get() == AlignmentType::Map && layout.get() == SymbolPlacementType::Line; @@ -248,7 +248,7 @@ void SymbolLayout::prepare(const GlyphMap& glyphMap, const GlyphPositions& glyph // if either shapedText or icon position is present, add the feature if (shapedTextOrientations.first || shapedIcon) { - addFeature(std::distance(features.begin(), it), feature, shapedTextOrientations, shapedIcon, glyphPositionMap, tileID); + addFeature(std::distance(features.begin(), it), feature, shapedTextOrientations, shapedIcon, glyphPositionMap, tileID, sourceID); } feature.geometry.clear(); @@ -262,7 +262,8 @@ void SymbolLayout::addFeature(const std::size_t index, const std::pair& shapedTextOrientations, optional shapedIcon, const GlyphPositionMap& glyphPositionMap, - const OverscaledTileID& tileID) { + const OverscaledTileID& tileID, + const std::string& sourceID) { const float minScale = 0.5f; const float glyphSize = 24.0f; @@ -293,7 +294,7 @@ void SymbolLayout::addFeature(const std::size_t index, ? SymbolPlacementType::Point : layout.get(); const float textRepeatDistance = symbolSpacing / 2; - IndexedSubfeature indexedFeature = { feature.index, sourceLayer->getName(), bucketName, + IndexedSubfeature indexedFeature = { feature.index, sourceID, sourceLayer->getName(), bucketName, symbolInstances.size(), tileID.canonical.z, tileID.canonical.x, tileID.canonical.y, tileID.overscaledZ, tileID.wrap }; auto addSymbolInstance = [&] (const GeometryCoordinates& line, Anchor& anchor) { -- cgit v1.2.1