summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLRasterSource.mm
blob: b3e474f36fb4e327116b47cb7930713306fb9dd3 (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
#import "MGLRasterSource.h"

#import "MGLSource_Private.hpp"

#include <mbgl/style/sources/raster_source.hpp>

@implementation MGLRasterSource

- (instancetype)initWithSourceIdentifier:(NSString *)sourceIdentifier URL:(NSURL *)url tileSize:(CGFloat)tileSize {
    if (self = [super initWithSourceIdentifier:sourceIdentifier]) {
        _URL = url;
        _tileSize = tileSize;
    }
    return self;
}

- (std::unique_ptr<mbgl::style::Source>)mbgl_source {
    auto source = std::make_unique<mbgl::style::RasterSource>(self.sourceIdentifier.UTF8String,
                                                              self.URL.absoluteString.UTF8String,
                                                              uint16_t(self.tileSize));
    return std::move(source);
}

@end