1#pragma once
2
3#include <mbgl/style/source.hpp>
4#include <mbgl/util/image.hpp>
5#include <mbgl/util/optional.hpp>
6
7namespace mbgl {
8class LatLng;
9class AsyncRequest;
10
11namespace style {
12
13class ImageSource : public Source {
14public:
15 ImageSource(std::string id, const std::array<LatLng, 4>);
16 ~ImageSource() override;
17
18 optional<std::string> getURL() const;
19 void setURL(const std::string& url);
20
21 void setImage(PremultipliedImage&&);
22
23 void setCoordinates(const std::array<LatLng, 4>&);
24 std::array<LatLng, 4> getCoordinates() const;
25
26 class Impl;
27 const Impl& impl() const;
28
29 void loadDescription(FileSource&) final;
30private:
31 optional<std::string> url;
32 std::unique_ptr<AsyncRequest> req;
33};
34
35template <>
36inline bool Source::is<ImageSource>() const {
37 return getType() == SourceType::Image;
38}
39
40} // namespace style
41} // namespace mbgl
42

source code of qtlocation/src/3rdparty/mapbox-gl-native/include/mbgl/style/sources/image_source.hpp