summaryrefslogtreecommitdiff
path: root/src/mbgl/style/style.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/style.cpp')
-rw-r--r--src/mbgl/style/style.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 902cc1687c..0c3f42c6ec 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -1,6 +1,8 @@
#include <mbgl/style/image.hpp>
#include <mbgl/style/image_impl.hpp>
#include <mbgl/style/layer.hpp>
+#include <mbgl/storage/file_source_manager.hpp>
+#include <mbgl/storage/resource_options.hpp>
#include <mbgl/style/light.hpp>
#include <mbgl/style/source.hpp>
#include <mbgl/style/style.hpp>
@@ -10,7 +12,11 @@ namespace mbgl {
namespace style {
Style::Style(std::shared_ptr<FileSource> fileSource, float pixelRatio)
- : impl(std::make_unique<Impl>(std::move(fileSource), pixelRatio)) {}
+ : impl(std::make_unique<StyleImpl>(std::move(fileSource), pixelRatio)) {}
+
+Style::Style(const ResourceOptions &resourceOptions, float pixelRatio)
+ : impl(std::make_unique<StyleImpl>(FileSourceManager::get() ? FileSourceManager::get()->getFileSource(ResourceLoader, resourceOptions) : nullptr,
+ pixelRatio)) {}
Style::~Style() = default;
@@ -82,7 +88,7 @@ std::vector<Source*> Style::getSources() {
}
std::vector<const Source*> Style::getSources() const {
- return const_cast<const Impl&>(*impl).getSources();
+ return const_cast<const StyleImpl&>(*impl).getSources();
}
Source* Style::getSource(const std::string& id) {
@@ -110,7 +116,7 @@ std::vector<Layer*> Style::getLayers() {
}
std::vector<const Layer*> Style::getLayers() const {
- return const_cast<const Impl&>(*impl).getLayers();
+ return const_cast<const StyleImpl&>(*impl).getLayers();
}
Layer* Style::getLayer(const std::string& layerID) {