#include #include #include #include namespace mbgl { const style::LayerTypeInfo* RasterLayerFactory::getTypeInfo() const noexcept { return style::RasterLayer::Impl::staticTypeInfo(); } std::unique_ptr RasterLayerFactory::createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept { optional source = getSource(value); if (!source) { return nullptr; } std::unique_ptr layer = std::unique_ptr(new style::RasterLayer(id, *source)); return layer; } std::unique_ptr RasterLayerFactory::createRenderLayer(Immutable impl) noexcept { assert(impl->getTypeInfo() == getTypeInfo()); return std::make_unique(staticImmutableCast(impl)); } } // namespace mbgl