MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::LayerManager Class Referenceabstract

A singleton class responsible for creating layer instances. More...

#include <layer_manager.hpp>

Public Member Functions

std::unique_ptr< style::Layer > createLayer (const std::string &type, const std::string &id, const style::conversion::Convertible &value, style::conversion::Error &error) noexcept
 Returns a new Layer instance on success call; returns nullptr otherwise. More...
 
std::unique_ptr< RenderLayer > createRenderLayer (Immutable< style::Layer::Impl >) noexcept
 Returns a new RenderLayer instance on success call; returns nullptr otherwise. More...
 
std::unique_ptr< Bucket > createBucket (const BucketParameters &, const std::vector< Immutable< style::LayerProperties >> &) noexcept
 Returns a new Bucket instance on success call; returns nullptr otherwise. More...
 
std::unique_ptr< Layout > createLayout (const LayoutParameters &, std::unique_ptr< GeometryTileLayer >, const std::vector< Immutable< style::LayerProperties >> &) noexcept
 Returns a new Layout instance on success call; returns nullptr otherwise. More...
 

Static Public Member Functions

static LayerManagerget () noexcept
 A singleton getter. More...
 

Static Public Attributes

static const bool annotationsEnabled
 a build-time flag to enable/disable annotations in mapbox-gl-native core. More...
 

Protected Member Functions

virtual ~LayerManager ()=default
 
virtual LayerFactorygetFactory (const std::string &type) noexcept=0
 
virtual LayerFactorygetFactory (const style::LayerTypeInfo *) noexcept=0
 

Detailed Description

A singleton class responsible for creating layer instances.

The LayerManager has implementation per platform. The LayerManager implementation defines what layer types are available and it can also disable annotations.

Linker excludes the unreachable code for the disabled annotations and layers from the binaries, significantly reducing their size.

Definition at line 28 of file layer_manager.hpp.

Constructor & Destructor Documentation

◆ ~LayerManager()

virtual mbgl::LayerManager::~LayerManager ( )
protectedvirtualdefault

Member Function Documentation

◆ createBucket()

std::unique_ptr<Bucket> mbgl::LayerManager::createBucket ( const BucketParameters &  ,
const std::vector< Immutable< style::LayerProperties >> &   
)
noexcept

Returns a new Bucket instance on success call; returns nullptr otherwise.

◆ createLayer()

std::unique_ptr<style::Layer> mbgl::LayerManager::createLayer ( const std::string &  type,
const std::string &  id,
const style::conversion::Convertible value,
style::conversion::Error error 
)
noexcept

Returns a new Layer instance on success call; returns nullptr otherwise.

◆ createLayout()

std::unique_ptr<Layout> mbgl::LayerManager::createLayout ( const LayoutParameters &  ,
std::unique_ptr< GeometryTileLayer >  ,
const std::vector< Immutable< style::LayerProperties >> &   
)
noexcept

Returns a new Layout instance on success call; returns nullptr otherwise.

◆ createRenderLayer()

std::unique_ptr<RenderLayer> mbgl::LayerManager::createRenderLayer ( Immutable< style::Layer::Impl >  )
noexcept

Returns a new RenderLayer instance on success call; returns nullptr otherwise.

◆ get()

static LayerManager* mbgl::LayerManager::get ( )
staticnoexcept

A singleton getter.

Returns
LayerManager*

◆ getFactory() [1/2]

virtual LayerFactory* mbgl::LayerManager::getFactory ( const std::string &  type)
protectedpure virtualnoexcept

◆ getFactory() [2/2]

virtual LayerFactory* mbgl::LayerManager::getFactory ( const style::LayerTypeInfo *  )
protectedpure virtualnoexcept

Member Data Documentation

◆ annotationsEnabled

const bool mbgl::LayerManager::annotationsEnabled
static

a build-time flag to enable/disable annotations in mapbox-gl-native core.

At the moment, the annotations implementation in core is creating concrete layer instances apart from LayerManager/LayerFactory code path.

So, annotations must be disabled if the LayerManager implementation does not provide line, fill or symbol layers (those, used by the annotations implementation).

Note: in future, annotations implemantation will be moved from the core to platform SDK (see https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-annotation) and this flag won't be needed any more.

Definition at line 62 of file layer_manager.hpp.


The documentation for this class was generated from the following file: