summaryrefslogtreecommitdiff
path: root/src/mbgl/style/sources/vector_source.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/sources/vector_source.cpp')
-rw-r--r--src/mbgl/style/sources/vector_source.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mbgl/style/sources/vector_source.cpp b/src/mbgl/style/sources/vector_source.cpp
index f2a6b166a9..4bcd3b8985 100644
--- a/src/mbgl/style/sources/vector_source.cpp
+++ b/src/mbgl/style/sources/vector_source.cpp
@@ -5,7 +5,17 @@ namespace mbgl {
namespace style {
VectorSource::VectorSource(std::string id, variant<std::string, Tileset> urlOrTileset)
- : Source(SourceType::Vector, std::make_unique<VectorSource::Impl>(std::move(id), *this, std::move(urlOrTileset))) {
+ : Source(SourceType::Vector, std::make_unique<VectorSource::Impl>(std::move(id), *this, std::move(urlOrTileset))),
+ impl(static_cast<Impl*>(baseImpl.get())) {
+}
+
+optional<std::string> VectorSource::getURL() const {
+ auto urlOrTileset = impl->getURLOrTileset();
+ if (urlOrTileset.is<std::string>()) {
+ return urlOrTileset.get<std::string>();
+ } else {
+ return {};
+ }
}
} // namespace style