diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-09-22 16:58:38 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-09-28 14:10:00 -0700 |
commit | 028abaab00f2ff3a19c67366c3a9f8c803e27423 (patch) | |
tree | edd263033a8b24326ab8e284377e319aa174bf8a /src/mbgl/map/source.cpp | |
parent | aec145ded3b9c0b4f928fb7cb1d92faac4e0e89a (diff) | |
download | qtlocation-mapboxgl-028abaab00f2ff3a19c67366c3a9f8c803e27423.tar.gz |
Ensure that LiveTileData can be reparsed
Annotation tiles may become partially parsed just like regular tiles,
for example if a point annotation is added to the map before the style's
sprite has been loaded. In such cases, they need to be reparsed or the
annotation will not be rendered. Previously, the code path for reparsing
would be short-circuited by a dynamic_cast<VectorTileData*> followed by
a null check. This commit removes that case and adds (back) a virtual
reparse method to the TileData interface.
Diffstat (limited to 'src/mbgl/map/source.cpp')
-rw-r--r-- | src/mbgl/map/source.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mbgl/map/source.cpp b/src/mbgl/map/source.cpp index 5899fea1ec..572973b79a 100644 --- a/src/mbgl/map/source.cpp +++ b/src/mbgl/map/source.cpp @@ -234,15 +234,13 @@ bool Source::handlePartialTile(const TileID& id, Worker&) { return true; } - // Note: this uses a raw pointer; we don't want the callback binding to have a - // shared pointer. - VectorTileData* data = dynamic_cast<VectorTileData*>(it->second.lock().get()); + auto data = it->second.lock(); if (!data) { return true; } - return data->reparse([this, data]() { - emitTileLoaded(false); + return data->reparse([this]() { + emitTileLoaded(false); }); } |