Introduce the style::Layer factory classes
This patch introduces the initial implementation of - A `LayerFactory` abstract class that creates `style::Layer` instances of a certain layer type (line, hillshade, round, ..) - A singleton `LayerManager` class, which is responsible for initializing the `LayerFactory` instances and forwarding the `create()` calls to the corresponding factory.
This commit is contained in:
@@ -270,5 +270,16 @@ Mutable<Layer::Impl> BackgroundLayer::mutableBaseImpl() const {
|
||||
return staticMutableCast<Layer::Impl>(mutableImpl());
|
||||
}
|
||||
|
||||
BackgroundLayerFactory::~BackgroundLayerFactory() = default;
|
||||
|
||||
const char* BackgroundLayerFactory::type() const {
|
||||
return "background";
|
||||
}
|
||||
|
||||
std::unique_ptr<style::Layer> BackgroundLayerFactory::createLayer(const std::string& id, const conversion::Convertible& value) {
|
||||
(void)value;
|
||||
return std::unique_ptr<style::Layer>(new BackgroundLayer(id));
|
||||
}
|
||||
|
||||
} // namespace style
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user