Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Declare mbgl::style::GeoJSONOptions as immutable #101

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLShapeSource.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance = @"MGLShapeSourceOptionSimplificationTolerance";
const MGLShapeSourceOption MGLShapeSourceOptionLineDistanceMetrics = @"MGLShapeSourceOptionLineDistanceMetrics";

mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NSDictionary<MGLShapeSourceOption, id> *options) {
mbgl::Immutable<mbgl::style::GeoJSONOptions> MGLGeoJSONOptionsFromDictionary(NSDictionary<MGLShapeSourceOption, id> *options) {
auto geoJSONOptions = mbgl::style::GeoJSONOptions();

if (NSNumber *value = options[MGLShapeSourceOptionMinimumZoomLevel]) {
Expand Down Expand Up @@ -145,7 +145,7 @@
geoJSONOptions.lineMetrics = value.boolValue;
}

return geoJSONOptions;
return mbgl::makeMutable<mbgl::style::GeoJSONOptions>(std::move(geoJSONOptions));
}

@interface MGLShapeSource ()
Expand Down
3 changes: 2 additions & 1 deletion platform/darwin/src/MGLShapeSource_Private.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "MGLFoundation.h"
#import "MGLShapeSource.h"
#include <mbgl/util/immutable.hpp>

NS_ASSUME_NONNULL_BEGIN

Expand All @@ -10,7 +11,7 @@ namespace mbgl {
}

MGL_EXPORT
mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NSDictionary<MGLShapeSourceOption, id> *options);
mbgl::Immutable<mbgl::style::GeoJSONOptions> MGLGeoJSONOptionsFromDictionary(NSDictionary<MGLShapeSourceOption, id> *options);

@interface MGLShapeSource (Private)

Expand Down
2 changes: 1 addition & 1 deletion vendor/mapbox-gl-native
Submodule mapbox-gl-native updated 3387 files