summaryrefslogtreecommitdiff
path: root/src/mbgl/tile
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/tile')
-rw-r--r--src/mbgl/tile/geometry_tile.cpp23
-rw-r--r--src/mbgl/tile/geometry_tile.hpp2
-rw-r--r--src/mbgl/tile/tile.hpp4
3 files changed, 28 insertions, 1 deletions
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp
index 3087b4fc6a..8f624f21dc 100644
--- a/src/mbgl/tile/geometry_tile.cpp
+++ b/src/mbgl/tile/geometry_tile.cpp
@@ -387,4 +387,27 @@ void GeometryTile::performedFadePlacement() {
}
}
+void GeometryTile::setFeatureState(const LayerFeatureStates& states) {
+ auto layers = getData();
+ if (!layers || states.empty() || !layoutResult) return;
+
+ auto& layerIdToLayerRenderData = layoutResult->layerRenderData;
+ for (auto& layer : layerIdToLayerRenderData) {
+ const auto& layerID = layer.first;
+ const auto sourceLayer = layers->getLayer(layerID);
+ if (sourceLayer) {
+ const auto& sourceLayerID = sourceLayer->getName();
+ auto entry = states.find(sourceLayerID);
+ if (entry == states.end()) continue;
+ const auto& featureStates = entry->second;
+ if (featureStates.empty()) continue;
+
+ auto bucket = layer.second.bucket;
+ if (bucket && bucket->hasData()) {
+ bucket->update(featureStates, *sourceLayer, layerID, layoutResult->iconAtlas.patternPositions);
+ }
+ }
+ }
+}
+
} // namespace mbgl
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index 8682c8c76b..ca9e33218c 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -94,6 +94,8 @@ public:
const std::string sourceID;
+ void setFeatureState(const LayerFeatureStates&) override;
+
protected:
const GeometryTileData* getData() const;
LayerRenderData* getLayerRenderData(const style::Layer::Impl&);
diff --git a/src/mbgl/tile/tile.hpp b/src/mbgl/tile/tile.hpp
index 7a7d246aa6..65bff305a3 100644
--- a/src/mbgl/tile/tile.hpp
+++ b/src/mbgl/tile/tile.hpp
@@ -125,7 +125,9 @@ public:
// We hold onto a tile for two placements: fading starts with the first placement
// and will have time to finish by the second placement.
virtual void performedFadePlacement() {}
-
+
+ virtual void setFeatureState(const LayerFeatureStates&) {}
+
void dumpDebugLogs() const;
const Kind kind;