GLMapVectorImageFactory
@interface GLMapVectorImageFactory : NSObject
GLMapVectorImageFactory used to render images from svgpb files. Image factory caches rendered images for future use.
SVGPB - is preprocessed small and fast SVG files. SVG tags saved into protocol buffer files to maximize parsing speed. Resulting files 5 times smaller and 10x times faster to parse.
To create svgpb files from your svg images please use open source util from https://github.com/molind/svgpb
-
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 isNODeclaration
Objective-C
@property (atomic, assign, unsafe_unretained, readwrite) 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 (atomic, strong, readwrite) GLMapResourceBlock _Nonnull resourceBlock; -
If timestamp is changed - image will be updated.
Declaration
Objective-C
@property (atomic, strong, readwrite) GLMapTimestampBlock _Nonnull timestampBlock; -
Removes all memory cached images
Declaration
Objective-C
- (void)clearCaches; -
Delete all cached images files
Declaration
Objective-C
- (void)deleteCachedFiles; -
Renders
UIImagefrom svgpb file.Declaration
Objective-C
- (nullable UIImage *)imageFromSvgpb:(nonnull NSString *)imagePath;Parameters
imagePathPath to the svgpb file
Return Value
Returns rendered image
-
Renders
UIImagefrom svgpb file.Declaration
Objective-C
- (nullable UIImage *)imageFromSvgpb:(nonnull NSString *)imagePath withScale:(double)scale;Parameters
imagePathPath to the svgpb file
scaleScale applied during render. 1.0 - original image size.
Return Value
Returns rendered image
-
Renders
UIImagefrom svgpb file.Declaration
Objective-C
- (nullable UIImage *)imageFromSvgpb:(nonnull NSString *)imagePath withScale:(double)scale andTintColor:(GLMapColor)tintColor;Parameters
imagePathPath to the svgpb file
scaleScale applied during render. 1.0 - original image size.
tintColorTint color applied to the image. Use
0, when no tint required.Return Value
Returns rendered image
-
Renders
UIImagefrom svgpb file.Declaration
Objective-C
- (nullable UIImage *)imageFromSvgpb:(nonnull NSString *)imagePath withSize:(CGSize)size andTintColor:(GLMapColor)tintColor;Parameters
imagePathPath to the svgpb file
sizeTarget image size
tintColorTint color applied to the image. Use
0, when no tint required.Return Value
Returns rendered image
-
Renders
UIImagefrom svgpb file.Declaration
Objective-C
- (nullable UIImage *)imageFromSvgpb:(nonnull NSString *)imagePath withSize:(CGSize)size contentMode:(UIViewContentMode)contentMode andTintColor:(GLMapColor)tintColor;Parameters
imagePathPath to the svgpb file
sizeTarget image size
contentModeImage placement inside the canvas
tintColorTint 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 UIImage *)cachedImageWithKey:(nonnull NSString *)key timestamp:(double)timestamp;Parameters
keykey of cached image
timestamptimestamp 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 UIImage *)img withKey:(nonnull NSString *)key timestamp:(double)timestamp;Parameters
imgimage to cache
keykey of image
timestamptimestamp of image. If NaN image will be cached only in memory *
Install in Dash
GLMapVectorImageFactory Class Reference