[core] Inline AnnotationSource constructor parameters

This commit is contained in:
John Firebaugh
2016-06-14 10:40:44 -07:00
parent b222689de8
commit f74c5d8abd
3 changed files with 5 additions and 10 deletions

View File

@@ -107,7 +107,7 @@ std::unique_ptr<AnnotationTileData> AnnotationManager::getTileData(const Canonic
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>(SourceID, "", util::tileSize, std::make_unique<Tileset>());
std::unique_ptr<Source> source = std::make_unique<AnnotationSource>();
source->enabled = true;
style.addSource(std::move(source));

View File

@@ -1,12 +1,10 @@
#include <mbgl/annotation/annotation_source.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
namespace mbgl {
AnnotationSource::AnnotationSource(std::string id_,
std::string url_,
uint16_t tileSize_,
std::unique_ptr<Tileset>&& tileset_)
: Source(SourceType::Annotations, std::move(id_), std::move(url_), tileSize_, std::move(tileset_)) {
AnnotationSource::AnnotationSource()
: Source(SourceType::Annotations, AnnotationManager::SourceID, "", util::tileSize, std::make_unique<Tileset>()) {
}
} // namespace mbgl

View File

@@ -6,10 +6,7 @@ namespace mbgl {
class AnnotationSource : public style::Source {
public:
AnnotationSource(std::string id,
std::string url,
uint16_t tileSize,
std::unique_ptr<Tileset>&&);
AnnotationSource();
};
} // namespace mbgl