summaryrefslogtreecommitdiff
path: root/src/mbgl/annotation
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/annotation')
-rw-r--r--src/mbgl/annotation/annotation_manager.cpp2
-rw-r--r--src/mbgl/annotation/annotation_source.cpp18
-rw-r--r--src/mbgl/annotation/annotation_source.hpp8
-rw-r--r--src/mbgl/annotation/annotation_tile.cpp3
-rw-r--r--src/mbgl/annotation/annotation_tile.hpp3
5 files changed, 23 insertions, 11 deletions
diff --git a/src/mbgl/annotation/annotation_manager.cpp b/src/mbgl/annotation/annotation_manager.cpp
index b3edbf857d..e3c6cc56d4 100644
--- a/src/mbgl/annotation/annotation_manager.cpp
+++ b/src/mbgl/annotation/annotation_manager.cpp
@@ -108,7 +108,7 @@ void AnnotationManager::updateStyle(Style& style) {
// Create annotation source, point layer, and point bucket
if (!style.getSource(SourceID)) {
std::unique_ptr<Source> source = std::make_unique<AnnotationSource>();
- source->enabled = true;
+ source->baseImpl->enabled = true;
style.addSource(std::move(source));
std::unique_ptr<SymbolLayer> layer = std::make_unique<SymbolLayer>(PointLayerID);
diff --git a/src/mbgl/annotation/annotation_source.cpp b/src/mbgl/annotation/annotation_source.cpp
index 2c87c4f207..61fc4ca2e4 100644
--- a/src/mbgl/annotation/annotation_source.cpp
+++ b/src/mbgl/annotation/annotation_source.cpp
@@ -4,21 +4,27 @@
namespace mbgl {
+using namespace style;
+
AnnotationSource::AnnotationSource()
- : Source(SourceType::Annotations, AnnotationManager::SourceID) {
+ : Source(SourceType::Annotations, std::make_unique<Impl>(*this)) {
+}
+
+AnnotationSource::Impl::Impl(Source& base_)
+ : Source::Impl(SourceType::Annotations, AnnotationManager::SourceID, base_) {
}
-Range<uint8_t> AnnotationSource::getZoomRange() {
+Range<uint8_t> AnnotationSource::Impl::getZoomRange() {
return { 0, 22 };
}
-void AnnotationSource::load(FileSource&) {
+void AnnotationSource::Impl::load(FileSource&) {
loaded = true;
}
-std::unique_ptr<Tile> AnnotationSource::createTile(const OverscaledTileID& tileID,
- const style::UpdateParameters& parameters) {
- return std::make_unique<AnnotationTile>(tileID, id, parameters);
+std::unique_ptr<Tile> AnnotationSource::Impl::createTile(const OverscaledTileID& tileID,
+ const style::UpdateParameters& parameters) {
+ return std::make_unique<AnnotationTile>(tileID, parameters);
}
} // namespace mbgl
diff --git a/src/mbgl/annotation/annotation_source.hpp b/src/mbgl/annotation/annotation_source.hpp
index e8d3b43e09..db9221788f 100644
--- a/src/mbgl/annotation/annotation_source.hpp
+++ b/src/mbgl/annotation/annotation_source.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/style/source.hpp>
+#include <mbgl/style/source_impl.hpp>
namespace mbgl {
@@ -8,6 +9,13 @@ class AnnotationSource : public style::Source {
public:
AnnotationSource();
+ class Impl;
+};
+
+class AnnotationSource::Impl : public style::Source::Impl {
+public:
+ Impl(Source&);
+
void load(FileSource&) final;
private:
diff --git a/src/mbgl/annotation/annotation_tile.cpp b/src/mbgl/annotation/annotation_tile.cpp
index 79e281acce..91b7f7ddc1 100644
--- a/src/mbgl/annotation/annotation_tile.cpp
+++ b/src/mbgl/annotation/annotation_tile.cpp
@@ -9,9 +9,8 @@
namespace mbgl {
AnnotationTile::AnnotationTile(const OverscaledTileID& overscaledTileID,
- std::string sourceID,
const style::UpdateParameters& parameters)
- : GeometryTile(overscaledTileID, sourceID, parameters.style, parameters.mode),
+ : GeometryTile(overscaledTileID, AnnotationManager::SourceID, parameters.style, parameters.mode),
annotationManager(parameters.annotationManager) {
annotationManager.addTile(*this);
}
diff --git a/src/mbgl/annotation/annotation_tile.hpp b/src/mbgl/annotation/annotation_tile.hpp
index 290df3537e..3e7c2c447f 100644
--- a/src/mbgl/annotation/annotation_tile.hpp
+++ b/src/mbgl/annotation/annotation_tile.hpp
@@ -14,8 +14,7 @@ class UpdateParameters;
class AnnotationTile : public GeometryTile {
public:
AnnotationTile(const OverscaledTileID&,
- std::string sourceID,
- const style::UpdateParameters&);
+ const style::UpdateParameters&);
~AnnotationTile() override;
void setNecessity(Necessity) final;