summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLShapeSource.mm
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-08-10 14:45:57 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-08-21 11:58:56 +0300
commite0e5dbb161a105a40b9f0d88c6625f05ab54e106 (patch)
treea924a6466c0d0bf14a1442a3db95ef282bc91a26 /platform/darwin/src/MGLShapeSource.mm
parent112bbc7ab289298094d6e6593437a71ec8029caa (diff)
downloadqtlocation-mapboxgl-e0e5dbb161a105a40b9f0d88c6625f05ab54e106.tar.gz
[ios, macos] Introduce `MGLShapeSourceOptionLineDistanceMetrics`upstream/MGLShapeSourceOptionLineDistanceMetrics
Exposes access to https://www.mapbox.com/mapbox-gl-js/style-spec/#sources-geojson-lineMetrics
Diffstat (limited to 'platform/darwin/src/MGLShapeSource.mm')
-rw-r--r--platform/darwin/src/MGLShapeSource.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLShapeSource.mm b/platform/darwin/src/MGLShapeSource.mm
index 1425269012..6512d07a66 100644
--- a/platform/darwin/src/MGLShapeSource.mm
+++ b/platform/darwin/src/MGLShapeSource.mm
@@ -20,6 +20,7 @@ const MGLShapeSourceOption MGLShapeSourceOptionMaximumZoomLevel = @"MGLShapeSour
const MGLShapeSourceOption MGLShapeSourceOptionMaximumZoomLevelForClustering = @"MGLShapeSourceOptionMaximumZoomLevelForClustering";
const MGLShapeSourceOption MGLShapeSourceOptionMinimumZoomLevel = @"MGLShapeSourceOptionMinimumZoomLevel";
const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance = @"MGLShapeSourceOptionSimplificationTolerance";
+const MGLShapeSourceOption MGLShapeSourceOptionLineDistanceMetrics = @"MGLShapeSourceOptionLineDistanceMetrics";
mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NSDictionary<MGLShapeSourceOption, id> *options) {
auto geoJSONOptions = mbgl::style::GeoJSONOptions();
@@ -80,6 +81,14 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NSDictionary<MGLShap
geoJSONOptions.cluster = value.boolValue;
}
+ if (NSNumber *value = options[MGLShapeSourceOptionLineDistanceMetrics]) {
+ if (![value isKindOfClass:[NSNumber class]]) {
+ [NSException raise:NSInvalidArgumentException
+ format:@"MGLShapeSourceOptionLineDistanceMetrics must be an NSNumber."];
+ }
+ geoJSONOptions.lineMetrics = value.boolValue;
+ }
+
return geoJSONOptions;
}