GLMapRasterTileSource
Objective-C
@interface GLMapRasterTileSource : GLMapTileSource
Swift
class GLMapRasterTileSource : GLMapTileSource
GLMapRasterTileSource is used to setup custom raster tile source.
-
Initializes tile source. If cachePath==nil no caching will happens.
Declaration
Objective-C
- (instancetype _Nullable)initWithCachePath:(NSString *_Nullable)cachePath;
Swift
init?(cachePath: String?)
-
Gets url of tile. Default implementation reuturns nil.
Declaration
Objective-C
- (NSURL *_Nullable)urlForTilePos:(GLMapTilePos)pos;
Swift
func url(for pos: GLMapTilePos) -> URL?
-
Gets image data of tile. Default implementation reuturns nil.
Declaration
Objective-C
- (NSData *_Nullable)imageDataForTilePos:(GLMapTilePos)pos expired:(BOOL *_Nonnull)expired;
Swift
func imageData(for pos: GLMapTilePos, expired: UnsafeMutablePointer<ObjCBool>) -> Data?
-
Gets image of tile. Default implementation reuturns nil.
Declaration
Objective-C
- (PlatformImage *_Nullable)imageForTilePos:(GLMapTilePos)pos expired:(BOOL *_Nonnull)expired;
Swift
func image(for pos: GLMapTilePos, expired: UnsafeMutablePointer<ObjCBool>) -> NSImage?
-
Override this to implement custom caching. Default implementation does nothing.
Declaration
Objective-C
- (void)saveTileData:(NSData *_Nonnull)data forTilePos:(GLMapTilePos)pos;
Swift
func saveTileData(_ data: Data, for pos: GLMapTilePos)
-
Cached tile will be refreshed if it will stay in cache more than given time.
By default tileRefreshTimeInterval = -1. If tileRefreshTimeInterval < 0 no tile refreshing will be triggered.
Declaration
Objective-C
@property int64_t tileRefreshTimeInterval;
Swift
var tileRefreshTimeInterval: Int64 { get set }
-
Defines valid zooms for tile source. Default is 0xFFFFFFFF.
Declaration
Objective-C
@property uint32_t validZoomMask;
Swift
var validZoomMask: UInt32 { get set }
-
Allows to draw tiles after maximum zoom
Declaration
Objective-C
@property BOOL overzoom;
Swift
var overzoom: Bool { get set }
-
Size of tile in points. Could be used to magnify raster tiles. Default is 256.
Declaration
Objective-C
@property uint32_t tileSize;
Swift
var tileSize: UInt32 { get set }
-
Sets attribution text for map source. Default is @“© OpenStreetMap”
Declaration
Objective-C
@property (strong) NSString *_Nullable attributionText;
Swift
var attributionText: String? { get set }
-
Gets size of cache file
Declaration
Objective-C
@property (readonly) uint64_t cacheSize;
Swift
var cacheSize: UInt64 { get }
-
Removes all cached data
Declaration
Objective-C
- (void)dropCache;
Swift
func dropCache()