diff options
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 7 | ||||
-rw-r--r-- | platform/ios/src/UIImage+MGLAdditions.h | 6 | ||||
-rw-r--r-- | platform/ios/src/UIImage+MGLAdditions.mm | 14 |
3 files changed, 13 insertions, 14 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 01611e03f2..42079baf94 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -8,7 +8,6 @@ #include <mbgl/map/map.hpp> #include <mbgl/map/view.hpp> #include <mbgl/annotation/annotation.hpp> -#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/map/camera.hpp> #include <mbgl/map/mode.hpp> #include <mbgl/util/platform.hpp> @@ -16,6 +15,7 @@ #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/storage/network_status.hpp> +#include <mbgl/style/image.hpp> #include <mbgl/style/transition_options.hpp> #include <mbgl/style/layers/custom_layer.hpp> #include <mbgl/map/backend.hpp> @@ -3451,8 +3451,7 @@ public: annotationImage.delegate = self; // add sprite - std::shared_ptr<mbgl::SpriteImage> sprite(annotationImage.image.mgl_spriteImage); - _mbglMap->addAnnotationIcon(iconIdentifier.UTF8String, sprite); + _mbglMap->addAnnotationImage(iconIdentifier.UTF8String, annotationImage.image.mgl_styleImage); // 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 @@ -4096,7 +4095,7 @@ public: // Remove the old icon from the style. if ( ! [iconIdentifier isEqualToString:fallbackIconIdentifier]) { - _mbglMap->removeAnnotationIcon(iconIdentifier.UTF8String); + _mbglMap->removeAnnotationImage(iconIdentifier.UTF8String); } if (annotationImage.image) diff --git a/platform/ios/src/UIImage+MGLAdditions.h b/platform/ios/src/UIImage+MGLAdditions.h index f291a302c9..642355d412 100644 --- a/platform/ios/src/UIImage+MGLAdditions.h +++ b/platform/ios/src/UIImage+MGLAdditions.h @@ -1,14 +1,14 @@ #import <UIKit/UIKit.h> -#include <mbgl/sprite/sprite_image.hpp> +#include <mbgl/style/image.hpp> NS_ASSUME_NONNULL_BEGIN @interface UIImage (MGLAdditions) -- (nullable instancetype)initWithMGLSpriteImage:(const mbgl::SpriteImage *)spriteImage; +- (nullable instancetype)initWithMGLStyleImage:(const mbgl::style::Image *)styleImage; -- (std::unique_ptr<mbgl::SpriteImage>)mgl_spriteImage; +- (std::unique_ptr<mbgl::style::Image>)mgl_styleImage; @end diff --git a/platform/ios/src/UIImage+MGLAdditions.mm b/platform/ios/src/UIImage+MGLAdditions.mm index d99a1f73ed..db64d78232 100644 --- a/platform/ios/src/UIImage+MGLAdditions.mm +++ b/platform/ios/src/UIImage+MGLAdditions.mm @@ -4,16 +4,16 @@ @implementation UIImage (MGLAdditions) -- (nullable instancetype)initWithMGLSpriteImage:(const mbgl::SpriteImage *)spriteImage +- (nullable instancetype)initWithMGLStyleImage:(const mbgl::style::Image *)styleImage { - CGImageRef image = CGImageFromMGLPremultipliedImage(spriteImage->image.clone()); + CGImageRef image = CGImageFromMGLPremultipliedImage(styleImage->image.clone()); if (!image) { return nil; } - if (self = [self initWithCGImage:image scale:spriteImage->pixelRatio orientation:UIImageOrientationUp]) + if (self = [self initWithCGImage:image scale:styleImage->pixelRatio orientation:UIImageOrientationUp]) { - if (spriteImage->sdf) + if (styleImage->sdf) { self = [self imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; } @@ -22,10 +22,10 @@ return self; } -- (std::unique_ptr<mbgl::SpriteImage>)mgl_spriteImage { +- (std::unique_ptr<mbgl::style::Image>)mgl_styleImage { BOOL isTemplate = self.renderingMode == UIImageRenderingModeAlwaysTemplate; - return std::make_unique<mbgl::SpriteImage>(MGLPremultipliedImageFromCGImage(self.CGImage), - float(self.scale), isTemplate); + return std::make_unique<mbgl::style::Image>(MGLPremultipliedImageFromCGImage(self.CGImage), + float(self.scale), isTemplate); } @end |