#include #include #include #include #include #include namespace mbgl { std::unique_ptr LayerManager::createLayer( const std::string& type, const std::string& id, const style::conversion::Convertible& value, style::conversion::Error& error) noexcept { if (LayerFactory* factory = getFactory(type)) { auto layer = factory->createLayer(id, value); if (!layer) { error.message = "Error parsing a layer of type: " + type; } return layer; } error.message = "Unsupported layer type: " + type; return nullptr; } std::unique_ptr LayerManager::createRenderLayer(Immutable impl) noexcept { LayerFactory* factory = getFactory(impl->getTypeInfo()); assert(factory); return factory->createRenderLayer(std::move(impl)); } } // namespace mbgl