[core] Source should receive a ref to MapData just once
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/annotation/annotation_manager.hpp>
|
||||
#include <mbgl/annotation/annotation_tile.hpp>
|
||||
#include <mbgl/map/map_data.hpp>
|
||||
#include <mbgl/style/style.hpp>
|
||||
#include <mbgl/layer/symbol_layer.hpp>
|
||||
|
||||
@@ -10,7 +11,8 @@ namespace mbgl {
|
||||
const std::string AnnotationManager::SourceID = "com.mapbox.annotations";
|
||||
const std::string AnnotationManager::PointLayerID = "com.mapbox.annotations.points";
|
||||
|
||||
AnnotationManager::AnnotationManager() = default;
|
||||
AnnotationManager::AnnotationManager(MapData& data_) : data(data_) {}
|
||||
|
||||
AnnotationManager::~AnnotationManager() = default;
|
||||
|
||||
AnnotationIDs
|
||||
@@ -108,7 +110,7 @@ std::unique_ptr<AnnotationTile> AnnotationManager::getTile(const TileID& tileID)
|
||||
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<Source>();
|
||||
std::unique_ptr<Source> source = std::make_unique<Source>(data);
|
||||
source->info.type = SourceType::Annotations;
|
||||
source->info.source_id = SourceID;
|
||||
source->enabled = true;
|
||||
|
||||
Reference in New Issue
Block a user