diff options
Diffstat (limited to 'src/mbgl/layermanager/location_indicator_layer_factory.cpp')
-rw-r--r-- | src/mbgl/layermanager/location_indicator_layer_factory.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mbgl/layermanager/location_indicator_layer_factory.cpp b/src/mbgl/layermanager/location_indicator_layer_factory.cpp new file mode 100644 index 0000000000..67f7280e93 --- /dev/null +++ b/src/mbgl/layermanager/location_indicator_layer_factory.cpp @@ -0,0 +1,25 @@ +#include <mbgl/layermanager/location_indicator_layer_factory.hpp> + +#include <mbgl/renderer/layers/render_location_indicator_layer.hpp> +#include <mbgl/style/layers/location_indicator_layer.hpp> +#include <mbgl/style/layers/location_indicator_layer_impl.hpp> + +namespace mbgl { + +const style::LayerTypeInfo* LocationIndicatorLayerFactory::getTypeInfo() const noexcept { + return style::LocationIndicatorLayer::Impl::staticTypeInfo(); +} + +std::unique_ptr<style::Layer> LocationIndicatorLayerFactory::createLayer( + const std::string& id, const style::conversion::Convertible&) noexcept { + return std::unique_ptr<style::Layer>(new style::LocationIndicatorLayer(id)); +} + +std::unique_ptr<RenderLayer> LocationIndicatorLayerFactory::createRenderLayer( + Immutable<style::Layer::Impl> impl) noexcept { + assert(impl->getTypeInfo() == getTypeInfo()); + return std::make_unique<RenderLocationIndicatorLayer>( + staticImmutableCast<style::LocationIndicatorLayer::Impl>(impl)); +} + +} // namespace mbgl |