[core] Added URL accessor for tile sources
This commit is contained in:
committed by
Minh Nguyễn
parent
906d700ccd
commit
117c8ed1d1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user