summaryrefslogtreecommitdiff
path: root/src/mbgl/style/sources/geojson_source.cpp
blob: 992f82b1e796a1785b2731bbf4473195891ced30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <mbgl/style/sources/geojson_source.hpp>
#include <mbgl/style/sources/geojson_source_impl.hpp>
#include <mbgl/style/source_observer.hpp>

namespace mbgl {
namespace style {

GeoJSONSource::GeoJSONSource(const std::string& id, const GeoJSONOptions& options)
    : Source(SourceType::GeoJSON,
             std::make_unique<GeoJSONSource::Impl>(std::move(id), *this, options)),
      impl(static_cast<Impl*>(baseImpl.get())) {
}

void GeoJSONSource::setURL(const std::string& url) {
    impl->setURL(url);
}

void GeoJSONSource::setGeoJSON(const mapbox::geojson::geojson& geoJSON) {
    impl->setGeoJSON(geoJSON);
    impl->observer->onSourceChanged(*this);
}

optional<std::string> GeoJSONSource::getURL() const {
    return impl->getURL();
}

} // namespace style
} // namespace mbgl