[core] move invariant Source ID from SourceInfo to Source
This commit is contained in:
committed by
John Firebaugh
parent
8cca5c89b2
commit
cef05b9017
@@ -117,7 +117,7 @@ void parse(const JSValue& value, std::array<float, N>& target, const char* name)
|
||||
|
||||
} // end namespace
|
||||
|
||||
Source::Source(SourceType type_) : type(type_) {}
|
||||
Source::Source(SourceType type_, const std::string& id_) : type(type_), id(id_) {}
|
||||
|
||||
Source::~Source() = default;
|
||||
|
||||
@@ -334,7 +334,7 @@ TileData::State Source::addTile(const TileID& tileID, const StyleUpdateParameter
|
||||
|
||||
newTile->data = std::make_shared<VectorTileData>(normalizedID,
|
||||
std::move(monitor),
|
||||
info.source_id,
|
||||
id,
|
||||
parameters.style,
|
||||
parameters.mode,
|
||||
callback);
|
||||
@@ -591,7 +591,7 @@ void Source::tileLoadingCompleteCallback(const TileID& tileID, const TransformSt
|
||||
}
|
||||
|
||||
void Source::dumpDebugLogs() const {
|
||||
Log::Info(Event::General, "Source::id: %s", info.source_id.c_str());
|
||||
Log::Info(Event::General, "Source::id: %s", id.c_str());
|
||||
Log::Info(Event::General, "Source::loaded: %d", loaded);
|
||||
|
||||
for (const auto& tile : tiles) {
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
virtual void onTileError(Source&, const TileID&, std::exception_ptr) {};
|
||||
};
|
||||
|
||||
Source(SourceType);
|
||||
Source(SourceType, const std::string& id);
|
||||
~Source();
|
||||
|
||||
void parseTileJSON(const JSValue&);
|
||||
@@ -70,6 +70,7 @@ public:
|
||||
void dumpDebugLogs() const;
|
||||
|
||||
const SourceType type;
|
||||
const std::string id;
|
||||
SourceInfo info;
|
||||
bool enabled = false;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ public:
|
||||
std::string attribution;
|
||||
std::array<float, 3> center = { { 0, 0, 0 } };
|
||||
std::array<float, 4> bounds = { { -180, -90, 180, 90 } };
|
||||
std::string source_id = "";
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user