summaryrefslogtreecommitdiff
path: root/src/mbgl/layout/symbol_layout.cpp
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-10-30 11:07:56 -0700
committerChris Loer <chris.loer@gmail.com>2017-10-30 11:07:56 -0700
commit75ed16f3db666177525ead4af2273ef09062733e (patch)
tree83cce18300f240f98058d8f1c592556ad2581cc9 /src/mbgl/layout/symbol_layout.cpp
parent435ea703ca773e2ea266525e2d036ec6252a6f99 (diff)
downloadqtlocation-mapboxgl-75ed16f3db666177525ead4af2273ef09062733e.tar.gz
Store sourceID in IndexedSubfeature so that queryRenderedSymbols can filter to appropriate source.
TODO: should sourceID have a stronger type than std::string?
Diffstat (limited to 'src/mbgl/layout/symbol_layout.cpp')
-rw-r--r--src/mbgl/layout/symbol_layout.cpp9
1 files changed, 5 insertions, 4 deletions
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<TextRotationAlignment>() == AlignmentType::Map &&
layout.get<SymbolPlacement>() == 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<Shaping, Shaping>& shapedTextOrientations,
optional<PositionedIcon> 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<SymbolPlacement>();
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) {