Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit ba59fc2

Browse files
Jesse Crockerkkaefer
Jesse Crocker
authored andcommitted
[ios,macos] Add bindings for Custom vector sources
1 parent 7576339 commit ba59fc2

11 files changed

+316
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#import "MGLAbstractShapeSource.h"
2+
3+
#import "MGLFoundation.h"
4+
#import "MGLGeometry.h"
5+
#import "MGLTypes.h"
6+
#import "MGLShape.h"
7+
8+
NS_ASSUME_NONNULL_BEGIN
9+
10+
@protocol MGLFeature;
11+
12+
/**
13+
Data source for `MGLComputedShapeSource`. This protocol defines two optional methods for fetching
14+
data, one based on tile coordinates, and one based on a bounding box. Classes that implement this
15+
protocol must implement one, and only one of the methods.
16+
*/
17+
@protocol MGLComputedShapeSourceDataSource <NSObject>
18+
19+
@optional
20+
/**
21+
Fetch features for a tile. This will not be called on the main queue, it will be called on the caller's requestQueue.
22+
@param x tile X coordinate
23+
@param y tile Y coordinate
24+
@param zoomLevel tile zoom level
25+
*/
26+
- (NSArray<MGLShape <MGLFeature> *>*)featuresInTileAtX:(NSUInteger)x y:(NSUInteger)y zoomLevel:(NSUInteger)zoomLevel;
27+
28+
/**
29+
Fetch features for a tile. This will not be called on the main queue, it will be called on the caller's requestQueue.
30+
@param bounds The bounds to fetch data for
31+
@param zoomLevel tile zoom level
32+
*/
33+
- (NSArray<MGLShape <MGLFeature> *>*)featuresInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoomLevel;
34+
35+
@end
36+
37+
/**
38+
A source for vector data that is fetched one tile at a time. Useful for sources that are
39+
too large to fit in memory, or are already divided into tiles, but not in Mapbox Vector Tile format.
40+
*/
41+
MGL_EXPORT
42+
@interface MGLComputedShapeSource : MGLAbstractShapeSource
43+
44+
/**
45+
Returns a custom vector data source initialized with an identifier, data source, and a
46+
dictionary of options for the source according to the
47+
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson">style
48+
specification</a>.
49+
50+
@param identifier A string that uniquely identifies the source.
51+
@param options An `NSDictionary` of options for this source.
52+
*/
53+
- (instancetype)initWithIdentifier:(NSString *)identifier options:(nullable NS_DICTIONARY_OF(MGLShapeSourceOption, id) *)options NS_DESIGNATED_INITIALIZER;
54+
55+
/**
56+
Request that the source reloads a region.
57+
*/
58+
- (void)reloadTileInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoomLevel;
59+
60+
/**
61+
Reload all tiles.
62+
*/
63+
- (void)reloadData;
64+
65+
/**
66+
An object that implements the `MGLComputedShapeSource` protocol that will be queried for tile data.
67+
*/
68+
@property (nonatomic, weak, nullable) id<MGLComputedShapeSourceDataSource> dataSource;
69+
70+
/**
71+
A queue that calls to the data source will be made on.
72+
*/
73+
@property (nonatomic, readonly) NSOperationQueue *requestQueue;
74+
75+
@end
76+
77+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
#import "MGLComputedShapeSource.h"
2+
3+
#import "MGLMapView_Private.h"
4+
#import "MGLSource_Private.h"
5+
#import "MGLShape_Private.h"
6+
#import "MGLAbstractShapeSource_Private.h"
7+
#import "MGLGeometry_Private.h"
8+
9+
#include <mbgl/map/map.hpp>
10+
#include <mbgl/style/sources/custom_vector_source.hpp>
11+
#include <mbgl/tile/tile_id.hpp>
12+
#include <mbgl/util/geo.hpp>
13+
#include <mbgl/util/geojson.hpp>
14+
15+
@interface MGLComputedShapeSource () {
16+
std::unique_ptr<mbgl::style::CustomVectorSource> _pendingSource;
17+
}
18+
19+
@property (nonatomic, readwrite) NSDictionary *options;
20+
@property (nonnull) mbgl::style::CustomVectorSource *rawSource;
21+
@property (nonatomic, assign) BOOL dataSourceImplementsFeaturesForTile;
22+
@property (nonatomic, assign) BOOL dataSourceImplementsFeaturesForBounds;
23+
24+
@end
25+
26+
@interface MGLComputedShapeSourceFetchOperation : NSOperation
27+
28+
@property (nonatomic, readonly) uint8_t z;
29+
@property (nonatomic, readonly) uint32_t x;
30+
@property (nonatomic, readonly) uint32_t y;
31+
@property (nonatomic, assign) BOOL dataSourceImplementsFeaturesForTile;
32+
@property (nonatomic, assign) BOOL dataSourceImplementsFeaturesForBounds;
33+
@property (nonatomic, weak, nullable) id<MGLComputedShapeSourceDataSource> dataSource;
34+
@property (nonatomic, nullable) mbgl::style::CustomVectorSource *rawSource;
35+
36+
- (instancetype)initForSource:(MGLComputedShapeSource*)source tile:(const mbgl::CanonicalTileID&)tileId;
37+
38+
@end
39+
40+
@implementation MGLComputedShapeSourceFetchOperation
41+
42+
- (instancetype)initForSource:(MGLComputedShapeSource*)source tile:(const mbgl::CanonicalTileID&)tileID {
43+
self = [super init];
44+
_z = tileID.z;
45+
_x = tileID.x;
46+
_y = tileID.y;
47+
_dataSourceImplementsFeaturesForTile = source.dataSourceImplementsFeaturesForTile;
48+
_dataSourceImplementsFeaturesForBounds = source.dataSourceImplementsFeaturesForBounds;
49+
_dataSource = source.dataSource;
50+
mbgl::style::CustomVectorSource *rawSource = (mbgl::style::CustomVectorSource *)source.rawSource;
51+
_rawSource = rawSource;
52+
return self;
53+
}
54+
55+
- (void)main {
56+
if ([self isCancelled]) {
57+
return;
58+
}
59+
60+
NSArray<MGLShape <MGLFeature> *> *data;
61+
if(!self.dataSource) {
62+
data = nil;
63+
} else if(self.dataSourceImplementsFeaturesForTile) {
64+
data = [self.dataSource featuresInTileAtX:self.x
65+
y:self.y
66+
zoomLevel:self.z];
67+
} else {
68+
mbgl::CanonicalTileID tileID = mbgl::CanonicalTileID(self.z, self.x, self.y);
69+
mbgl::LatLngBounds tileBounds = mbgl::LatLngBounds(tileID);
70+
data = [self.dataSource featuresInCoordinateBounds:MGLCoordinateBoundsFromLatLngBounds(tileBounds)
71+
zoomLevel:self.z];
72+
}
73+
74+
if(![self isCancelled]) {
75+
mbgl::FeatureCollection featureCollection;
76+
featureCollection.reserve(data.count);
77+
for (MGLShape <MGLFeature> * feature in data) {
78+
mbgl::Feature geoJsonObject = [feature geoJSONObject].get<mbgl::Feature>();
79+
featureCollection.push_back(geoJsonObject);
80+
}
81+
const auto geojson = mbgl::GeoJSON{featureCollection};
82+
dispatch_sync(dispatch_get_main_queue(), ^{
83+
if(![self isCancelled] && self.rawSource) {
84+
self.rawSource->setTileData(mbgl::CanonicalTileID(self.z, self.x, self.y), geojson);
85+
}
86+
});
87+
}
88+
}
89+
90+
- (void)cancel {
91+
[super cancel];
92+
self.rawSource = NULL;
93+
}
94+
95+
@end
96+
97+
@implementation MGLComputedShapeSource
98+
99+
- (instancetype)initWithIdentifier:(NSString *)identifier options:(NS_DICTIONARY_OF(MGLShapeSourceOption, id) *)options {
100+
if (self = [super initWithIdentifier:identifier]) {
101+
_requestQueue = [[NSOperationQueue alloc] init];
102+
self.requestQueue.name = [NSString stringWithFormat:@"mgl.MGLComputedShapeSource.%@", identifier];
103+
auto geoJSONOptions = MGLGeoJSONOptionsFromDictionary(options);
104+
auto source = std::make_unique<mbgl::style::CustomVectorSource>
105+
(self.identifier.UTF8String, geoJSONOptions,
106+
^void(const mbgl::CanonicalTileID& tileID)
107+
{
108+
NSOperation *operation = [[MGLComputedShapeSourceFetchOperation alloc] initForSource:self tile:tileID];
109+
[self.requestQueue addOperation:operation];
110+
});
111+
112+
_pendingSource = std::move(source);
113+
self.rawSource = _pendingSource.get();
114+
}
115+
return self;
116+
}
117+
118+
- (void)dealloc {
119+
[self.requestQueue cancelAllOperations];
120+
}
121+
122+
- (void)setDataSource:(id<MGLComputedShapeSourceDataSource>)dataSource {
123+
[self.requestQueue cancelAllOperations];
124+
// Check which method the datasource implements, to avoid having to check for each tile
125+
self.dataSourceImplementsFeaturesForTile = [dataSource respondsToSelector:@selector(featuresInTileAtX:y:zoomLevel:)];
126+
self.dataSourceImplementsFeaturesForBounds = [dataSource respondsToSelector:@selector(featuresInCoordinateBounds:zoomLevel:)];
127+
128+
if(!self.dataSourceImplementsFeaturesForBounds && !self.dataSourceImplementsFeaturesForTile) {
129+
[NSException raise:@"Invalid Datasource" format:@"Datasource does not implement any MGLComputedShapeSourceDataSource methods"];
130+
} else if(self.dataSourceImplementsFeaturesForBounds && self.dataSourceImplementsFeaturesForTile) {
131+
[NSException raise:@"Invalid Datasource" format:@"Datasource implements multiple MGLComputedShapeSourceDataSource methods"];
132+
}
133+
134+
_dataSource = dataSource;
135+
}
136+
137+
- (void)addToMapView:(MGLMapView *)mapView {
138+
if (_pendingSource == nullptr) {
139+
[NSException raise:@"MGLRedundantSourceException"
140+
format:@"This instance %@ was already added to %@. Adding the same source instance " \
141+
"to the style more than once is invalid.", self, mapView.style];
142+
}
143+
144+
mapView.mbglMap->addSource(std::move(_pendingSource));
145+
}
146+
147+
- (void)removeFromMapView:(MGLMapView *)mapView {
148+
[self.requestQueue cancelAllOperations];
149+
if (self.rawSource != mapView.mbglMap->getSource(self.identifier.UTF8String)) {
150+
return;
151+
}
152+
153+
auto removedSource = mapView.mbglMap->removeSource(self.identifier.UTF8String);
154+
155+
mbgl::style::CustomVectorSource *source = dynamic_cast<mbgl::style::CustomVectorSource *>(removedSource.get());
156+
if (!source) {
157+
return;
158+
}
159+
160+
removedSource.release();
161+
162+
_pendingSource = std::unique_ptr<mbgl::style::CustomVectorSource>(source);
163+
self.rawSource = _pendingSource.get();
164+
}
165+
166+
- (void)reloadTileInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoomLevel {
167+
self.rawSource->reloadRegion(MGLLatLngBoundsFromCoordinateBounds(bounds), (uint8_t)zoomLevel);
168+
}
169+
170+
- (void)setNeedsUpdateAtZoomLevel:(NSUInteger)z x:(NSUInteger)x y:(NSUInteger)y {
171+
mbgl::CanonicalTileID tileID = mbgl::CanonicalTileID((uint8_t)z, (uint32_t)x, (uint32_t)y);
172+
self.rawSource->reloadTile(tileID);
173+
}
174+
175+
- (void)reloadData {
176+
[self.requestQueue cancelAllOperations];
177+
self.rawSource->reload();
178+
}
179+
180+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#import <XCTest/XCTest.h>
2+
3+
#import <Mapbox/Mapbox.h>
4+
5+
6+
@interface MGLComputedShapeSourceTests : XCTestCase
7+
@end
8+
9+
@implementation MGLComputedShapeSourceTests
10+
11+
- (void)testInitializer {
12+
MGLComputedShapeSource *source = [[MGLComputedShapeSource alloc] initWithIdentifier:@"id"
13+
options:@{}];
14+
XCTAssertNotNil(source);
15+
XCTAssertNotNil(source.requestQueue);
16+
XCTAssertNil(source.dataSource);
17+
}
18+
19+
- (void)testNilOptions {
20+
MGLComputedShapeSource *source = [[MGLComputedShapeSource alloc] initWithIdentifier:@"id" options:nil];
21+
XCTAssertNotNil(source);
22+
}
23+
24+
25+
@end

platform/ios/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
55
## master
66

77
* The error passed into `-[MGLMapViewDelegate mapViewDidFailLoadingMap:withError:]` now includes a more specific description and failure reason. ([#8418](https://github.com/mapbox/mapbox-gl-native/pull/8418))
8+
* Added `MGLComputedShapeSource` source class that allows applications to supply vector data on a per-tile basis.
89

910
## 3.5.0
1011

platform/ios/ios.xcodeproj/project.pbxproj

+16
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,13 @@
190190
9221B2F11E6F9D1400A2385E /* query-style.json in Resources */ = {isa = PBXBuildFile; fileRef = 9221B2F01E6F9D1400A2385E /* query-style.json */; };
191191
88B079A61E363A7200834FAB /* MGLAbstractShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 88B079A51E36371A00834FAB /* MGLAbstractShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
192192
88B079A71E363A7300834FAB /* MGLAbstractShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 88B079A51E36371A00834FAB /* MGLAbstractShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
193+
88DDFB291DCB7A9200B53BDD /* MGLComputedShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 88F0C0811DC8FD8C002DB7AE /* MGLComputedShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
194+
88DDFB2A1DCB7AFC00B53BDD /* MGLComputedShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 88F0C0811DC8FD8C002DB7AE /* MGLComputedShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
193195
88DDFB2F1DCBC21700B53BDD /* MGLAbstractShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 88DDFB2C1DCBC21700B53BDD /* MGLAbstractShapeSource.mm */; };
194196
88DDFB301DCBC21700B53BDD /* MGLAbstractShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 88DDFB2C1DCBC21700B53BDD /* MGLAbstractShapeSource.mm */; };
197+
88EF0E6C1E677358008A6617 /* MGLComputedShapeSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88EF0E6A1E677345008A6617 /* MGLComputedShapeSourceTests.m */; };
198+
88F0C0851DC8FD8C002DB7AE /* MGLComputedShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 88F0C0821DC8FD8C002DB7AE /* MGLComputedShapeSource.mm */; };
199+
88F0C0861DC8FD8C002DB7AE /* MGLComputedShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 88F0C0821DC8FD8C002DB7AE /* MGLComputedShapeSource.mm */; };
195200
968F36B51E4D128D003A5522 /* MGLDistanceFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3557F7AE1E1D27D300CCA5E6 /* MGLDistanceFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; };
196201
96E027231E57C76E004B8E66 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 96E027251E57C76E004B8E66 /* Localizable.strings */; };
197202
DA00FC8E1D5EEB0D009AABC8 /* MGLAttributionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA00FC8C1D5EEB0D009AABC8 /* MGLAttributionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -651,6 +656,9 @@
651656
88B079A51E36371A00834FAB /* MGLAbstractShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAbstractShapeSource.h; sourceTree = "<group>"; };
652657
88DDFB2C1DCBC21700B53BDD /* MGLAbstractShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLAbstractShapeSource.mm; sourceTree = "<group>"; tabWidth = 4; };
653658
88DDFB311DCBC36E00B53BDD /* MGLAbstractShapeSource_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLAbstractShapeSource_Private.h; sourceTree = "<group>"; };
659+
88EF0E6A1E677345008A6617 /* MGLComputedShapeSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLComputedShapeSourceTests.m; path = ../../darwin/test/MGLComputedShapeSourceTests.m; sourceTree = "<group>"; };
660+
88F0C0811DC8FD8C002DB7AE /* MGLComputedShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLComputedShapeSource.h; sourceTree = "<group>"; };
661+
88F0C0821DC8FD8C002DB7AE /* MGLComputedShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLComputedShapeSource.mm; sourceTree = "<group>"; tabWidth = 4; };
654662
9660916B1E5BBFD700A9A03B /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
655663
9660916C1E5BBFD900A9A03B /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = "<group>"; };
656664
9660916D1E5BBFDB00A9A03B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -960,6 +968,8 @@
960968
350098B91D480108004B2AF0 /* MGLVectorSource.h */,
961969
DAF0D8121DFE0EC500B28378 /* MGLVectorSource_Private.h */,
962970
350098BA1D480108004B2AF0 /* MGLVectorSource.mm */,
971+
88F0C0811DC8FD8C002DB7AE /* MGLComputedShapeSource.h */,
972+
88F0C0821DC8FD8C002DB7AE /* MGLComputedShapeSource.mm */,
963973
88DDFB311DCBC36E00B53BDD /* MGLAbstractShapeSource_Private.h */,
964974
88B079A51E36371A00834FAB /* MGLAbstractShapeSource.h */,
965975
88DDFB2C1DCBC21700B53BDD /* MGLAbstractShapeSource.mm */,
@@ -1072,6 +1082,7 @@
10721082
children = (
10731083
40CFA6501D787579008103BD /* MGLShapeSourceTests.mm */,
10741084
920A3E5C1E6F995200C16EFC /* MGLSourceQueryTests.m */,
1085+
88EF0E6A1E677345008A6617 /* MGLComputedShapeSourceTests.m */,
10751086
4085AF081D933DEA00F11B22 /* MGLTileSetTests.mm */,
10761087
);
10771088
name = Sources;
@@ -1648,6 +1659,7 @@
16481659
DA8848871CBB033F00AB86E3 /* Fabric.h in Headers */,
16491660
35305D4A1D22AA6A0007D005 /* NSData+MGLAdditions.h in Headers */,
16501661
359F57461D2FDDA6005217F1 /* MGLUserLocationAnnotationView_Private.h in Headers */,
1662+
88DDFB2A1DCB7AFC00B53BDD /* MGLComputedShapeSource.h in Headers */,
16511663
404C26E21D89B877000AA13D /* MGLTileSource.h in Headers */,
16521664
DA8848841CBB033F00AB86E3 /* FABAttributes.h in Headers */,
16531665
DA8847FD1CBAFA5100AB86E3 /* MGLTilePyramidOfflineRegion.h in Headers */,
@@ -1670,6 +1682,7 @@
16701682
DA35A2CA1CCAAAD200E826B2 /* NSValue+MGLAdditions.h in Headers */,
16711683
350098BC1D480108004B2AF0 /* MGLVectorSource.h in Headers */,
16721684
353933FC1D3FB7C0003F57D7 /* MGLRasterStyleLayer.h in Headers */,
1685+
88DDFB291DCB7A9200B53BDD /* MGLComputedShapeSource.h in Headers */,
16731686
3566C76D1D4A8DFA008152BC /* MGLRasterSource.h in Headers */,
16741687
DAED38641D62D0FC00D7640F /* NSURL+MGLAdditions.h in Headers */,
16751688
DABFB85E1CBE99E500D62B32 /* MGLAnnotation.h in Headers */,
@@ -2079,6 +2092,7 @@
20792092
3598544D1E1D38AA00B29F84 /* MGLDistanceFormatterTests.m in Sources */,
20802093
DA2DBBCE1D51E80400D38FF9 /* MGLStyleLayerTests.m in Sources */,
20812094
DA35A2C61CCA9F8300E826B2 /* MGLCompassDirectionFormatterTests.m in Sources */,
2095+
88EF0E6C1E677358008A6617 /* MGLComputedShapeSourceTests.m in Sources */,
20822096
DAE7DEC21E245455007505A6 /* MGLNSStringAdditionsTests.m in Sources */,
20832097
4085AF091D933DEA00F11B22 /* MGLTileSetTests.mm in Sources */,
20842098
DAEDC4341D603417000224FF /* MGLAttributionInfoTests.m in Sources */,
@@ -2117,6 +2131,7 @@
21172131
30E578191DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */,
21182132
40EDA1C11CFE0E0500D9EA68 /* MGLAnnotationContainerView.m in Sources */,
21192133
DA8848541CBAFB9800AB86E3 /* MGLCompactCalloutView.m in Sources */,
2134+
88F0C0851DC8FD8C002DB7AE /* MGLComputedShapeSource.mm in Sources */,
21202135
DA8848251CBAFA6200AB86E3 /* MGLPointAnnotation.mm in Sources */,
21212136
35136D3C1D42272500C20EFD /* MGLCircleStyleLayer.mm in Sources */,
21222137
350098DE1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */,
@@ -2195,6 +2210,7 @@
21952210
30E5781A1DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */,
21962211
40EDA1C21CFE0E0500D9EA68 /* MGLAnnotationContainerView.m in Sources */,
21972212
DAA4E4291CBB730400178DFB /* NSBundle+MGLAdditions.m in Sources */,
2213+
88F0C0861DC8FD8C002DB7AE /* MGLComputedShapeSource.mm in Sources */,
21982214
DAA4E42E1CBB730400178DFB /* MGLAPIClient.m in Sources */,
21992215
35136D3D1D42272500C20EFD /* MGLCircleStyleLayer.mm in Sources */,
22002216
350098DF1D484E60004B2AF0 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */,

platform/ios/jazzy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ custom_categories:
7474
- MGLTileSource
7575
- MGLAbstractShapeSource
7676
- MGLShapeSource
77+
- MGLComputedShapeSource
7778
- MGLRasterSource
7879
- MGLVectorSource
7980
- name: Style Layers

platform/ios/src/Mapbox.h

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[];
5050
#import "MGLVectorSource.h"
5151
#import "MGLShapeSource.h"
5252
#import "MGLAbstractShapeSource.h"
53+
#import "MGLComputedShapeSource.h"
5354
#import "MGLRasterSource.h"
5455
#import "MGLTilePyramidOfflineRegion.h"
5556
#import "MGLTypes.h"

platform/macos/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## master
44

55
* The error passed into `-[MGLMapViewDelegate mapViewDidFailLoadingMap:withError:]` now includes a more specific description and failure reason. ([#8418](https://github.com/mapbox/mapbox-gl-native/pull/8418))
6+
* Added `MGLComputedShapeSource` source class that allows applications to supply vector data on a per-tile basis.
67

78
## 0.4.0
89

0 commit comments

Comments
 (0)