summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-02-11 12:12:57 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-02-11 14:34:46 +0200
commit3bd2d0e4d7d52dc88d30081922e1708f0d5a4bcf (patch)
treef2b143fc74c48283e8ad43005c4da8050bb88042 /platform
parentf38330a9f58ca3b2664168c7830811055870bc42 (diff)
downloadqtlocation-mapboxgl-3bd2d0e4d7d52dc88d30081922e1708f0d5a4bcf.tar.gz
style::Style::getImage() returns optional<style::Image>
Diffstat (limited to 'platform')
-rw-r--r--platform/android/src/native_map_view.cpp4
-rw-r--r--platform/darwin/src/MGLStyle.mm2
2 files changed, 3 insertions, 3 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index 604fdbe2ae..db30d87a5b 100644
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -1099,8 +1099,8 @@ void NativeMapView::removeImage(JNIEnv& env, const jni::String& name) {
}
jni::Local<jni::Object<Bitmap>> NativeMapView::getImage(JNIEnv& env, const jni::String& name) {
- if (auto* image = map->getStyle().getImage(jni::Make<std::string>(env, name))) {
- return Bitmap::CreateBitmap(env, *image);
+ if (auto image = map->getStyle().getImage(jni::Make<std::string>(env, name))) {
+ return Bitmap::CreateBitmap(env, image->getImage());
}
return jni::Local<jni::Object<Bitmap>>();
}
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm
index cab0eaae28..6a496dc3c0 100644
--- a/platform/darwin/src/MGLStyle.mm
+++ b/platform/darwin/src/MGLStyle.mm
@@ -528,7 +528,7 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles,
}
auto styleImage = self.rawStyle->getImage([name UTF8String]);
- return styleImage ? [[MGLImage alloc] initWithMGLStyleImage:styleImage] : nil;
+ return styleImage ? [[MGLImage alloc] initWithMGLStyleImage:&(*styleImage)] : nil;
}
#pragma mark Style transitions