diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-08-10 14:45:57 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-08-21 13:49:35 +0300 |
commit | 5ce64b786cfd2fbfdc28ccfbcf9c1a5216346281 (patch) | |
tree | 9eed5006ab59268e4004e157f9f49a9a9e41b7a5 /platform/darwin/src/MGLShapeSource.mm | |
parent | 7e6331b29f13a14076bac4ebbf22006c055933c8 (diff) | |
download | qtlocation-mapboxgl-5ce64b786cfd2fbfdc28ccfbcf9c1a5216346281.tar.gz |
[ios, macos] Introduce `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.mm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLShapeSource.mm b/platform/darwin/src/MGLShapeSource.mm index 9457d2569a..c960f2a4a7 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; } |