#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)), mailbox(std::make_shared(*Scheduler::GetCurrent())), loader(std::make_unique(options.fetchTileFunction, options.cancelTileFunction)) { } CustomGeometrySource::~CustomGeometrySource() = default; const CustomGeometrySource::Impl& CustomGeometrySource::impl() const { return static_cast(*baseImpl); } void CustomGeometrySource::loadDescription(FileSource&) { baseImpl = makeMutable(impl(), ActorRef(*loader, mailbox)); loaded = true; } void CustomGeometrySource::setTileData(const CanonicalTileID& tileID, const GeoJSON& data) { loader->setTileData(tileID, data); } void CustomGeometrySource::invalidateTile(const CanonicalTileID& tileID) { loader->invalidateTile(tileID); } void CustomGeometrySource::invalidateRegion(const LatLngBounds& bounds) { loader->invalidateRegion(bounds, impl().getZoomRange()); } } // namespace style } // namespace mbgl