summaryrefslogtreecommitdiff
path: root/src/mbgl/sourcemanager/annotation_source_factory.cpp
blob: a5d1986efd48f0a41d0fb6b76c13ca1134bacd5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <mbgl/annotation/annotation_source.hpp>
#include <mbgl/annotation/render_annotation_source.hpp>
#include <mbgl/sourcemanager/annotation_source_factory.hpp>

namespace mbgl {

const style::SourceTypeInfo* AnnotationSourceFactory::getTypeInfo() const noexcept {
    return AnnotationSource::Impl::staticTypeInfo();
}

std::unique_ptr<style::Source> AnnotationSourceFactory::createSource(const std::string&,
                                                                     const style::conversion::Convertible&,
                                                                     style::conversion::Error&) noexcept {
    return std::unique_ptr<style::Source>(new AnnotationSource());
}

std::unique_ptr<RenderSource> AnnotationSourceFactory::createRenderSource(
    Immutable<style::Source::Impl> impl) noexcept {
    assert(impl->getTypeInfo() == getTypeInfo());
    return std::make_unique<RenderAnnotationSource>(staticImmutableCast<AnnotationSource::Impl>(impl));
}

} // namespace mbgl