diff options
-rw-r--r-- | src/mbgl/annotation/render_annotation_source.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/renderer/render_source.cpp | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/mbgl/annotation/render_annotation_source.cpp b/src/mbgl/annotation/render_annotation_source.cpp index 7d776f21c4..d83f4d0fa4 100644 --- a/src/mbgl/annotation/render_annotation_source.cpp +++ b/src/mbgl/annotation/render_annotation_source.cpp @@ -6,12 +6,15 @@ #include <mbgl/algorithm/generate_clip_ids.hpp> #include <mbgl/algorithm/generate_clip_ids_impl.hpp> +#include <mbgl/layermanager/layer_manager.hpp> + namespace mbgl { using namespace style; RenderAnnotationSource::RenderAnnotationSource(Immutable<AnnotationSource::Impl> impl_) : RenderSource(impl_) { + assert(LayerManager::annotationsEnabled); tilePyramid.setObserver(this); } diff --git a/src/mbgl/renderer/render_source.cpp b/src/mbgl/renderer/render_source.cpp index d160eb16e3..dfe1f25ed6 100644 --- a/src/mbgl/renderer/render_source.cpp +++ b/src/mbgl/renderer/render_source.cpp @@ -10,6 +10,8 @@ #include <mbgl/renderer/sources/render_custom_geometry_source.hpp> #include <mbgl/tile/tile.hpp> +#include <mbgl/layermanager/layer_manager.hpp> + namespace mbgl { using namespace style; @@ -28,7 +30,12 @@ std::unique_ptr<RenderSource> RenderSource::create(Immutable<Source::Impl> impl) assert(false); return nullptr; case SourceType::Annotations: - return std::make_unique<RenderAnnotationSource>(staticImmutableCast<AnnotationSource::Impl>(impl)); + if (LayerManager::annotationsEnabled) { + return std::make_unique<RenderAnnotationSource>(staticImmutableCast<AnnotationSource::Impl>(impl)); + } else { + assert(false); + return nullptr; + } case SourceType::Image: return std::make_unique<RenderImageSource>(staticImmutableCast<ImageSource::Impl>(impl)); case SourceType::CustomVector: |