53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include <mbgl/style/source.hpp>
|
|
|
|
#include <optional>
|
|
|
|
namespace mbgl {
|
|
class AsyncRequest;
|
|
|
|
namespace style {
|
|
|
|
class RasterArraySource final : public Source {
|
|
public:
|
|
RasterArraySource(std::string id,
|
|
std::string fixtureID,
|
|
std::string metadataURL,
|
|
std::string fieldURL,
|
|
std::string nextFixtureID = {},
|
|
std::string nextMetadataURL = {},
|
|
std::string nextFieldURL = {});
|
|
~RasterArraySource() override;
|
|
|
|
class Impl;
|
|
const Impl& impl() const;
|
|
void loadDescription(FileSource&) override;
|
|
bool supportsLayerType(const LayerTypeInfo*) const override;
|
|
mapbox::base::WeakPtr<Source> makeWeakPtr() override { return weakFactory.makeWeakPtr(); }
|
|
|
|
protected:
|
|
Mutable<Source::Impl> createMutable() const noexcept override;
|
|
|
|
private:
|
|
void tryLoad();
|
|
|
|
std::unique_ptr<AsyncRequest> metadataRequest;
|
|
std::unique_ptr<AsyncRequest> fieldRequest;
|
|
std::unique_ptr<AsyncRequest> nextMetadataRequest;
|
|
std::unique_ptr<AsyncRequest> nextFieldRequest;
|
|
std::optional<std::string> metadata;
|
|
std::optional<std::vector<char>> fieldBytes;
|
|
std::optional<std::string> nextMetadata;
|
|
std::optional<std::vector<char>> nextFieldBytes;
|
|
mapbox::base::WeakPtrFactory<Source> weakFactory{this};
|
|
};
|
|
|
|
template <>
|
|
inline bool Source::is<RasterArraySource>() const {
|
|
return getType() == SourceType::RasterArray;
|
|
}
|
|
|
|
} // namespace style
|
|
} // namespace mbgl
|