summaryrefslogtreecommitdiff
path: root/include/mbgl/style/sources/image_source.hpp
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-04-20 12:39:51 -0700
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-06-01 15:38:01 -0700
commit7a010df9560e8807b9be938bb5ff7360e8e730a6 (patch)
treeacb862796062e35d2ffdf77deb9514ee73f3d6ad /include/mbgl/style/sources/image_source.hpp
parent9068c90fc4b1b8b4938d89028fc3f7b46beeac29 (diff)
downloadqtlocation-mapboxgl-7a010df9560e8807b9be938bb5ff7360e8e730a6.tar.gz
[core] Add ImageSource support to style parsers
Diffstat (limited to 'include/mbgl/style/sources/image_source.hpp')
-rw-r--r--include/mbgl/style/sources/image_source.hpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/mbgl/style/sources/image_source.hpp b/include/mbgl/style/sources/image_source.hpp
new file mode 100644
index 0000000000..e7e598a972
--- /dev/null
+++ b/include/mbgl/style/sources/image_source.hpp
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <mbgl/style/source.hpp>
+#include <mbgl/util/image.hpp>
+#include <mbgl/util/optional.hpp>
+
+namespace mbgl {
+class LatLng;
+class AsyncRequest;
+
+namespace style {
+
+class ImageSource : public Source {
+public:
+ ImageSource(std::string id, const std::vector<LatLng>);
+ ~ImageSource() override;
+
+ const std::string& getURL() const;
+ void setURL(const std::string& url) ;
+
+ void setImage(mbgl::UnassociatedImage);
+
+ void setCoordinates(const std::vector<LatLng>&);
+ std::vector<LatLng> getCoordinates() const;
+
+ class Impl;
+ const Impl& impl() const;
+
+ void loadDescription(FileSource&) final;
+private:
+ optional<std::string> url;
+ std::unique_ptr<AsyncRequest> req;
+};
+
+template <>
+inline bool Source::is<ImageSource>() const {
+ return getType() == SourceType::Image;
+}
+
+} // namespace style
+} // namespace mbgl