diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-05-31 11:53:04 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-06-01 15:38:01 -0700 |
commit | 8b37a0704c7c20b1664fee3dfcc79139982a1ce7 (patch) | |
tree | 9c0a50330b7e4f152a3a9ee25685fcbe8b9a4df4 /src/mbgl/style/sources/image_source.cpp | |
parent | 843da07b28a840fd850056c4b15d492ccc76a646 (diff) | |
download | qtlocation-mapboxgl-8b37a0704c7c20b1664fee3dfcc79139982a1ce7.tar.gz |
[core] Use fixed-size std::array for ImageSource coordinates
Diffstat (limited to 'src/mbgl/style/sources/image_source.cpp')
-rw-r--r-- | src/mbgl/style/sources/image_source.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mbgl/style/sources/image_source.cpp b/src/mbgl/style/sources/image_source.cpp index 79df65697c..9313d8da4a 100644 --- a/src/mbgl/style/sources/image_source.cpp +++ b/src/mbgl/style/sources/image_source.cpp @@ -8,7 +8,7 @@ namespace mbgl { namespace style { -ImageSource::ImageSource(std::string id, const std::vector<LatLng> coords_) +ImageSource::ImageSource(std::string id, const std::array<LatLng, 4> coords_) : Source(makeMutable<Impl>(std::move(id), coords_)) { } @@ -18,12 +18,12 @@ const ImageSource::Impl& ImageSource::impl() const { return static_cast<const Impl&>(*baseImpl); } -void ImageSource::setCoordinates(const std::vector<LatLng>& coords_) { +void ImageSource::setCoordinates(const std::array<LatLng, 4>& coords_) { baseImpl = makeMutable<Impl>(impl(), coords_); observer->onSourceChanged(*this); } -std::vector<LatLng> ImageSource::getCoordinates() const { +std::array<LatLng, 4> ImageSource::getCoordinates() const { return impl().getCoordinates(); } @@ -37,7 +37,7 @@ void ImageSource::setURL(const std::string& url_) { } } -void ImageSource::setImage(mbgl::UnassociatedImage&& image_) { +void ImageSource::setImage(UnassociatedImage&& image_) { url = {}; if (req) { req.reset(); @@ -47,8 +47,8 @@ void ImageSource::setImage(mbgl::UnassociatedImage&& image_) { observer->onSourceChanged(*this); } -const std::string& ImageSource::getURL() const { - return *url; +optional<std::string> ImageSource::getURL() const { + return url; } void ImageSource::loadDescription(FileSource& fileSource) { |