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: [PATCH] [ios, macos] Renamed MGLRasterSource to MGLRasterTileSource Also updated various source class listings to reflect the addition of image and raster DEM sources. --- .../docs/guides/For Style Authors.md.ejs | 9 ++-- .../docs/guides/Tile URL Templates.md.ejs | 14 +++--- .../scripts/style-spec-overrides-v8.json | 2 +- platform/darwin/src/MGLRasterDEMSource.h | 4 +- platform/darwin/src/MGLRasterDEMSource.mm | 2 +- platform/darwin/src/MGLRasterStyleLayer.h | 2 +- ...GLRasterSource.h => MGLRasterTileSource.h} | 41 ++++++++-------- ...RasterSource.mm => MGLRasterTileSource.mm} | 14 +++--- ...rivate.h => MGLRasterTileSource_Private.h} | 4 +- platform/darwin/src/MGLSource.h | 2 +- platform/darwin/src/MGLStyle.mm | 4 +- platform/darwin/src/MGLTileSource.h | 2 +- .../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 ++-- .../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 + .../macos/docs/guides/For Style Authors.md | 9 ++-- .../macos/docs/guides/Tile URL Templates.md | 14 +++--- platform/macos/jazzy.yml | 5 +- .../macos/macos.xcodeproj/project.pbxproj | 24 +++++----- platform/macos/src/MGLMapView.h | 8 ++-- platform/macos/src/Mapbox.h | 2 +- 29 files changed, 162 insertions(+), 153 deletions(-) rename platform/darwin/src/{MGLRasterSource.h => MGLRasterTileSource.h} (77%) rename platform/darwin/src/{MGLRasterSource.mm => MGLRasterTileSource.mm} (88%) rename platform/darwin/src/{MGLRasterSource_Private.h => MGLRasterTileSource_Private.h} (84%) diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index 45cfa105b..8b9b4b06f 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 78fb29713..558d5b451 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, 1⁄16 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 b0c50a06f..be50be4e1 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 d00912ca7..c53ca9867 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 d8639b70e..27614b9ef 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/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h index fd41f271e..bca9649e5 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 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 + 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 TileJSON specification. - 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 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 + `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 similarity index 88% rename from platform/darwin/src/MGLRasterSource.mm rename to platform/darwin/src/MGLRasterTileSource.mm index c47cc199e..02cfef4ae 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 similarity index 84% rename from platform/darwin/src/MGLRasterSource_Private.h rename to platform/darwin/src/MGLRasterTileSource_Private.h index 6f40fbc5a..128dcb447 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 @@ -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 8d8c93683..e3e45faca 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 199f6c2e0..35db1b211 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 2d75fa14d..c6e63179c 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 5a112f07e..08650e864 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 95051cfae..b9fbe1cfd 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 e28142590..6fda59d4c 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 2a6708a69..17b807459 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 746211262..b6c82ddcf 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 f61d2ea33..0030e9b48 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, 1⁄16 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 971258efd..dea25c7e0 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 61e9ad39e..c0c2c2151 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 2d566f26a..e315f343d 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 11720ac68..9786d5539 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 fd2258947..c95da49a0 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 d99d25527..e3a162108 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 01672c668..b2c980a3f 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, 1⁄16 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 b4dccb620..1a8ff351e 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 2ae0ea3bc..7f97f9b0d 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 74224622d..c5f090be3 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 0e4b546cf..20be206d7 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"