summaryrefslogtreecommitdiff
path: root/src/map/map.cpp
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2014-07-11 16:49:39 -0700
committerMike Morris <michael.patrick.morris@gmail.com>2014-07-11 16:49:39 -0700
commit5bc77d4243e2d70d4a1a0127fb0e878160601e23 (patch)
treee5fa0a537b9000c9ab6b2b75687c7dadc109abdd /src/map/map.cpp
parent86c5367baec5a7731ff82716f0a2dcc99802e3b4 (diff)
downloadqtlocation-mapboxgl-5bc77d4243e2d70d4a1a0127fb0e878160601e23.tar.gz
add forward-declared Source shared_ptr to style_bucket
Diffstat (limited to 'src/map/map.cpp')
-rw-r--r--src/map/map.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp
index db81700c47..3443cf78e0 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -183,7 +183,7 @@ std::string Map::getStyleJSON() const {
return styleJSON;
}
-void Map::setAccessToken( std::string access_token) {
+void Map::setAccessToken(std::string access_token) {
accessToken.swap(access_token);
}
@@ -426,7 +426,8 @@ void Map::updateSources(const std::shared_ptr<StyleLayerGroup> &group) {
if (!layer) continue;
if (layer->bucket) {
if (layer->bucket->style_source) {
- activeSources.emplace(std::make_shared<Source>(*layer->bucket->style_source, this->getAccessToken()));
+ auto ret = activeSources.emplace(std::make_shared<Source>(*layer->bucket->style_source, this->getAccessToken()));
+ layer->bucket->source = *ret.first;
}
} else if (layer->layers) {
updateSources(layer->layers);
@@ -659,8 +660,6 @@ void Map::renderLayer(std::shared_ptr<StyleLayer> layer_desc, RenderPass pass) {
<< layer_desc->type << ")" << std::endl;
}
- // TODO: THIS IS BAD, FIXME
- Source source(*layer_desc->bucket->style_source, this->getAccessToken());
- source.render(painter, layer_desc);
+ layer_desc->bucket->source->render(painter, layer_desc);
}
}