From 5ce64b786cfd2fbfdc28ccfbcf9c1a5216346281 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Fri, 10 Aug 2018 14:45:57 +0300 Subject: [ios, macos] Introduce `MGLShapeSourceOptionLineDistanceMetrics` Exposes access to https://www.mapbox.com/mapbox-gl-js/style-spec/#sources-geojson-lineMetrics --- platform/darwin/src/MGLShapeSource.h | 12 ++++++++++++ platform/darwin/src/MGLShapeSource.mm | 9 +++++++++ 2 files changed, 21 insertions(+) (limited to 'platform/darwin/src') diff --git a/platform/darwin/src/MGLShapeSource.h b/platform/darwin/src/MGLShapeSource.h index e5c62515e5..c80c329cbc 100644 --- a/platform/darwin/src/MGLShapeSource.h +++ b/platform/darwin/src/MGLShapeSource.h @@ -95,6 +95,18 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionBuff */ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance; +/** + An `NSNumber` object containing a Boolean enabling or disabling calculating line distance metrics. + + Set this property to `YES` in order for the `MGLLineStyleLayer.lineGradient` property to have its intended effect. + The default value is `NO`. + + This option corresponds to the + lineMetrics + source property in the Mapbox Style Specification. + */ +FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionLineDistanceMetrics; + /** `MGLShapeSource` is a map content source that supplies vector shapes to be shown on the map. The shapes may be instances of `MGLShape` or `MGLFeature`, 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 *options) { auto geoJSONOptions = mbgl::style::GeoJSONOptions(); @@ -80,6 +81,14 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NSDictionary