From 29a8efab26dfbdbe9b30b3913d397329be5edb95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 30 Mar 2018 05:13:08 -0700 Subject: [ios, macos] Renamed MGLRasterSource to MGLRasterTileSource Also updated various source class listings to reflect the addition of image and raster DEM sources. --- .../darwin/docs/guides/For Style Authors.md.ejs | 9 +- .../darwin/docs/guides/Tile URL Templates.md.ejs | 14 +-- .../darwin/scripts/style-spec-overrides-v8.json | 2 +- platform/darwin/src/MGLRasterDEMSource.h | 4 +- platform/darwin/src/MGLRasterDEMSource.mm | 2 +- platform/darwin/src/MGLRasterSource.h | 131 -------------------- platform/darwin/src/MGLRasterSource.mm | 77 ------------ platform/darwin/src/MGLRasterSource_Private.h | 21 ---- platform/darwin/src/MGLRasterStyleLayer.h | 2 +- platform/darwin/src/MGLRasterTileSource.h | 134 +++++++++++++++++++++ platform/darwin/src/MGLRasterTileSource.mm | 77 ++++++++++++ platform/darwin/src/MGLRasterTileSource_Private.h | 21 ++++ platform/darwin/src/MGLSource.h | 2 +- platform/darwin/src/MGLStyle.mm | 4 +- platform/darwin/src/MGLTileSource.h | 2 +- .../darwin/test/MGLDocumentationExampleTests.swift | 6 +- platform/darwin/test/MGLStyleTests.mm | 48 ++++---- platform/ios/CHANGELOG.md | 1 + platform/ios/app/MBXViewController.m | 22 ++-- platform/ios/docs/guides/For Style Authors.md | 9 +- platform/ios/docs/guides/Tile URL Templates.md | 14 +-- platform/ios/ios.xcodeproj/project.pbxproj | 36 +++--- platform/ios/jazzy.yml | 6 +- platform/ios/src/MGLMapView.h | 8 +- platform/ios/src/Mapbox.h | 2 +- platform/macos/CHANGELOG.md | 1 + platform/macos/docs/guides/For Style Authors.md | 9 +- platform/macos/docs/guides/Tile URL Templates.md | 14 +-- platform/macos/jazzy.yml | 5 +- platform/macos/macos.xcodeproj/project.pbxproj | 24 ++-- platform/macos/src/MGLMapView.h | 8 +- platform/macos/src/Mapbox.h | 2 +- 32 files changed, 363 insertions(+), 354 deletions(-) delete mode 100644 platform/darwin/src/MGLRasterSource.h delete mode 100644 platform/darwin/src/MGLRasterSource.mm delete mode 100644 platform/darwin/src/MGLRasterSource_Private.h create mode 100644 platform/darwin/src/MGLRasterTileSource.h create mode 100644 platform/darwin/src/MGLRasterTileSource.mm create mode 100644 platform/darwin/src/MGLRasterTileSource_Private.h diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index 45cfa105b8..8b9b4b06fc 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -178,17 +178,18 @@ source object is a member of one of the following subclasses of `MGLSource`: In style JSON | In the SDK --------------|----------- -`geojson` | `MGLShapeSource` -`raster` | `MGLRasterSource` `vector` | `MGLVectorSource` +`raster` | `MGLRasterTileSource` +`raster-dem` | `MGLRasterDEMSource` +`geojson` | `MGLShapeSource` `image` | `MGLImageSource` `canvas` and `video` sources are not supported. ### Tile sources -Raster and vector sources may be defined in TileJSON configuration files. This -SDK supports the properties defined in the style specification, which are a +Raster and vector tile sources may be defined in TileJSON configuration files. +This SDK supports the properties defined in the style specification, which are a subset of the keys defined in version 2.1.0 of the [TileJSON](https://github.com/mapbox/tilejson-spec/tree/master/2.1.0) specification. As an alternative to authoring a custom TileJSON file, you may diff --git a/platform/darwin/docs/guides/Tile URL Templates.md.ejs b/platform/darwin/docs/guides/Tile URL Templates.md.ejs index 78fb297138..558d5b451f 100644 --- a/platform/darwin/docs/guides/Tile URL Templates.md.ejs +++ b/platform/darwin/docs/guides/Tile URL Templates.md.ejs @@ -10,12 +10,12 @@ --> # Tile URL Templates -`MGLTileSource` objects, specifically `MGLRasterSource` and `MGLVectorSource` -objects, can be created using an initializer that accepts an array of tile URL -templates. Tile URL templates are strings that specify the URLs of the vector -tiles or raster tile images to load. A template resembles an absolute URL, but -with any number of placeholder strings that the source evaluates based on the -tile it needs to load. For example: +`MGLTileSource` objects, specifically `MGLRasterTileSource` and +`MGLVectorSource` objects, can be created using an initializer that accepts an +array of tile URL templates. Tile URL templates are strings that specify the +URLs of the vector tiles or raster tile images to load. A template resembles an +absolute URL, but with any number of placeholder strings that the source +evaluates based on the tile it needs to load. For example: * `http://www.example.com/tiles/{z}/{x}/{y}.pbf` could be evaluated as `http://www.example.com/tiles/14/6/9.pbf`. @@ -62,7 +62,7 @@ all of which are optional: The tile’s zoom level. At zoom level 0, each tile covers the entire world map; at zoom level 1, it covers ¼ of the world; at zoom level 2, 116 of the world, and so on. For tiles loaded by - a MGLRasterSource object, whether the tile zoom level + a MGLRasterTileSource object, whether the tile zoom level matches the map’s current zoom level depends on the value of the source’s tile size as specified in the MGLTileSourceOptionTileSize key of the options diff --git a/platform/darwin/scripts/style-spec-overrides-v8.json b/platform/darwin/scripts/style-spec-overrides-v8.json index b0c50a06f8..be50be4e1a 100644 --- a/platform/darwin/scripts/style-spec-overrides-v8.json +++ b/platform/darwin/scripts/style-spec-overrides-v8.json @@ -27,7 +27,7 @@ "doc": "An `MGLHeatmapStyleLayer` is a style layer that renders a heatmap.\n\nA heatmap visualizes the spatial distribution of a large, dense set of point data, using color to avoid cluttering the map with individual points at low zoom levels. The points are weighted by an attribute you specify. Use a heatmap style layer in conjunction with point or point collection features in vector tiles loaded by an `MGLVectorSource` object or `MGLPointAnnotation`, `MGLPointFeature`, `MGLPointCollection`, or `MGLPointCollectionFeature` instances in an `MGLShapeSource` object.\n\nConsider accompanying a heatmap style layer with an `MGLCircleStyleLayer` or `MGLSymbolStyleLayer` at high zoom levels. If you are unsure whether the point data in an `MGLShapeSource` is dense enough to warrant a heatmap, you can alternatively cluster the source using the `MGLShapeSourceOptionClustered` option and render the data using an `MGLCircleStyleLayer` or `MGLSymbolStyleLayer`." }, "raster": { - "doc": "An `MGLRasterStyleLayer` is a style layer that renders georeferenced raster imagery on the map, especially raster tiles.\n\nUse a raster style layer to configure the color parameters of raster tiles loaded by an `MGLRasterSource` object or raster images loaded by an `MGLImageSource` object. For example, you could use a raster style layer to render Mapbox Satellite imagery, a raster tile set uploaded to Mapbox Studio, or a raster map authored in TileMill, the classic Mapbox Editor, or Mapbox Studio Classic.\n\nRaster images may also be used as icons or patterns in a style layer. To register an image for use as an icon or pattern, use the `-[MGLStyle setImage:forName:]` method. To configure a point annotation’s image, use the `MGLAnnotationImage` class." + "doc": "An `MGLRasterStyleLayer` is a style layer that renders georeferenced raster imagery on the map, especially raster tiles.\n\nUse a raster style layer to configure the color parameters of raster tiles loaded by an `MGLRasterTileSource` object or raster images loaded by an `MGLImageSource` object. For example, you could use a raster style layer to render Mapbox Satellite imagery, a raster tile set uploaded to Mapbox Studio, or a raster map authored in TileMill, the classic Mapbox Editor, or Mapbox Studio Classic.\n\nRaster images may also be used as icons or patterns in a style layer. To register an image for use as an icon or pattern, use the `-[MGLStyle setImage:forName:]` method. To configure a point annotation’s image, use the `MGLAnnotationImage` class." }, "hillshade": { "doc": "An `MGLHillshadeStyleLayer` is a style layer that renders raster digital elevation model (DEM) tiles on the map.\n\nUse a hillshade style layer to configure the color parameters of raster tiles loaded by an `MGLRasterDEMSource` object. For example, you could use a hillshade style layer to render Mapbox Terrain-RGB data.\n\nTo display posterized hillshading based on vector shapes, as with the Mapbox Terrain source, use an `MGLVectorSource` object in conjunction with several `MGLFillStyleLayer` objects." 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 diff --git a/platform/darwin/src/MGLRasterSource.h b/platform/darwin/src/MGLRasterSource.h deleted file mode 100644 index 4f4b7c96c3..0000000000 --- a/platform/darwin/src/MGLRasterSource.h +++ /dev/null @@ -1,131 +0,0 @@ -#import - -#import "MGLFoundation.h" -#import "MGLTileSource.h" - -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. - - The default value for this option is 512. Version 4 of the - Mapbox Maps API - 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 - 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 - TileJSON specification. - A raster 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. - - Each - raster - 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 - 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: [ - .minimumZoomLevel: 9, - .maximumZoomLevel: 16, - .tileSize: 512, - .attributionInfos: [ - MGLAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "http://mapbox.com")) - ] - ]) - mapView.style?.addSource(source) - ``` - */ -MGL_EXPORT -@interface MGLRasterSource : MGLTileSource - -#pragma mark Initializing a Source - -/** - Returns a raster 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. - - The URL may be a full HTTP or HTTPS URL or, for tile sets hosted by Mapbox, a - Mapbox URL indicating a map identifier (`mapbox://`). The URL should - point to a JSON file that conforms to the - TileJSON specification. - - If a Mapbox URL is specified, this source uses a tile size of 256. For all - other tile sets, the default value is 512. (See the - `MGLTileSourceOptionTileSize` documentation for more information about tile - sizes.) If you need to use a tile size other than the default, use the - `-initWithIdentifier:configurationURL:tileSize:` method. - - @param identifier A string that uniquely identifies the source in the style to - 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. - */ -- (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL; - -/** - Returns a raster 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. - - The URL may be a full HTTP or HTTPS URL or, for tile sets hosted by Mapbox, a - Mapbox URL indicating a map identifier (`mapbox://`). The URL should - point to a JSON file that conforms to the - TileJSON specification. - - @param identifier A string that uniquely identifies the source in the style to - which it is added. - @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. - */ -- (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize NS_DESIGNATED_INITIALIZER; - -/** - Returns a raster source initialized an identifier, tile URL templates, and - options. - - Tile URL templates are strings that specify the URLs of the raster tile images - to load. See the “Tile URL Templates” - guide for information about the format of a tile URL template. - - After initializing and configuring the source, add it to a map view’s style - using the `-[MGLStyle addSource:]` method. - - @param identifier A string that uniquely identifies the source in the style to - which it is added. - @param tileURLTemplates An array of tile URL template strings. Only the first - string is used; any additional strings are ignored. - @param options A dictionary containing configuration options. See - `MGLTileSourceOption` for available keys and values. Pass in `nil` to use - the default values. - @return An initialized tile source. - */ -- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NS_ARRAY_OF(NSString *) *)tileURLTemplates options:(nullable NS_DICTIONARY_OF(MGLTileSourceOption, id) *)options NS_DESIGNATED_INITIALIZER; - -@end - -NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLRasterSource.mm b/platform/darwin/src/MGLRasterSource.mm deleted file mode 100644 index c47cc199eb..0000000000 --- a/platform/darwin/src/MGLRasterSource.mm +++ /dev/null @@ -1,77 +0,0 @@ -#import "MGLRasterSource_Private.h" - -#import "MGLMapView_Private.h" -#import "MGLSource_Private.h" -#import "MGLTileSource_Private.h" -#import "NSURL+MGLAdditions.h" - -#include -#include - -const MGLTileSourceOption MGLTileSourceOptionTileSize = @"MGLTileSourceOptionTileSize"; - -static const CGFloat MGLRasterSourceClassicTileSize = 256; -static const CGFloat MGLRasterSourceRetinaTileSize = 512; - -@interface MGLRasterSource () - -@property (nonatomic, readonly) mbgl::style::RasterSource *rawSource; - -@end - -@implementation MGLRasterSource - -- (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL { - // The style specification default is 512, but 256 is the expected value for - // any tile set that would be accessed through a mapbox: URL and therefore - // any tile URL that this option currently affects. - BOOL isMapboxURL = ([configurationURL.scheme isEqualToString:@"mapbox"] - && [configurationURL.host containsString:@"."] - && (!configurationURL.path.length || [configurationURL.path isEqualToString:@"/"])); - CGFloat tileSize = isMapboxURL ? MGLRasterSourceClassicTileSize : MGLRasterSourceRetinaTileSize; - return [self initWithIdentifier:identifier configurationURL:configurationURL tileSize:tileSize]; -} - -- (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize { - auto source = [self pendingSourceWithIdentifier:identifier configurationURL:configurationURL tileSize:tileSize]; - return self = [super initWithPendingSource:std::move(source)]; -} - -- (std::unique_ptr)pendingSourceWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize { - NSString *configurationURLString = configurationURL.mgl_URLByStandardizingScheme.absoluteString; - return std::make_unique(identifier.UTF8String, - configurationURLString.UTF8String, - uint16_t(round(tileSize))); -} - -- (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; - if (NSNumber *tileSizeNumber = options[MGLTileSourceOptionTileSize]) { - if (![tileSizeNumber isKindOfClass:[NSNumber class]]) { - [NSException raise:NSInvalidArgumentException - format:@"MGLTileSourceOptionTileSize must be set to an NSNumber."]; - } - tileSize = static_cast(round(tileSizeNumber.doubleValue)); - } - - auto source = std::make_unique(identifier.UTF8String, tileSet, tileSize); - return self = [super initWithPendingSource:std::move(source)]; -} - -- (mbgl::style::RasterSource *)rawSource { - return (mbgl::style::RasterSource *)super.rawSource; -} - -- (NSURL *)configurationURL { - auto url = self.rawSource->getURL(); - return url ? [NSURL URLWithString:@(url->c_str())] : nil; -} - -- (NSString *)attributionHTMLString { - auto attribution = self.rawSource->getAttribution(); - return attribution ? @(attribution->c_str()) : nil; -} - -@end diff --git a/platform/darwin/src/MGLRasterSource_Private.h b/platform/darwin/src/MGLRasterSource_Private.h deleted file mode 100644 index 6f40fbc5a9..0000000000 --- a/platform/darwin/src/MGLRasterSource_Private.h +++ /dev/null @@ -1,21 +0,0 @@ -#import "MGLRasterSource.h" - -#include - -namespace mbgl { - namespace style { - class RasterSource; - } -} - -NS_ASSUME_NONNULL_BEGIN - -@interface MGLRasterSource (Private) - -@property (nonatomic, readonly) mbgl::style::RasterSource *rawSource; - -- (std::unique_ptr)pendingSourceWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize; - -@end - -NS_ASSUME_NONNULL_END 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 Mapbox Satellite imagery, a + +#import "MGLFoundation.h" +#import "MGLTileSource.h" + +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 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 + Mapbox Maps API + 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 `MGLRasterTileSource` objects; it is ignored when + initializing `MGLVectorSource` objects. + */ +extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionTileSize; + +/** + `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 + TileJSON specification. + 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 tile source. + + Each + raster + source defined by the style JSON file is represented at runtime by an + `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 = MGLRasterTileSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ + .minimumZoomLevel: 9, + .maximumZoomLevel: 16, + .tileSize: 512, + .attributionInfos: [ + MGLAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string: "http://mapbox.com")) + ] + ]) + mapView.style?.addSource(source) + ``` + */ +MGL_EXPORT +@interface MGLRasterTileSource : MGLTileSource + +#pragma mark Initializing a Source + +/** + 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. + + The URL may be a full HTTP or HTTPS URL or, for tile sets hosted by Mapbox, a + Mapbox URL indicating a map identifier (`mapbox://`). The URL should + point to a JSON file that conforms to the + TileJSON specification. + + If a Mapbox URL is specified, this source uses a tile size of 256. For all + other tile sets, the default value is 512. (See the + `MGLTileSourceOptionTileSize` documentation for more information about tile + sizes.) If you need to use a tile size other than the default, use the + `-initWithIdentifier:configurationURL:tileSize:` method. + + @param identifier A string that uniquely identifies the source in the style to + 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 tile source. + */ +- (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL; + +/** + 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. + + The URL may be a full HTTP or HTTPS URL or, for tile sets hosted by Mapbox, a + Mapbox URL indicating a map identifier (`mapbox://`). The URL should + point to a JSON file that conforms to the + TileJSON specification. + + @param identifier A string that uniquely identifies the source in the style to + which it is added. + @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 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 tile source initialized an identifier, tile URL templates, and + options. + + Tile URL templates are strings that specify the URLs of the raster tile images + to load. See the “Tile URL Templates” + guide for information about the format of a tile URL template. + + After initializing and configuring the source, add it to a map view’s style + using the `-[MGLStyle addSource:]` method. + + @param identifier A string that uniquely identifies the source in the style to + which it is added. + @param tileURLTemplates An array of tile URL template strings. Only the first + string is used; any additional strings are ignored. + @param options A dictionary containing configuration options. See + `MGLTileSourceOption` for available keys and values. Pass in `nil` to use + the default values. + @return An initialized tile source. + */ +- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NS_ARRAY_OF(NSString *) *)tileURLTemplates options:(nullable NS_DICTIONARY_OF(MGLTileSourceOption, id) *)options NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLRasterTileSource.mm b/platform/darwin/src/MGLRasterTileSource.mm new file mode 100644 index 0000000000..02cfef4ae8 --- /dev/null +++ b/platform/darwin/src/MGLRasterTileSource.mm @@ -0,0 +1,77 @@ +#import "MGLRasterTileSource_Private.h" + +#import "MGLMapView_Private.h" +#import "MGLSource_Private.h" +#import "MGLTileSource_Private.h" +#import "NSURL+MGLAdditions.h" + +#include +#include + +const MGLTileSourceOption MGLTileSourceOptionTileSize = @"MGLTileSourceOptionTileSize"; + +static const CGFloat MGLRasterTileSourceClassicTileSize = 256; +static const CGFloat MGLRasterTileSourceRetinaTileSize = 512; + +@interface MGLRasterTileSource () + +@property (nonatomic, readonly) mbgl::style::RasterSource *rawSource; + +@end + +@implementation MGLRasterTileSource + +- (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL { + // The style specification default is 512, but 256 is the expected value for + // any tile set that would be accessed through a mapbox: URL and therefore + // any tile URL that this option currently affects. + BOOL isMapboxURL = ([configurationURL.scheme isEqualToString:@"mapbox"] + && [configurationURL.host containsString:@"."] + && (!configurationURL.path.length || [configurationURL.path isEqualToString:@"/"])); + CGFloat tileSize = isMapboxURL ? MGLRasterTileSourceClassicTileSize : MGLRasterTileSourceRetinaTileSize; + return [self initWithIdentifier:identifier configurationURL:configurationURL tileSize:tileSize]; +} + +- (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize { + auto source = [self pendingSourceWithIdentifier:identifier configurationURL:configurationURL tileSize:tileSize]; + return self = [super initWithPendingSource:std::move(source)]; +} + +- (std::unique_ptr)pendingSourceWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize { + NSString *configurationURLString = configurationURL.mgl_URLByStandardizingScheme.absoluteString; + return std::make_unique(identifier.UTF8String, + configurationURLString.UTF8String, + uint16_t(round(tileSize))); +} + +- (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 = MGLRasterTileSourceRetinaTileSize; + if (NSNumber *tileSizeNumber = options[MGLTileSourceOptionTileSize]) { + if (![tileSizeNumber isKindOfClass:[NSNumber class]]) { + [NSException raise:NSInvalidArgumentException + format:@"MGLTileSourceOptionTileSize must be set to an NSNumber."]; + } + tileSize = static_cast(round(tileSizeNumber.doubleValue)); + } + + auto source = std::make_unique(identifier.UTF8String, tileSet, tileSize); + return self = [super initWithPendingSource:std::move(source)]; +} + +- (mbgl::style::RasterSource *)rawSource { + return (mbgl::style::RasterSource *)super.rawSource; +} + +- (NSURL *)configurationURL { + auto url = self.rawSource->getURL(); + return url ? [NSURL URLWithString:@(url->c_str())] : nil; +} + +- (NSString *)attributionHTMLString { + auto attribution = self.rawSource->getAttribution(); + return attribution ? @(attribution->c_str()) : nil; +} + +@end diff --git a/platform/darwin/src/MGLRasterTileSource_Private.h b/platform/darwin/src/MGLRasterTileSource_Private.h new file mode 100644 index 0000000000..128dcb447d --- /dev/null +++ b/platform/darwin/src/MGLRasterTileSource_Private.h @@ -0,0 +1,21 @@ +#import "MGLRasterTileSource.h" + +#include + +namespace mbgl { + namespace style { + class RasterSource; + } +} + +NS_ASSUME_NONNULL_BEGIN + +@interface MGLRasterTileSource (Private) + +@property (nonatomic, readonly) mbgl::style::RasterSource *rawSource; + +- (std::unique_ptr)pendingSourceWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize; + +@end + +NS_ASSUME_NONNULL_END 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()) { return [[MGLShapeSource alloc] initWithRawSource:geoJSONSource mapView:self.mapView]; } else if (auto rasterSource = rawSource->as()) { - return [[MGLRasterSource alloc] initWithRawSource:rasterSource mapView:self.mapView]; + return [[MGLRasterTileSource alloc] initWithRawSource:rasterSource mapView:self.mapView]; } else if (auto rasterDEMSource = rawSource->as()) { return [[MGLRasterDEMSource alloc] initWithRawSource:rasterDEMSource mapView:self.mapView]; } else if (auto imageSource = rawSource->as()) { 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 Mapbox Studio’s Tilesets editor. - 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. */ diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift index 5a112f07e2..08650e8647 100644 --- a/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/darwin/test/MGLDocumentationExampleTests.swift @@ -73,9 +73,9 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.source(withIdentifier: "lines")) } - func testMGLRasterSource() { + func testMGLRasterTileSource() { //#-example-code - 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, @@ -275,7 +275,7 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { } func testMGLRasterStyleLayer() { - 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, diff --git a/platform/darwin/test/MGLStyleTests.mm b/platform/darwin/test/MGLStyleTests.mm index 95051cfae0..b9fbe1cfd4 100644 --- a/platform/darwin/test/MGLStyleTests.mm +++ b/platform/darwin/test/MGLStyleTests.mm @@ -157,9 +157,9 @@ [self.style addSource:shapeSource]; XCTAssertThrowsSpecificNamed([self.style addSource:shapeSource], NSException, @"MGLRedundantSourceException"); - MGLRasterSource *rasterSource = [[MGLRasterSource alloc] initWithIdentifier:@"rasterSource" configurationURL:[NSURL URLWithString:@".json"] tileSize:42]; - [self.style addSource:rasterSource]; - XCTAssertThrowsSpecificNamed([self.style addSource:rasterSource], NSException, @"MGLRedundantSourceException"); + MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"rasterTileSource" configurationURL:[NSURL URLWithString:@".json"] tileSize:42]; + [self.style addSource:rasterTileSource]; + XCTAssertThrowsSpecificNamed([self.style addSource:rasterTileSource], NSException, @"MGLRedundantSourceException"); MGLVectorSource *vectorSource = [[MGLVectorSource alloc] initWithIdentifier:@"vectorSource" configurationURL:[NSURL URLWithString:@".json"]]; [self.style addSource:vectorSource]; @@ -175,10 +175,10 @@ } - (void)testRemovingSourcesBeforeAddingThem { - MGLRasterSource *rasterSource = [[MGLRasterSource alloc] initWithIdentifier:@"raster-source" tileURLTemplates:@[] options:nil]; - [self.style removeSource:rasterSource]; - [self.style addSource:rasterSource]; - XCTAssertNotNil([self.style sourceWithIdentifier:rasterSource.identifier]); + MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"raster-tile-source" tileURLTemplates:@[] options:nil]; + [self.style removeSource:rasterTileSource]; + [self.style addSource:rasterTileSource]; + XCTAssertNotNil([self.style sourceWithIdentifier:rasterTileSource.identifier]); MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shape-source" shape:nil options:nil]; [self.style removeSource:shapeSource]; @@ -192,18 +192,18 @@ } - (void)testAddingSourceOfTypeABeforeSourceOfTypeBWithSameIdentifier { - // Add a raster source - MGLRasterSource *rasterSource = [[MGLRasterSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; - [self.style addSource:rasterSource]; + // Add a raster tile source + MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; + [self.style addSource:rasterTileSource]; - // Attempt to remove an image source with the same identifier as the raster source + // Attempt to remove an image source with the same identifier as the raster tile source MGLImageSource *imageSource = [[MGLImageSource alloc] initWithIdentifier:@"some-identifier" coordinateQuad: { } URL:[NSURL URLWithString:@"http://host/image.png"]]; [self.style removeSource:imageSource]; - // The raster source should still be added - XCTAssertTrue([[self.style sourceWithIdentifier:rasterSource.identifier] isMemberOfClass:[MGLRasterSource class]]); + // The raster tile source should still be added + XCTAssertTrue([[self.style sourceWithIdentifier:rasterTileSource.identifier] isMemberOfClass:[MGLRasterTileSource class]]); - // Remove the raster source - [self.style removeSource:rasterSource]; + // Remove the raster tile source + [self.style removeSource:rasterTileSource]; // Add the shape source [self.style addSource:imageSource]; @@ -220,26 +220,26 @@ // Add the vector source [self.style addSource:vectorSource]; - // Attempt to remove the previously created raster source that has the same identifer as the shape source - [self.style removeSource:rasterSource]; + // Attempt to remove the previously created raster tile source that has the same identifer as the shape source + [self.style removeSource:rasterTileSource]; // The vector source should still be added XCTAssertTrue([[self.style sourceWithIdentifier:imageSource.identifier] isMemberOfClass:[MGLVectorSource class]]); } - (void)testRemovingSourceInUse { - // Add a raster source - MGLRasterSource *rasterSource = [[MGLRasterSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; - [self.style addSource:rasterSource]; + // Add a raster tile source + MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; + [self.style addSource:rasterTileSource]; // Add a layer using it - MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:rasterSource]; + MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:rasterTileSource]; [self.style addLayer:fillLayer]; - // Attempt to remove the raster source - [self.style removeSource:rasterSource]; + // Attempt to remove the raster tile source + [self.style removeSource:rasterTileSource]; // Ensure it is still there - XCTAssertTrue([[self.style sourceWithIdentifier:rasterSource.identifier] isMemberOfClass:[MGLRasterSource class]]); + XCTAssertTrue([[self.style sourceWithIdentifier:rasterTileSource.identifier] isMemberOfClass:[MGLRasterTileSource class]]); } - (void)testLayers { diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e281425905..6fda59d4c6 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -14,6 +14,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Added support for a new layer type: `MGLHeatmapStyleLayer`, a powerful way to visualize point data distributions using heatmaps, fully customizable through runtime styling. [#11046](https://github.com/mapbox/mapbox-gl-native/pull/11046) * The layout and paint properties on subclasses of `MGLStyleLayer` are now of type `NSExpression` instead of `MGLStyleValue`. A new “Predicates and Expressions” guide provides an overview of the supported operators. ([#10726](https://github.com/mapbox/mapbox-gl-native/pull/10726)) +* Renamed `MGLRasterSource` to `MGLRasterTileSource`. ([#11568](https://github.com/mapbox/mapbox-gl-native/pull/11568)) * Added an `MGLComputedShapeSource` class that allows applications to supply vector data to a style layer on a per-tile basis. ([#9983](https://github.com/mapbox/mapbox-gl-native/pull/9983)) * A style can now display smooth hillshading and customize its appearance at runtime using the `MGLHillshadeStyleLayer` class. Hillshading is based on a rasterized digital elevation model supplied by the `MGLRasterDEMSource` class. ([#10642](https://github.com/mapbox/mapbox-gl-native/pull/10642)) * The `MGLSymbolStyleLayer.textFontNames` property can now depend on a feature’s attributes. ([#10850](https://github.com/mapbox/mapbox-gl-native/pull/10850)) diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 2a6708a69f..17b807459a 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -79,7 +79,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsRuntimeStylingRows) { MBXSettingsRuntimeStylingUpdateShapeSourceURL, MBXSettingsRuntimeStylingUpdateShapeSourceFeatures, MBXSettingsRuntimeStylingVectorSource, - MBXSettingsRuntimeStylingRasterSource, + MBXSettingsRuntimeStylingRasterTileSource, MBXSettingsRuntimeStylingImageSource, MBXSettingsRuntimeStylingRouteLine, MBXSettingsRuntimeStylingDDSPolygon, @@ -369,7 +369,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @"Update Shape Source: URL", @"Update Shape Source: Features", @"Style Vector Source", - @"Style Raster Source", + @"Style Raster Tile Source", @"Style Image Source", @"Add Route Line", @"Dynamically Style Polygon", @@ -551,8 +551,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { case MBXSettingsRuntimeStylingVectorSource: [self styleVectorSource]; break; - case MBXSettingsRuntimeStylingRasterSource: - [self styleRasterSource]; + case MBXSettingsRuntimeStylingRasterTileSource: + [self styleRasterTileSource]; break; case MBXSettingsRuntimeStylingImageSource: [self styleImageSource]; @@ -1011,10 +1011,10 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { - (void)styleRasterLayer { NSURL *rasterURL = [NSURL URLWithString:@"mapbox://mapbox.satellite"]; - MGLRasterSource *rasterSource = [[MGLRasterSource alloc] initWithIdentifier:@"my-raster-source" configurationURL:rasterURL tileSize:512]; - [self.mapView.style addSource:rasterSource]; + MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"my-raster-tile-source" configurationURL:rasterURL tileSize:512]; + [self.mapView.style addSource:rasterTileSource]; - MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"my-raster-layer" source:rasterSource]; + MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"my-raster-layer" source:rasterTileSource]; NSDictionary *opacityStops = @{@20.0f: @1.0f, @5.0f: @0.0f}; rasterLayer.rasterOpacity = [NSExpression expressionWithFormat: @@ -1353,15 +1353,15 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { [self.mapView.style addLayer:lineLayer]; } -- (void)styleRasterSource +- (void)styleRasterTileSource { NSString *tileURL = [NSString stringWithFormat:@"https://stamen-tiles.a.ssl.fastly.net/terrain-background/{z}/{x}/{y}%@.jpg", UIScreen.mainScreen.nativeScale > 1 ? @"@2x" : @""]; - MGLRasterSource *rasterSource = [[MGLRasterSource alloc] initWithIdentifier:@"style-raster-source-id" tileURLTemplates:@[tileURL] options:@{ + MGLRasterTileSource *rasterTileSource = [[MGLRasterTileSource alloc] initWithIdentifier:@"style-raster-tile-source-id" tileURLTemplates:@[tileURL] options:@{ MGLTileSourceOptionTileSize: @256, }]; - [self.mapView.style addSource:rasterSource]; + [self.mapView.style addSource:rasterTileSource]; - MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"style-raster-layer-id" source:rasterSource]; + MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"style-raster-layer-id" source:rasterTileSource]; [self.mapView.style addLayer:rasterLayer]; } diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md index 7462112626..b6c82ddcf4 100644 --- a/platform/ios/docs/guides/For Style Authors.md +++ b/platform/ios/docs/guides/For Style Authors.md @@ -127,17 +127,18 @@ source object is a member of one of the following subclasses of `MGLSource`: In style JSON | In the SDK --------------|----------- -`geojson` | `MGLShapeSource` -`raster` | `MGLRasterSource` `vector` | `MGLVectorSource` +`raster` | `MGLRasterTileSource` +`raster-dem` | `MGLRasterDEMSource` +`geojson` | `MGLShapeSource` `image` | `MGLImageSource` `canvas` and `video` sources are not supported. ### Tile sources -Raster and vector sources may be defined in TileJSON configuration files. This -SDK supports the properties defined in the style specification, which are a +Raster and vector tile sources may be defined in TileJSON configuration files. +This SDK supports the properties defined in the style specification, which are a subset of the keys defined in version 2.1.0 of the [TileJSON](https://github.com/mapbox/tilejson-spec/tree/master/2.1.0) specification. As an alternative to authoring a custom TileJSON file, you may diff --git a/platform/ios/docs/guides/Tile URL Templates.md b/platform/ios/docs/guides/Tile URL Templates.md index f61d2ea33a..0030e9b48e 100644 --- a/platform/ios/docs/guides/Tile URL Templates.md +++ b/platform/ios/docs/guides/Tile URL Templates.md @@ -4,12 +4,12 @@ --> # Tile URL Templates -`MGLTileSource` objects, specifically `MGLRasterSource` and `MGLVectorSource` -objects, can be created using an initializer that accepts an array of tile URL -templates. Tile URL templates are strings that specify the URLs of the vector -tiles or raster tile images to load. A template resembles an absolute URL, but -with any number of placeholder strings that the source evaluates based on the -tile it needs to load. For example: +`MGLTileSource` objects, specifically `MGLRasterTileSource` and +`MGLVectorSource` objects, can be created using an initializer that accepts an +array of tile URL templates. Tile URL templates are strings that specify the +URLs of the vector tiles or raster tile images to load. A template resembles an +absolute URL, but with any number of placeholder strings that the source +evaluates based on the tile it needs to load. For example: * `http://www.example.com/tiles/{z}/{x}/{y}.pbf` could be evaluated as `http://www.example.com/tiles/14/6/9.pbf`. @@ -56,7 +56,7 @@ all of which are optional: The tile’s zoom level. At zoom level 0, each tile covers the entire world map; at zoom level 1, it covers ¼ of the world; at zoom level 2, 116 of the world, and so on. For tiles loaded by - a MGLRasterSource object, whether the tile zoom level + a MGLRasterTileSource object, whether the tile zoom level matches the map’s current zoom level depends on the value of the source’s tile size as specified in the MGLTileSourceOptionTileSize key of the options diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 971258efd5..dea25c7e0e 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -116,10 +116,10 @@ 3566C7671D4A77BA008152BC /* MGLShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C7641D4A77BA008152BC /* MGLShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3566C7681D4A77BA008152BC /* MGLShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3566C7651D4A77BA008152BC /* MGLShapeSource.mm */; }; 3566C7691D4A77BA008152BC /* MGLShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3566C7651D4A77BA008152BC /* MGLShapeSource.mm */; }; - 3566C76C1D4A8DFA008152BC /* MGLRasterSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C76A1D4A8DFA008152BC /* MGLRasterSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3566C76D1D4A8DFA008152BC /* MGLRasterSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C76A1D4A8DFA008152BC /* MGLRasterSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3566C76E1D4A8DFA008152BC /* MGLRasterSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3566C76B1D4A8DFA008152BC /* MGLRasterSource.mm */; }; - 3566C76F1D4A8DFA008152BC /* MGLRasterSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3566C76B1D4A8DFA008152BC /* MGLRasterSource.mm */; }; + 3566C76C1D4A8DFA008152BC /* MGLRasterTileSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C76A1D4A8DFA008152BC /* MGLRasterTileSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3566C76D1D4A8DFA008152BC /* MGLRasterTileSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C76A1D4A8DFA008152BC /* MGLRasterTileSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3566C76E1D4A8DFA008152BC /* MGLRasterTileSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3566C76B1D4A8DFA008152BC /* MGLRasterTileSource.mm */; }; + 3566C76F1D4A8DFA008152BC /* MGLRasterTileSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3566C76B1D4A8DFA008152BC /* MGLRasterTileSource.mm */; }; 3566C7711D4A9198008152BC /* MGLSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C7701D4A9198008152BC /* MGLSource_Private.h */; }; 3566C7721D4A9198008152BC /* MGLSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C7701D4A9198008152BC /* MGLSource_Private.h */; }; 357579801D501E09000B822E /* MGLFillStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3575797F1D501E09000B822E /* MGLFillStyleLayerTests.mm */; }; @@ -596,8 +596,8 @@ DAED38651D62D0FC00D7640F /* NSURL+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DAED38621D62D0FC00D7640F /* NSURL+MGLAdditions.m */; }; DAED38661D62D0FC00D7640F /* NSURL+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DAED38621D62D0FC00D7640F /* NSURL+MGLAdditions.m */; }; DAEDC4341D603417000224FF /* MGLAttributionInfoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DAEDC4331D603417000224FF /* MGLAttributionInfoTests.m */; }; - DAF0D8101DFE0EA000B28378 /* MGLRasterSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D80F1DFE0EA000B28378 /* MGLRasterSource_Private.h */; }; - DAF0D8111DFE0EA000B28378 /* MGLRasterSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D80F1DFE0EA000B28378 /* MGLRasterSource_Private.h */; }; + DAF0D8101DFE0EA000B28378 /* MGLRasterTileSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D80F1DFE0EA000B28378 /* MGLRasterTileSource_Private.h */; }; + DAF0D8111DFE0EA000B28378 /* MGLRasterTileSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D80F1DFE0EA000B28378 /* MGLRasterTileSource_Private.h */; }; DAF0D8131DFE0EC500B28378 /* MGLVectorSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D8121DFE0EC500B28378 /* MGLVectorSource_Private.h */; }; DAF0D8141DFE0EC500B28378 /* MGLVectorSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D8121DFE0EC500B28378 /* MGLVectorSource_Private.h */; }; DAF0D8181DFE6B2800B28378 /* MGLAttributionInfo_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF0D8171DFE6B2800B28378 /* MGLAttributionInfo_Private.h */; }; @@ -797,8 +797,8 @@ 355ADFFC1E9281DA00F3939D /* MGLScaleBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLScaleBar.mm; sourceTree = ""; }; 3566C7641D4A77BA008152BC /* MGLShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeSource.h; sourceTree = ""; }; 3566C7651D4A77BA008152BC /* MGLShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLShapeSource.mm; sourceTree = ""; }; - 3566C76A1D4A8DFA008152BC /* MGLRasterSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterSource.h; sourceTree = ""; }; - 3566C76B1D4A8DFA008152BC /* MGLRasterSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterSource.mm; sourceTree = ""; }; + 3566C76A1D4A8DFA008152BC /* MGLRasterTileSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterTileSource.h; sourceTree = ""; }; + 3566C76B1D4A8DFA008152BC /* MGLRasterTileSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterTileSource.mm; sourceTree = ""; }; 3566C7701D4A9198008152BC /* MGLSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSource_Private.h; sourceTree = ""; }; 3575797F1D501E09000B822E /* MGLFillStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLFillStyleLayerTests.mm; path = ../../darwin/test/MGLFillStyleLayerTests.mm; sourceTree = ""; }; 357579821D502AE6000B822E /* MGLRasterStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLRasterStyleLayerTests.mm; path = ../../darwin/test/MGLRasterStyleLayerTests.mm; sourceTree = ""; }; @@ -1238,7 +1238,7 @@ DAED38611D62D0FC00D7640F /* NSURL+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+MGLAdditions.h"; sourceTree = ""; }; DAED38621D62D0FC00D7640F /* NSURL+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+MGLAdditions.m"; sourceTree = ""; }; DAEDC4331D603417000224FF /* MGLAttributionInfoTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLAttributionInfoTests.m; path = ../../darwin/test/MGLAttributionInfoTests.m; sourceTree = ""; }; - DAF0D80F1DFE0EA000B28378 /* MGLRasterSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterSource_Private.h; sourceTree = ""; }; + DAF0D80F1DFE0EA000B28378 /* MGLRasterTileSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterTileSource_Private.h; sourceTree = ""; }; DAF0D8121DFE0EC500B28378 /* MGLVectorSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorSource_Private.h; sourceTree = ""; }; DAF0D8171DFE6B2800B28378 /* MGLAttributionInfo_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributionInfo_Private.h; sourceTree = ""; }; DAF25717201901E100367EF5 /* MGLHillshadeStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLHillshadeStyleLayer.mm; sourceTree = ""; }; @@ -1359,9 +1359,9 @@ 0778DD411F67555F00A73B34 /* MGLComputedShapeSource.mm */, 071BBAFC1EE75CD4001FB02A /* MGLImageSource.h */, 071BBAFD1EE75CD4001FB02A /* MGLImageSource.mm */, - 3566C76A1D4A8DFA008152BC /* MGLRasterSource.h */, - DAF0D80F1DFE0EA000B28378 /* MGLRasterSource_Private.h */, - 3566C76B1D4A8DFA008152BC /* MGLRasterSource.mm */, + 3566C76A1D4A8DFA008152BC /* MGLRasterTileSource.h */, + DAF0D80F1DFE0EA000B28378 /* MGLRasterTileSource_Private.h */, + 3566C76B1D4A8DFA008152BC /* MGLRasterTileSource.mm */, DACA86242019218500E9693A /* MGLRasterDEMSource.h */, DACA86252019218500E9693A /* MGLRasterDEMSource.mm */, 3566C7641D4A77BA008152BC /* MGLShapeSource.h */, @@ -2241,7 +2241,7 @@ DA8847F11CBAFA5100AB86E3 /* MGLGeometry.h in Headers */, DA8848221CBAFA6200AB86E3 /* MGLOfflineRegion_Private.h in Headers */, 35136D4C1D4277FC00C20EFD /* MGLSource.h in Headers */, - 3566C76C1D4A8DFA008152BC /* MGLRasterSource.h in Headers */, + 3566C76C1D4A8DFA008152BC /* MGLRasterTileSource.h in Headers */, DA8847F91CBAFA5100AB86E3 /* MGLPolygon.h in Headers */, 4049C2AC1DB6E05500B3F799 /* MGLPointCollection_Private.h in Headers */, DA8847F81CBAFA5100AB86E3 /* MGLPointAnnotation.h in Headers */, @@ -2278,7 +2278,7 @@ DA88482F1CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h in Headers */, DA9EA82B201C0C0C00F9874D /* NSExpression+MGLAdditions.h in Headers */, DA8848601CBAFC2E00AB86E3 /* Mapbox.h in Headers */, - DAF0D8101DFE0EA000B28378 /* MGLRasterSource_Private.h in Headers */, + DAF0D8101DFE0EA000B28378 /* MGLRasterTileSource_Private.h in Headers */, 350098BB1D480108004B2AF0 /* MGLVectorSource.h in Headers */, DA8847F61CBAFA5100AB86E3 /* MGLOfflineStorage.h in Headers */, DAD1656E1CF41981001FF4B9 /* MGLFeature_Private.h in Headers */, @@ -2300,7 +2300,7 @@ FA68F14B1E9D656600F9F6C2 /* MGLFillExtrusionStyleLayer.h in Headers */, 96E516DE200054F700A02306 /* MGLGeometry_Private.h in Headers */, 353933FC1D3FB7C0003F57D7 /* MGLRasterStyleLayer.h in Headers */, - 3566C76D1D4A8DFA008152BC /* MGLRasterSource.h in Headers */, + 3566C76D1D4A8DFA008152BC /* MGLRasterTileSource.h in Headers */, DAED38641D62D0FC00D7640F /* NSURL+MGLAdditions.h in Headers */, DABFB85E1CBE99E500D62B32 /* MGLAnnotation.h in Headers */, DABFB8641CBE99E500D62B32 /* MGLOfflineStorage.h in Headers */, @@ -2390,7 +2390,7 @@ 1753ED431E53CE6F00A9FD90 /* MGLConversion.h in Headers */, DAC25FCD200FD83F009BE98E /* NSExpression+MGLPrivateAdditions.h in Headers */, 354B83971D2E873E005D9406 /* MGLUserLocationAnnotationView.h in Headers */, - DAF0D8111DFE0EA000B28378 /* MGLRasterSource_Private.h in Headers */, + DAF0D8111DFE0EA000B28378 /* MGLRasterTileSource_Private.h in Headers */, 96E516FF20005A4F00A02306 /* MGLMapboxEvents.h in Headers */, DABFB86B1CBE99E500D62B32 /* MGLTilePyramidOfflineRegion.h in Headers */, 968F36B51E4D128D003A5522 /* MGLDistanceFormatter.h in Headers */, @@ -2910,7 +2910,7 @@ DA88485B1CBAFB9800AB86E3 /* MGLUserLocation.m in Sources */, 927FBD011F4DB05500F8BF1F /* MGLMapSnapshotter.mm in Sources */, 350098BD1D480108004B2AF0 /* MGLVectorSource.mm in Sources */, - 3566C76E1D4A8DFA008152BC /* MGLRasterSource.mm in Sources */, + 3566C76E1D4A8DFA008152BC /* MGLRasterTileSource.mm in Sources */, DA88488C1CBB037E00AB86E3 /* SMCalloutView.m in Sources */, 35136D4E1D4277FC00C20EFD /* MGLSource.mm in Sources */, 1F06668D1EC64F8E001C16D7 /* MGLLight.mm in Sources */, @@ -3034,7 +3034,7 @@ 40834BFC1FE05E1800C1BD0D /* MMECategoryLoader.m in Sources */, 927FBD021F4DB05500F8BF1F /* MGLMapSnapshotter.mm in Sources */, 350098BE1D480108004B2AF0 /* MGLVectorSource.mm in Sources */, - 3566C76F1D4A8DFA008152BC /* MGLRasterSource.mm in Sources */, + 3566C76F1D4A8DFA008152BC /* MGLRasterTileSource.mm in Sources */, DAA4E4351CBB730400178DFB /* SMCalloutView.m in Sources */, 35136D4F1D4277FC00C20EFD /* MGLSource.mm in Sources */, DA35A2B91CCA9A5D00E826B2 /* MGLClockDirectionFormatter.m in Sources */, diff --git a/platform/ios/jazzy.yml b/platform/ios/jazzy.yml index 61e9ad39e8..c0c2c2151a 100644 --- a/platform/ios/jazzy.yml +++ b/platform/ios/jazzy.yml @@ -77,14 +77,14 @@ custom_categories: - name: Style Content children: - MGLSource - - MGLTileSource - - MGLImageSource - MGLAbstractShapeSource - MGLShapeSource - MGLComputedShapeSource - - MGLRasterSource + - MGLTileSource + - MGLRasterTileSource - MGLRasterDEMSource - MGLVectorSource + - MGLImageSource - name: Style Layers children: - MGLStyleLayer diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 2d566f26a0..e315f343db 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -1330,8 +1330,8 @@ MGL_EXPORT IB_DESIGNABLE current style and provides access to attributes specified by the relevant map content sources. The returned array includes features loaded by `MGLShapeSource` and `MGLVectorSource` objects but does not include anything - from `MGLRasterSource` objects, or from image, video, or canvas sources, which - are unsupported by this SDK. + from `MGLRasterTileSource` objects, or from video or canvas sources, which are + unsupported by this SDK. The returned features are drawn by a style layer in the current style. For example, suppose the current style uses the @@ -1432,8 +1432,8 @@ MGL_EXPORT IB_DESIGNABLE current style and provides access to attributes specified by the relevant map content sources. The returned array includes features loaded by `MGLShapeSource` and `MGLVectorSource` objects but does not include anything - from `MGLRasterSource` objects, or from image, video, or canvas sources, which - are unsupported by this SDK. + from `MGLRasterTileSource` objects, or from video or canvas sources, which are + unsupported by this SDK. The returned features are drawn by a style layer in the current style. For example, suppose the current style uses the diff --git a/platform/ios/src/Mapbox.h b/platform/ios/src/Mapbox.h index 11720ac68e..9786d55391 100644 --- a/platform/ios/src/Mapbox.h +++ b/platform/ios/src/Mapbox.h @@ -55,7 +55,7 @@ FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[]; #import "MGLShapeSource.h" #import "MGLAbstractShapeSource.h" #import "MGLComputedShapeSource.h" -#import "MGLRasterSource.h" +#import "MGLRasterTileSource.h" #import "MGLRasterDEMSource.h" #import "MGLImageSource.h" #import "MGLTilePyramidOfflineRegion.h" diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index fd22589473..c95da49a07 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -6,6 +6,7 @@ * Added support for a new layer type: `MGLHeatmapStyleLayer`, a powerful way to visualize point data distributions using heatmaps, fully customizable through runtime styling. [#11046](https://github.com/mapbox/mapbox-gl-native/pull/11046) * The layout and paint properties on subclasses of `MGLStyleLayer` are now of type `NSExpression` instead of `MGLStyleValue`. A new “Predicates and Expressions” guide provides an overview of the supported operators. ([#10726](https://github.com/mapbox/mapbox-gl-native/pull/10726)) +* Renamed `MGLRasterSource` to `MGLRasterTileSource`. ([#11568](https://github.com/mapbox/mapbox-gl-native/pull/11568)) * Added an `MGLComputedShapeSource` class that allows applications to supply vector data to a style layer on a per-tile basis. ([#9983](https://github.com/mapbox/mapbox-gl-native/pull/9983)) * A style can now display smooth hillshading and customize its appearance at runtime using the `MGLHillshadeStyleLayer` class. Hillshading is based on a rasterized digital elevation model supplied by the `MGLRasterDEMSource` class. ([#10642](https://github.com/mapbox/mapbox-gl-native/pull/10642)) * Fixed incorrect color calibration on macOS 10.13 High Sierra when using color-related methods of `MGLStyleLayer` subclasses, as well as when displaying an `MGLAttributionInfo`. It is no longer necessary to explicitly convert an `NSColor` to the sRGB color space before using these classes on High Sierra. ([#11391](https://github.com/mapbox/mapbox-gl-native/pull/11391)) diff --git a/platform/macos/docs/guides/For Style Authors.md b/platform/macos/docs/guides/For Style Authors.md index d99d255273..e3a1621086 100644 --- a/platform/macos/docs/guides/For Style Authors.md +++ b/platform/macos/docs/guides/For Style Authors.md @@ -114,17 +114,18 @@ source object is a member of one of the following subclasses of `MGLSource`: In style JSON | In the SDK --------------|----------- -`geojson` | `MGLShapeSource` -`raster` | `MGLRasterSource` `vector` | `MGLVectorSource` +`raster` | `MGLRasterTileSource` +`raster-dem` | `MGLRasterDEMSource` +`geojson` | `MGLShapeSource` `image` | `MGLImageSource` `canvas` and `video` sources are not supported. ### Tile sources -Raster and vector sources may be defined in TileJSON configuration files. This -SDK supports the properties defined in the style specification, which are a +Raster and vector tile sources may be defined in TileJSON configuration files. +This SDK supports the properties defined in the style specification, which are a subset of the keys defined in version 2.1.0 of the [TileJSON](https://github.com/mapbox/tilejson-spec/tree/master/2.1.0) specification. As an alternative to authoring a custom TileJSON file, you may diff --git a/platform/macos/docs/guides/Tile URL Templates.md b/platform/macos/docs/guides/Tile URL Templates.md index 01672c6686..b2c980a3fa 100644 --- a/platform/macos/docs/guides/Tile URL Templates.md +++ b/platform/macos/docs/guides/Tile URL Templates.md @@ -4,12 +4,12 @@ --> # Tile URL Templates -`MGLTileSource` objects, specifically `MGLRasterSource` and `MGLVectorSource` -objects, can be created using an initializer that accepts an array of tile URL -templates. Tile URL templates are strings that specify the URLs of the vector -tiles or raster tile images to load. A template resembles an absolute URL, but -with any number of placeholder strings that the source evaluates based on the -tile it needs to load. For example: +`MGLTileSource` objects, specifically `MGLRasterTileSource` and +`MGLVectorSource` objects, can be created using an initializer that accepts an +array of tile URL templates. Tile URL templates are strings that specify the +URLs of the vector tiles or raster tile images to load. A template resembles an +absolute URL, but with any number of placeholder strings that the source +evaluates based on the tile it needs to load. For example: * `http://www.example.com/tiles/{z}/{x}/{y}.pbf` could be evaluated as `http://www.example.com/tiles/14/6/9.pbf`. @@ -56,7 +56,7 @@ all of which are optional: The tile’s zoom level. At zoom level 0, each tile covers the entire world map; at zoom level 1, it covers ¼ of the world; at zoom level 2, 116 of the world, and so on. For tiles loaded by - a MGLRasterSource object, whether the tile zoom level + a MGLRasterTileSource object, whether the tile zoom level matches the map’s current zoom level depends on the value of the source’s tile size as specified in the MGLTileSourceOptionTileSize key of the options diff --git a/platform/macos/jazzy.yml b/platform/macos/jazzy.yml index b4dccb620f..1a8ff351e2 100644 --- a/platform/macos/jazzy.yml +++ b/platform/macos/jazzy.yml @@ -63,13 +63,14 @@ custom_categories: - name: Content Sources children: - MGLSource - - MGLTileSource - MGLAbstractShapeSource - MGLShapeSource - MGLComputedShapeSource - - MGLRasterSource + - MGLTileSource + - MGLRasterTileSource - MGLRasterDEMSource - MGLVectorSource + - MGLImageSource - name: Style Layers children: - MGLStyleLayer diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index 2ae0ea3bc0..7f97f9b0da 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -32,8 +32,8 @@ 352742781D4C220900A1ECE6 /* MGLStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742771D4C220900A1ECE6 /* MGLStyleValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; 352742811D4C243B00A1ECE6 /* MGLSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527427F1D4C243B00A1ECE6 /* MGLSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; 352742821D4C243B00A1ECE6 /* MGLSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742801D4C243B00A1ECE6 /* MGLSource.mm */; }; - 352742851D4C244700A1ECE6 /* MGLRasterSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742831D4C244700A1ECE6 /* MGLRasterSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 352742861D4C244700A1ECE6 /* MGLRasterSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742841D4C244700A1ECE6 /* MGLRasterSource.mm */; }; + 352742851D4C244700A1ECE6 /* MGLRasterTileSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742831D4C244700A1ECE6 /* MGLRasterTileSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 352742861D4C244700A1ECE6 /* MGLRasterTileSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742841D4C244700A1ECE6 /* MGLRasterTileSource.mm */; }; 352742891D4C245800A1ECE6 /* MGLShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 352742871D4C245800A1ECE6 /* MGLShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3527428A1D4C245800A1ECE6 /* MGLShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 352742881D4C245800A1ECE6 /* MGLShapeSource.mm */; }; 3527428D1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3527428B1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -124,7 +124,7 @@ DA7262071DEEDD460043BB89 /* MGLOpenGLStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7262051DEEDD460043BB89 /* MGLOpenGLStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; DA7262081DEEDD460043BB89 /* MGLOpenGLStyleLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA7262061DEEDD460043BB89 /* MGLOpenGLStyleLayer.mm */; }; DA7DC9811DED5F5C0027472F /* MGLVectorSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7DC9801DED5F5C0027472F /* MGLVectorSource_Private.h */; }; - DA7DC9831DED647F0027472F /* MGLRasterSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7DC9821DED647F0027472F /* MGLRasterSource_Private.h */; }; + DA7DC9831DED647F0027472F /* MGLRasterTileSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA7DC9821DED647F0027472F /* MGLRasterTileSource_Private.h */; }; DA839E971CC2E3400062CAFB /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DA839E961CC2E3400062CAFB /* AppDelegate.m */; }; DA839E9A1CC2E3400062CAFB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DA839E991CC2E3400062CAFB /* main.m */; }; DA839E9D1CC2E3400062CAFB /* MapDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = DA839E9C1CC2E3400062CAFB /* MapDocument.m */; }; @@ -319,8 +319,8 @@ 352742771D4C220900A1ECE6 /* MGLStyleValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleValue.h; sourceTree = ""; }; 3527427F1D4C243B00A1ECE6 /* MGLSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSource.h; sourceTree = ""; }; 352742801D4C243B00A1ECE6 /* MGLSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLSource.mm; sourceTree = ""; }; - 352742831D4C244700A1ECE6 /* MGLRasterSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterSource.h; sourceTree = ""; }; - 352742841D4C244700A1ECE6 /* MGLRasterSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterSource.mm; sourceTree = ""; }; + 352742831D4C244700A1ECE6 /* MGLRasterTileSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterTileSource.h; sourceTree = ""; }; + 352742841D4C244700A1ECE6 /* MGLRasterTileSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterTileSource.mm; sourceTree = ""; }; 352742871D4C245800A1ECE6 /* MGLShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeSource.h; sourceTree = ""; }; 352742881D4C245800A1ECE6 /* MGLShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLShapeSource.mm; sourceTree = ""; }; 3527428B1D4C24AB00A1ECE6 /* MGLCircleStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCircleStyleLayer.h; sourceTree = ""; }; @@ -455,7 +455,7 @@ DA737AE41E5915B000AD2CDE /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; DA737AEC1E59180E00AD2CDE /* uk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = ""; }; DA7DC9801DED5F5C0027472F /* MGLVectorSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorSource_Private.h; sourceTree = ""; }; - DA7DC9821DED647F0027472F /* MGLRasterSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterSource_Private.h; sourceTree = ""; }; + DA7DC9821DED647F0027472F /* MGLRasterTileSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterTileSource_Private.h; sourceTree = ""; }; DA80E95D1FE84A300065FC9B /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = ""; }; DA80E95F1FE84A540065FC9B /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ar; path = ar.lproj/Foundation.stringsdict; sourceTree = ""; }; DA839E921CC2E3400062CAFB /* Mapbox GL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Mapbox GL.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -724,9 +724,9 @@ 07D947491F6741F500E37934 /* MGLAbstractShapeSource.mm */, 07F8E2F41F674C8000F794BB /* MGLComputedShapeSource.h */, 07F8E2F51F674C8000F794BB /* MGLComputedShapeSource.mm */, - 352742831D4C244700A1ECE6 /* MGLRasterSource.h */, - DA7DC9821DED647F0027472F /* MGLRasterSource_Private.h */, - 352742841D4C244700A1ECE6 /* MGLRasterSource.mm */, + 352742831D4C244700A1ECE6 /* MGLRasterTileSource.h */, + DA7DC9821DED647F0027472F /* MGLRasterTileSource_Private.h */, + 352742841D4C244700A1ECE6 /* MGLRasterTileSource.mm */, DACA8620201920BE00E9693A /* MGLRasterDEMSource.h */, DACA8621201920BE00E9693A /* MGLRasterDEMSource.mm */, 352742871D4C245800A1ECE6 /* MGLShapeSource.h */, @@ -1187,7 +1187,7 @@ DA8F258F1D51CA600010E6B5 /* MGLRasterStyleLayer.h in Headers */, 3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */, DAE6C38D1CC31E2A00DB3429 /* MGLOfflineRegion_Private.h in Headers */, - DA7DC9831DED647F0027472F /* MGLRasterSource_Private.h in Headers */, + DA7DC9831DED647F0027472F /* MGLRasterTileSource_Private.h in Headers */, 1753ED401E53CE6100A9FD90 /* MGLConversion.h in Headers */, DA8F259C1D51CB000010E6B5 /* MGLStyleValue_Private.h in Headers */, DAE6C35B1CC31E0400DB3429 /* MGLAnnotation.h in Headers */, @@ -1277,7 +1277,7 @@ DAE6C3891CC31E2A00DB3429 /* MGLMultiPoint_Private.h in Headers */, DAE6C3A51CC31E9400DB3429 /* MGLMapView+IBAdditions.h in Headers */, DA35A2AD1CCA091800E826B2 /* MGLCompassDirectionFormatter.h in Headers */, - 352742851D4C244700A1ECE6 /* MGLRasterSource.h in Headers */, + 352742851D4C244700A1ECE6 /* MGLRasterTileSource.h in Headers */, 9654C12D1FFC394700DB6A19 /* MGLPolygon_Private.h in Headers */, 408AA85B1DAEECFE00022900 /* MGLShape_Private.h in Headers */, DACC22181CF3D4F700D220D9 /* MGLFeature_Private.h in Headers */, @@ -1518,7 +1518,7 @@ DAE6C3B31CC31EF300DB3429 /* MGLAttributionButton.mm in Sources */, 35602BFB1D3EA99F0050646F /* MGLFillStyleLayer.mm in Sources */, DAE6C3931CC31E2A00DB3429 /* MGLShape.mm in Sources */, - 352742861D4C244700A1ECE6 /* MGLRasterSource.mm in Sources */, + 352742861D4C244700A1ECE6 /* MGLRasterTileSource.mm in Sources */, 558DE7A71E56161C00C7916D /* MGLFoundation.mm in Sources */, DAE6C39D1CC31E2A00DB3429 /* NSString+MGLAdditions.m in Sources */, 3598195A1E02F611008FC139 /* NSCoder+MGLAdditions.mm in Sources */, diff --git a/platform/macos/src/MGLMapView.h b/platform/macos/src/MGLMapView.h index 74224622d4..c5f090be3e 100644 --- a/platform/macos/src/MGLMapView.h +++ b/platform/macos/src/MGLMapView.h @@ -876,8 +876,8 @@ MGL_EXPORT IB_DESIGNABLE current style and provides access to attributes specified by the relevant map content sources. The returned array includes features loaded by `MGLShapeSource` and `MGLVectorSource` objects but does not include anything - from `MGLRasterSource` objects, or from image, video, or canvas sources, which - are unsupported by this SDK. + from `MGLRasterTileSource` objects, or from video or canvas sources, which are + unsupported by this SDK. The returned features are drawn by a style layer in the current style. For example, suppose the current style uses the @@ -973,8 +973,8 @@ MGL_EXPORT IB_DESIGNABLE current style and provides access to attributes specified by the relevant map content sources. The returned array includes features loaded by `MGLShapeSource` and `MGLVectorSource` objects but does not include anything - from `MGLRasterSource` objects, or from image, video, or canvas sources, which - are unsupported by this SDK. + from `MGLRasterTileSource` objects, or from video or canvas sources, which are + unsupported by this SDK. The returned features are drawn by a style layer in the current style. For example, suppose the current style uses the diff --git a/platform/macos/src/Mapbox.h b/platform/macos/src/Mapbox.h index 0e4b546cf7..20be206d79 100644 --- a/platform/macos/src/Mapbox.h +++ b/platform/macos/src/Mapbox.h @@ -53,7 +53,7 @@ FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[]; #import "MGLShapeSource.h" #import "MGLAbstractShapeSource.h" #import "MGLComputedShapeSource.h" -#import "MGLRasterSource.h" +#import "MGLRasterTileSource.h" #import "MGLRasterDEMSource.h" #import "MGLImageSource.h" #import "MGLTilePyramidOfflineRegion.h" -- cgit v1.2.1