summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-02 16:18:46 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-02 16:33:56 -0700
commite802aedb8cf7678cacb92cd02e2e35d051310252 (patch)
tree623492c0835899bcd473b071720cc5b2bde1c76f /src
parent7d110f5b149bfd78eca8a2e3e0cb071ae5027348 (diff)
downloadqtlocation-mapboxgl-e802aedb8cf7678cacb92cd02e2e35d051310252.tar.gz
[core, node, android] Remove used "base" parameter from setStyleJSON
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/map/map.cpp20
-rw-r--r--src/mbgl/style/style.cpp2
-rw-r--r--src/mbgl/style/style.hpp2
3 files changed, 9 insertions, 15 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index ec961a6485..d5f5574d59 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -43,7 +43,7 @@ public:
void update();
void render();
- void loadStyleJSON(const std::string& json, const std::string& base);
+ void loadStyleJSON(const std::string&);
View& view;
FileSource& fileSource;
@@ -297,13 +297,7 @@ void Map::setStyleURL(const std::string& url) {
impl->style = std::make_unique<Style>(impl->fileSource, impl->pixelRatio);
- const size_t pos = impl->styleURL.rfind('/');
- std::string base = "";
- if (pos != std::string::npos) {
- base = impl->styleURL.substr(0, pos + 1);
- }
-
- impl->styleRequest = impl->fileSource.request(Resource::style(impl->styleURL), [this, base](Response res) {
+ impl->styleRequest = impl->fileSource.request(Resource::style(impl->styleURL), [this](Response res) {
if (res.error) {
if (res.error->reason == Response::Error::Reason::NotFound &&
util::mapbox::isMapboxURL(impl->styleURL)) {
@@ -314,12 +308,12 @@ void Map::setStyleURL(const std::string& url) {
} else if (res.notModified || res.noContent) {
return;
} else {
- impl->loadStyleJSON(*res.data, base);
+ impl->loadStyleJSON(*res.data);
}
});
}
-void Map::setStyleJSON(const std::string& json, const std::string& base) {
+void Map::setStyleJSON(const std::string& json) {
if (impl->styleJSON == json) {
return;
}
@@ -332,11 +326,11 @@ void Map::setStyleJSON(const std::string& json, const std::string& base) {
impl->styleJSON.clear();
impl->style = std::make_unique<Style>(impl->fileSource, impl->pixelRatio);
- impl->loadStyleJSON(json, base);
+ impl->loadStyleJSON(json);
}
-void Map::Impl::loadStyleJSON(const std::string& json, const std::string& base) {
- style->setJSON(json, base);
+void Map::Impl::loadStyleJSON(const std::string& json) {
+ style->setJSON(json);
style->setObserver(this);
styleJSON = json;
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index b86845154c..5c6037a7d9 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -78,7 +78,7 @@ Style::Style(FileSource& fileSource_, float pixelRatio)
spriteStore->setObserver(this);
}
-void Style::setJSON(const std::string& json, const std::string&) {
+void Style::setJSON(const std::string& json) {
sources.clear();
layers.clear();
classes.clear();
diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp
index a679681f41..05a975a95a 100644
--- a/src/mbgl/style/style.hpp
+++ b/src/mbgl/style/style.hpp
@@ -39,7 +39,7 @@ public:
Style(FileSource&, float pixelRatio);
~Style();
- void setJSON(const std::string& data, const std::string& base);
+ void setJSON(const std::string&);
void setObserver(Observer*);