summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/heatmap_layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/layers/heatmap_layer.cpp')
-rw-r--r--src/mbgl/style/layers/heatmap_layer.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mbgl/style/layers/heatmap_layer.cpp b/src/mbgl/style/layers/heatmap_layer.cpp
index b85cbf5f40..2201a39c8b 100644
--- a/src/mbgl/style/layers/heatmap_layer.cpp
+++ b/src/mbgl/style/layers/heatmap_layer.cpp
@@ -374,5 +374,24 @@ Mutable<Layer::Impl> HeatmapLayer::mutableBaseImpl() const {
return staticMutableCast<Layer::Impl>(mutableImpl());
}
+HeatmapLayerFactory::~HeatmapLayerFactory() = default;
+
+const char* HeatmapLayerFactory::type() const {
+ return "heatmap";
+}
+
+std::unique_ptr<style::Layer> HeatmapLayerFactory::createLayer(const std::string& id, const conversion::Convertible& value) {
+ optional<std::string> source = getSource(value);
+ if (!source) {
+ return nullptr;
+ }
+
+ std::unique_ptr<style::Layer> layer = std::unique_ptr<style::Layer>(new HeatmapLayer(id, *source));
+ if (!initSourceLayerAndFilter(layer.get(), value)) {
+ return nullptr;
+ }
+ return layer;
+}
+
} // namespace style
} // namespace mbgl