summaryrefslogtreecommitdiff
path: root/src/mbgl/sourcemanager/annotation_source_factory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/sourcemanager/annotation_source_factory.cpp')
-rw-r--r--src/mbgl/sourcemanager/annotation_source_factory.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mbgl/sourcemanager/annotation_source_factory.cpp b/src/mbgl/sourcemanager/annotation_source_factory.cpp
new file mode 100644
index 0000000000..a5d1986efd
--- /dev/null
+++ b/src/mbgl/sourcemanager/annotation_source_factory.cpp
@@ -0,0 +1,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