Use common initialization logic to create an unique pointer to an mbgl source object, up front, when a MGL source is created. Keep a raw pointer to the unique pointer that is pointed at the mbgl source instance when a MGL source is created or when a MGL source is obtained by identifier from MGLStyle. Once the transfer of ownership of the mbgl source takes place, the unique ptr is null. The raw pointer can be used internally for future work that involves mutating the source. This also changes the URL, features, and geoJSONData content properties for MGLGeoJSON source to be writable. If they are set with valid data after a source has been added to the map then the map will update to reflect the new data.
11 lines
209 B
Objective-C
11 lines
209 B
Objective-C
#import "MGLGeoJSONSource.h"
|
|
#import "MGLGeoJSONSource_Private.h"
|
|
|
|
#include <mbgl/style/sources/geojson_source.hpp>
|
|
|
|
@interface MGLGeoJSONSource (Private)
|
|
|
|
- (mbgl::style::GeoJSONOptions)geoJSONOptions;
|
|
|
|
@end
|