diff options
Diffstat (limited to 'platform/darwin/src')
-rw-r--r-- | platform/darwin/src/MGLRasterDEMSource.h | 4 | ||||
-rw-r--r-- | platform/darwin/src/MGLRasterDEMSource.mm | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLRasterStyleLayer.h | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLRasterTileSource.h (renamed from platform/darwin/src/MGLRasterSource.h) | 41 | ||||
-rw-r--r-- | platform/darwin/src/MGLRasterTileSource.mm (renamed from platform/darwin/src/MGLRasterSource.mm) | 14 | ||||
-rw-r--r-- | platform/darwin/src/MGLRasterTileSource_Private.h (renamed from platform/darwin/src/MGLRasterSource_Private.h) | 4 | ||||
-rw-r--r-- | platform/darwin/src/MGLSource.h | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLStyle.mm | 4 | ||||
-rw-r--r-- | platform/darwin/src/MGLTileSource.h | 2 |
9 files changed, 39 insertions, 36 deletions
diff --git a/platform/darwin/src/MGLRasterDEMSource.h b/platform/darwin/src/MGLRasterDEMSource.h index d00912ca79..c53ca9867d 100644 --- a/platform/darwin/src/MGLRasterDEMSource.h +++ b/platform/darwin/src/MGLRasterDEMSource.h @@ -1,6 +1,6 @@ #import "MGLFoundation.h" -#import "MGLRasterSource.h" +#import "MGLRasterTileSource.h" /** `MGLRasterDEMSource` is a map content source that supplies rasterized @@ -32,6 +32,6 @@ ``` */ MGL_EXPORT -@interface MGLRasterDEMSource : MGLRasterSource +@interface MGLRasterDEMSource : MGLRasterTileSource @end diff --git a/platform/darwin/src/MGLRasterDEMSource.mm b/platform/darwin/src/MGLRasterDEMSource.mm index d8639b70e3..27614b9ef4 100644 --- a/platform/darwin/src/MGLRasterDEMSource.mm +++ b/platform/darwin/src/MGLRasterDEMSource.mm @@ -1,6 +1,6 @@ #import "MGLRasterDEMSource.h" -#import "MGLRasterSource_Private.h" +#import "MGLRasterTileSource_Private.h" #import "NSURL+MGLAdditions.h" #import <mbgl/style/sources/raster_dem_source.hpp> diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h index fd41f271ed..bca9649e5d 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.h +++ b/platform/darwin/src/MGLRasterStyleLayer.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN imagery on the map, especially raster tiles. Use a raster style layer to configure the color parameters of raster tiles - loaded by an `MGLRasterSource` object or raster images loaded by an + loaded by an `MGLRasterTileSource` object or raster images loaded by an `MGLImageSource` object. For example, you could use a raster style layer to render <a href="https://www.mapbox.com/satellite/">Mapbox Satellite</a> imagery, a <a diff --git a/platform/darwin/src/MGLRasterSource.h b/platform/darwin/src/MGLRasterTileSource.h index 4f4b7c96c3..6306ead5fb 100644 --- a/platform/darwin/src/MGLRasterSource.h +++ b/platform/darwin/src/MGLRasterTileSource.h @@ -8,39 +8,41 @@ NS_ASSUME_NONNULL_BEGIN /** An `NSNumber` object containing a floating-point number that specifies the width and height (measured in points) at which the map displays each raster - image tile when the map’s zoom level is an integer. The raster source scales - its images up or down when the map’s zoom level falls between two integers. + image tile when the map’s zoom level is an integer. The raster tile source + scales its images up or down when the map’s zoom level falls between two + integers. The default value for this option is 512. Version 4 of the <a href="https://www.mapbox.com/api-documentation/#maps">Mapbox Maps API</a> requires a value of 256, as do many third-party tile servers, so consult your provider’s documentation for the correct value. - This option is only applicable to `MGLRasterSource` objects; it is ignored when + This option is only applicable to `MGLRasterTileSource` objects; it is ignored when initializing `MGLVectorSource` objects. */ extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionTileSize; /** - `MGLRasterSource` is a map content source that supplies raster image tiles to - be shown on the map. The location of and metadata about the tiles are defined - either by an option dictionary or by an external file that conforms to the + `MGLRasterTileSource` is a map content source that supplies raster image tiles + to be shown on the map. The location of and metadata about the tiles are + defined either by an option dictionary or by an external file that conforms to + the <a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>. - A raster source is added to an `MGLStyle` object along with one or more + A raster tile source is added to an `MGLStyle` object along with one or more `MGLRasterStyleLayer` objects. Use a raster style layer to control the - appearance of content supplied by the raster source. + appearance of content supplied by the raster tile source. Each <a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-raster"><code>raster</code></a> source defined by the style JSON file is represented at runtime by an - `MGLRasterSource` object that you can use to initialize new style layers. You + `MGLRasterTileSource` object that you can use to initialize new style layers. You can also add and remove sources dynamically using methods such as `-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`. ### Example ```swift - let source = MGLRasterSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ + let source = MGLRasterTileSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ .minimumZoomLevel: 9, .maximumZoomLevel: 16, .tileSize: 512, @@ -52,12 +54,13 @@ extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionTileSize; ``` */ MGL_EXPORT -@interface MGLRasterSource : MGLTileSource +@interface MGLRasterTileSource : MGLTileSource #pragma mark Initializing a Source /** - Returns a raster source initialized with an identifier and configuration URL. + Returns a raster tile source initialized with an identifier and configuration + URL. After initializing and configuring the source, add it to a map view’s style using the `-[MGLStyle addSource:]` method. @@ -77,13 +80,13 @@ MGL_EXPORT which it is added. @param configurationURL A URL to a TileJSON configuration file describing the source’s contents and other metadata. - @return An initialized raster source. + @return An initialized raster tile source. */ - (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL; /** - Returns a raster source initialized with an identifier, configuration URL, and - tile size. + Returns a raster tile source initialized with an identifier, configuration URL, + and tile size. After initializing and configuring the source, add it to a map view’s style using the `-[MGLStyle addSource:]` method. @@ -98,14 +101,14 @@ MGL_EXPORT @param configurationURL A URL to a TileJSON configuration file describing the source’s contents and other metadata. @param tileSize The width and height (measured in points) of each tiled image - in the raster source. See the `MGLTileSourceOptionTileSize` documentation - for details. - @return An initialized raster source. + in the raster tile source. See the `MGLTileSourceOptionTileSize` + documentation for details. + @return An initialized raster tile source. */ - (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize NS_DESIGNATED_INITIALIZER; /** - Returns a raster source initialized an identifier, tile URL templates, and + Returns a raster tile source initialized an identifier, tile URL templates, and options. Tile URL templates are strings that specify the URLs of the raster tile images diff --git a/platform/darwin/src/MGLRasterSource.mm b/platform/darwin/src/MGLRasterTileSource.mm index c47cc199eb..02cfef4ae8 100644 --- a/platform/darwin/src/MGLRasterSource.mm +++ b/platform/darwin/src/MGLRasterTileSource.mm @@ -1,4 +1,4 @@ -#import "MGLRasterSource_Private.h" +#import "MGLRasterTileSource_Private.h" #import "MGLMapView_Private.h" #import "MGLSource_Private.h" @@ -10,16 +10,16 @@ const MGLTileSourceOption MGLTileSourceOptionTileSize = @"MGLTileSourceOptionTileSize"; -static const CGFloat MGLRasterSourceClassicTileSize = 256; -static const CGFloat MGLRasterSourceRetinaTileSize = 512; +static const CGFloat MGLRasterTileSourceClassicTileSize = 256; +static const CGFloat MGLRasterTileSourceRetinaTileSize = 512; -@interface MGLRasterSource () +@interface MGLRasterTileSource () @property (nonatomic, readonly) mbgl::style::RasterSource *rawSource; @end -@implementation MGLRasterSource +@implementation MGLRasterTileSource - (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL { // The style specification default is 512, but 256 is the expected value for @@ -28,7 +28,7 @@ static const CGFloat MGLRasterSourceRetinaTileSize = 512; BOOL isMapboxURL = ([configurationURL.scheme isEqualToString:@"mapbox"] && [configurationURL.host containsString:@"."] && (!configurationURL.path.length || [configurationURL.path isEqualToString:@"/"])); - CGFloat tileSize = isMapboxURL ? MGLRasterSourceClassicTileSize : MGLRasterSourceRetinaTileSize; + CGFloat tileSize = isMapboxURL ? MGLRasterTileSourceClassicTileSize : MGLRasterTileSourceRetinaTileSize; return [self initWithIdentifier:identifier configurationURL:configurationURL tileSize:tileSize]; } @@ -47,7 +47,7 @@ static const CGFloat MGLRasterSourceRetinaTileSize = 512; - (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NS_ARRAY_OF(NSString *) *)tileURLTemplates options:(nullable NS_DICTIONARY_OF(MGLTileSourceOption, id) *)options { mbgl::Tileset tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, options); - uint16_t tileSize = MGLRasterSourceRetinaTileSize; + uint16_t tileSize = MGLRasterTileSourceRetinaTileSize; if (NSNumber *tileSizeNumber = options[MGLTileSourceOptionTileSize]) { if (![tileSizeNumber isKindOfClass:[NSNumber class]]) { [NSException raise:NSInvalidArgumentException diff --git a/platform/darwin/src/MGLRasterSource_Private.h b/platform/darwin/src/MGLRasterTileSource_Private.h index 6f40fbc5a9..128dcb447d 100644 --- a/platform/darwin/src/MGLRasterSource_Private.h +++ b/platform/darwin/src/MGLRasterTileSource_Private.h @@ -1,4 +1,4 @@ -#import "MGLRasterSource.h" +#import "MGLRasterTileSource.h" #include <memory> @@ -10,7 +10,7 @@ namespace mbgl { NS_ASSUME_NONNULL_BEGIN -@interface MGLRasterSource (Private) +@interface MGLRasterTileSource (Private) @property (nonatomic, readonly) mbgl::style::RasterSource *rawSource; diff --git a/platform/darwin/src/MGLSource.h b/platform/darwin/src/MGLSource.h index 8d8c936833..e3e45faca8 100644 --- a/platform/darwin/src/MGLSource.h +++ b/platform/darwin/src/MGLSource.h @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN `-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`. Create instances of `MGLShapeSource`, `MGLImageSource` and the concrete subclasses of - `MGLTileSource` (`MGLVectorSource` and `MGLRasterSource`) in order to use + `MGLTileSource` (`MGLVectorSource` and `MGLRasterTileSource`) in order to use `MGLSource`'s properties and methods. Do not create instances of `MGLSource` directly, and do not create your own subclasses of this class. */ diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index 199f6c2e02..35db1b2118 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -20,7 +20,7 @@ #import "MGLTileSource_Private.h" #import "MGLVectorSource.h" #import "MGLVectorSource_Private.h" -#import "MGLRasterSource.h" +#import "MGLRasterTileSource.h" #import "MGLRasterDEMSource.h" #import "MGLShapeSource.h" #import "MGLImageSource.h" @@ -187,7 +187,7 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles, } else if (auto geoJSONSource = rawSource->as<mbgl::style::GeoJSONSource>()) { return [[MGLShapeSource alloc] initWithRawSource:geoJSONSource mapView:self.mapView]; } else if (auto rasterSource = rawSource->as<mbgl::style::RasterSource>()) { - return [[MGLRasterSource alloc] initWithRawSource:rasterSource mapView:self.mapView]; + return [[MGLRasterTileSource alloc] initWithRawSource:rasterSource mapView:self.mapView]; } else if (auto rasterDEMSource = rawSource->as<mbgl::style::RasterDEMSource>()) { return [[MGLRasterDEMSource alloc] initWithRawSource:rasterDEMSource mapView:self.mapView]; } else if (auto imageSource = rawSource->as<mbgl::style::ImageSource>()) { diff --git a/platform/darwin/src/MGLTileSource.h b/platform/darwin/src/MGLTileSource.h index 2d75fa14d8..c6e63179c9 100644 --- a/platform/darwin/src/MGLTileSource.h +++ b/platform/darwin/src/MGLTileSource.h @@ -184,7 +184,7 @@ typedef NS_ENUM(NSUInteger, MGLDEMEncoding) { Mapbox-hosted tile set, view it in <a href="https://www.mapbox.com/studio/tilesets/">Mapbox Studio’s Tilesets editor</a>. - Create instances of `MGLRasterSource` and `MGLVectorSource` in order to use + Create instances of `MGLRasterTileSource` and `MGLVectorSource` in order to use `MGLTileSource`'s properties and methods. Do not create instances of `MGLTileSource` directly, and do not create your own subclasses of this class. */ |