GLMapVectorImageFactory


@interface GLMapVectorImageFactory : NSObject

GLMapVectorImageFactory used to render images from svg files. Image factory caches rendered images for future use.

  • Unavailable

    It’s singleton object. Use [GLMapVectorImageFactory sharedFactory]

    Plain -init is disabled

    Declaration

    Objective-C

    - (instancetype _Nonnull)init;
  • Disables disk caching if set to YES. Default value is NO

    Declaration

    Objective-C

    @property BOOL disableCaching;
  • Returns singleton factory object

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) GLMapVectorImageFactory *_Nonnull sharedFactory;
  • If not nil - GLMapVectorImageFactory will try to get image data using this block. If no data returned it will fallback to direct file reading

    Declaration

    Objective-C

    @property (strong) GLMapResourceBlock _Nonnull resourceBlock;
  • If timestamp is changed - image will be updated.

    Declaration

    Objective-C

    @property (strong) GLMapTimestampBlock _Nonnull timestampBlock;
  • Removes all memory cached images

    Declaration

    Objective-C

    - (void)clearCaches;
  • Delete all cached images files

    Declaration

    Objective-C

    - (void)deleteCachedFiles;
  • Renders UIImage from svg file.

    Declaration

    Objective-C

    - (nullable PlatformImage *)imageFromSvg:(nonnull NSString *)imagePath;

    Parameters

    imagePath

    Path to the svg file

    Return Value

    Returns rendered image

  • Renders UIImage from svg file.

    Declaration

    Objective-C

    - (nullable PlatformImage *)imageFromSvg:(nonnull NSString *)imagePath
                                   withScale:(double)scale;

    Parameters

    imagePath

    Path to the svg file

    scale

    Scale applied during render. 1.0 - original image size.

    Return Value

    Returns rendered image

  • Renders UIImage from svg file.

    Declaration

    Objective-C

    - (nullable PlatformImage *)imageFromSvg:(nonnull NSString *)imagePath
                                   withScale:(double)scale
                                andTintColor:(GLMapColor)tintColor;

    Parameters

    imagePath

    Path to the svg file

    scale

    Scale applied during render. 1.0 - original image size.

    tintColor

    Tint color applied to the image. Use 0, when no tint required.

    Return Value

    Returns rendered image

  • Renders UIImage from svg file.

    Declaration

    Objective-C

    - (nullable PlatformImage *)imageFromSvg:(nonnull NSString *)imagePath
                                    withSize:(CGSize)size
                                andTintColor:(GLMapColor)tintColor;

    Parameters

    imagePath

    Path to the svg file

    size

    Target image size

    tintColor

    Tint color applied to the image. Use 0, when no tint required.

    Return Value

    Returns rendered image

  • Renders UIImage from svg file.

    Declaration

    Objective-C

    - (nullable PlatformImage *)imageFromSvg:(nonnull NSString *)imagePath
                                    withSize:(CGSize)size
                                  isInCenter:(BOOL)isInCenter
                                andTintColor:(GLMapColor)tintColor;

    Parameters

    imagePath

    Path to the svg file

    size

    Target image size

    isInCenter

    Image placement inside the canvas

    tintColor

    Tint color applied to the image. Use 0, when no tint required.

    Return Value

    Returns rendered image

  • Returns cached image for key

    Declaration

    Objective-C

    - (nullable PlatformImage *)cachedImageWithKey:(nonnull NSString *)key
                                         timestamp:(double)timestamp;

    Parameters

    key

    key of cached image

    timestamp

    timestamp to check modifications

    Return Value

    caceded image or nil if no image cached for key or timestamp are not equal *

  • Caches image

    Declaration

    Objective-C

    - (void)cacheImage:(nonnull PlatformImage *)img
               withKey:(nonnull NSString *)key
             timestamp:(double)timestamp;

    Parameters

    img

    image to cache

    key

    key of image

    timestamp

    timestamp of image. If NaN image will be cached only in memory *

  • Deletes cached image

    Declaration

    Objective-C

    - (void)deleteCached:(nonnull NSString *)key;

    Parameters

    key

    key of image *