summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-15 14:09:06 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-16 12:26:35 -0700
commitcc1ea759a681cadcfd06fd7bdda79ca6deb38c62 (patch)
tree97ece422b0516b11979c84b8136f95aeabb1aa91 /platform/ios
parentc0f6e5ccefc67dbdaa6ab7c7ea75a2a2d0c3f2ae (diff)
downloadqtlocation-mapboxgl-cc1ea759a681cadcfd06fd7bdda79ca6deb38c62.tar.gz
[core, node, darwin, android, qt] Make image ID part of Image
More like Source and Layer.
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/src/MGLMapView.mm2
-rw-r--r--platform/ios/src/UIImage+MGLAdditions.h2
-rw-r--r--platform/ios/src/UIImage+MGLAdditions.mm5
3 files changed, 5 insertions, 4 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index a4c9f5194c..8cba1187ea 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -3449,7 +3449,7 @@ public:
annotationImage.delegate = self;
// add sprite
- _mbglMap->addAnnotationImage(iconIdentifier.UTF8String, annotationImage.image.mgl_styleImage);
+ _mbglMap->addAnnotationImage([annotationImage.image mgl_styleImageWithIdentifier:iconIdentifier]);
// Create a slop area with a “radius” equal in size to the annotation
// image’s alignment rect, allowing the eventual tap to be on any point
diff --git a/platform/ios/src/UIImage+MGLAdditions.h b/platform/ios/src/UIImage+MGLAdditions.h
index 642355d412..0b4cb4c015 100644
--- a/platform/ios/src/UIImage+MGLAdditions.h
+++ b/platform/ios/src/UIImage+MGLAdditions.h
@@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable instancetype)initWithMGLStyleImage:(const mbgl::style::Image *)styleImage;
-- (std::unique_ptr<mbgl::style::Image>)mgl_styleImage;
+- (std::unique_ptr<mbgl::style::Image>)mgl_styleImageWithIdentifier:(NSString *)identifier;
@end
diff --git a/platform/ios/src/UIImage+MGLAdditions.mm b/platform/ios/src/UIImage+MGLAdditions.mm
index 4ced1e30d5..b10c48a62a 100644
--- a/platform/ios/src/UIImage+MGLAdditions.mm
+++ b/platform/ios/src/UIImage+MGLAdditions.mm
@@ -22,9 +22,10 @@
return self;
}
-- (std::unique_ptr<mbgl::style::Image>)mgl_styleImage {
+- (std::unique_ptr<mbgl::style::Image>)mgl_styleImageWithIdentifier:(NSString *)identifier {
BOOL isTemplate = self.renderingMode == UIImageRenderingModeAlwaysTemplate;
- return std::make_unique<mbgl::style::Image>(MGLPremultipliedImageFromCGImage(self.CGImage),
+ return std::make_unique<mbgl::style::Image>([identifier UTF8String],
+ MGLPremultipliedImageFromCGImage(self.CGImage),
float(self.scale), isTemplate);
}