#include #include #include #include #include namespace mbgl { const style::LayerTypeInfo* LineLayerFactory::getTypeInfo() const noexcept { return style::LineLayer::Impl::staticTypeInfo(); } std::unique_ptr LineLayerFactory::createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept { const auto source = getSource(value); return std::unique_ptr(source ? new (std::nothrow) style::LineLayer(id, *source) : nullptr); } std::unique_ptr LineLayerFactory::createLayout( const LayoutParameters& parameters, std::unique_ptr layer, const std::vector>& group) noexcept { using namespace style; using LayoutTypeUnsorted = PatternLayout; using LayoutTypeSorted = PatternLayout; auto layerProperties = staticImmutableCast(group.front()); if (layerProperties->layerImpl().layout.get().isUndefined()) { return std::unique_ptr( new (std::nothrow) LayoutTypeUnsorted(parameters.bucketParameters, group, std::move(layer), parameters)); } return std::unique_ptr( new (std::nothrow) LayoutTypeSorted(parameters.bucketParameters, group, std::move(layer), parameters)); } std::unique_ptr LineLayerFactory::createRenderLayer(Immutable impl) noexcept { assert(impl->getTypeInfo() == getTypeInfo()); auto lineImpl = staticImmutableCast(impl); return std::unique_ptr(new (std::nothrow) RenderLineLayer(std::move(lineImpl))); } } // namespace mbgl