summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLRasterSource.h
blob: bf561df8dab27785c75fc94dc3411242102c0d57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#import "MGLSource.h"
#import "MGLTypes.h"

#import <CoreGraphics/CoreGraphics.h>

@class MGLTileSet;

NS_ASSUME_NONNULL_BEGIN

/**
 A raster tile source.
 
 @see <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-raster">The
 style specification.</a>
 */
@interface MGLRasterSource : MGLSource

/**
 A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and 
 `mapbox://<mapid>`.
 
 @see <a href="https://www.mapbox.com/help/an-open-platform/#tilejson">The 
 TileJSON specification.</a>
 */
@property (nonatomic, readonly, copy) NSURL *URL;

/**
 The minimum visual size to display tiles for this source. Units in pixels. 
 Defaults to `512` on each tile side.
 */
@property (nonatomic, readonly, assign) NSUInteger tileSize;

/**
 The tile set used to locate and download tiles. 
 
 A tile set holds the raster tile URL template strings and associated
 configuration for those strings. It can be passed in place of the URL
 to TileJSON in order to create a source configured to download tiles
 from ordinary web URLs.
 */
@property (nonatomic, readonly, nullable) MGLTileSet *tileSet;

/**
 Initializes a source with the given identifier, TileJSON configuration
 URL, and tile size.

 @param sourceIdentifier A string that uniquely identifies the source.
 @param url A URL to a TileJSON resource.
 @param tileSize The minimum visual size to display tiles for the source.
 */
- (instancetype)initWithSourceIdentifier:(NSString *)sourceIdentifier URL:(NSURL *)url tileSize:(CGFloat)tileSize;

/**
 Initializes a source with the given identifier, tile size, and tile 
 URL template set.

 @param sourceIdentifier A string that uniquely identifies the source.
 @param tileSet A tile set describing where to download tiles.
 @param tileSize The minimum visual size to display tiles for the source.
 */
- (instancetype)initWithSourceIdentifier:(NSString *)sourceIdentifier tileSet:(MGLTileSet *)tileSet tileSize:(CGFloat)tileSize;

@end

NS_ASSUME_NONNULL_END