#include #include #include #include #include #include #include #include #include namespace mbgl { namespace style { CustomGeometrySource::CustomGeometrySource(std::string id, const CustomGeometrySource::Options options) : Source(makeMutable(std::move(id), options)), loader(std::make_unique>(*sharedThreadPool(), options.fetchTileFunction, options.cancelTileFunction)) { } CustomGeometrySource::~CustomGeometrySource() = default; const CustomGeometrySource::Impl& CustomGeometrySource::impl() const { return static_cast(*baseImpl); } void CustomGeometrySource::loadDescription(FileSource&) { baseImpl = makeMutable(impl(), loader->self()); loaded = true; } void CustomGeometrySource::setTileData(const CanonicalTileID& tileID, const GeoJSON& data) { loader->invoke(&CustomTileLoader::setTileData, tileID, data); } void CustomGeometrySource::invalidateTile(const CanonicalTileID& tileID) { loader->invoke(&CustomTileLoader::invalidateTile, tileID); } void CustomGeometrySource::invalidateRegion(const LatLngBounds& bounds) { loader->invoke(&CustomTileLoader::invalidateRegion, bounds, impl().getZoomRange()); } } // namespace style } // namespace mbgl