#pragma once #include #include #include namespace mbgl { namespace style { // Forward class PluginLayer; } // namespace style class PluginLayerFactory : public LayerFactory { public: PluginLayerFactory(std::string& layerType, mbgl::style::LayerTypeInfo::Source source, mbgl::style::LayerTypeInfo::Pass3D pass3D, mbgl::style::LayerTypeInfo::Layout layout, mbgl::style::LayerTypeInfo::FadingTiles fadingTiles, mbgl::style::LayerTypeInfo::CrossTileIndex crossTileIndex, mbgl::style::LayerTypeInfo::TileKind tileKind); using OnLayerCreatedEvent = std::function; void setOnLayerCreatedEvent(OnLayerCreatedEvent onLayerCreated) { _onLayerCreated = onLayerCreated; } protected: const style::LayerTypeInfo* getTypeInfo() const noexcept final; std::unique_ptr createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final; std::unique_ptr createBucket(const BucketParameters&, const std::vector>&) noexcept final; std::unique_ptr createRenderLayer(Immutable) noexcept final; private: // These is the layer type info that is setup during factory creation and returned in the getTypeInfo method style::LayerTypeInfo _layerTypeInfo; std::string _layerType; OnLayerCreatedEvent _onLayerCreated; }; } // namespace mbgl