Files
MapLibreParticleLab/include/mbgl/style/sources/raster_dem_source.hpp
Tim Sylvester 29428dce42 Add support for parsing MLT-format vector tile sources (#3246)
Co-authored-by: Bart Louwers <bart@emeel.net>
Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
2025-10-31 17:24:12 -07:00

39 lines
1.1 KiB
C++

#pragma once
#include <mbgl/style/sources/raster_source.hpp>
#include <mbgl/util/tileset.hpp>
#include <mbgl/util/variant.hpp>
namespace mbgl {
namespace style {
struct SourceOptions {
std::optional<Tileset::RasterEncoding> rasterEncoding = std::nullopt;
std::optional<Tileset::VectorEncoding> vectorEncoding = std::nullopt;
};
// NOTE: Any derived class must invalidate `weakFactory` in the destructor
class RasterDEMSource final : public RasterSource {
public:
RasterDEMSource(std::string id,
variant<std::string, Tileset> urlOrTileset,
uint16_t tileSize,
std::optional<SourceOptions> options = std::nullopt);
~RasterDEMSource() override;
bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const override;
protected:
void setTilesetOverrides(Tileset& tileset) override;
private:
std::optional<SourceOptions> options;
};
template <>
inline bool Source::is<RasterDEMSource>() const {
return getType() == SourceType::RasterDEM;
}
} // namespace style
} // namespace mbgl