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

#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