summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyleLayerManager.h
blob: 0f7fab00ed4c63100d221720bf797db6a5ba96ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#import "MGLStyleLayer_Private.h"

#include <mbgl/style/layer.hpp>

#include <map>
#include <string>
#include <vector>

namespace mbgl {

class LayerManagerDarwin : public style::LayerManager {
public:
    static LayerManagerDarwin* get() noexcept;
    ~LayerManagerDarwin();

    MGLStyleLayer* createPeer(style::Layer*);

private:
    LayerManagerDarwin();
    void addLayerType(std::unique_ptr<LayerPeerFactory>);
    // LayerManager overrides.
    std::unique_ptr<style::Layer> createLayer(const std::string& type, const std::string& id, const style::conversion::Convertible& value, style::conversion::Error& error) noexcept final;
    
    std::vector<std::unique_ptr<LayerPeerFactory>> factories;
    std::map<std::string, style::LayerFactory*> typeToFactory;
};
    
}  // namespace mbgl