summaryrefslogtreecommitdiff
path: root/platform/darwin/src
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src')
-rw-r--r--platform/darwin/src/MGLAccountManager.h6
-rw-r--r--platform/darwin/src/MGLAccountManager.m2
-rw-r--r--platform/darwin/src/MGLAnnotation.h6
-rw-r--r--platform/darwin/src/MGLAttributionInfo.h8
-rw-r--r--platform/darwin/src/MGLAttributionInfo.mm20
-rw-r--r--platform/darwin/src/MGLAttributionInfo_Private.h6
-rw-r--r--platform/darwin/src/MGLBackgroundStyleLayer.h16
-rw-r--r--platform/darwin/src/MGLBackgroundStyleLayer.mm2
-rw-r--r--platform/darwin/src/MGLCircleStyleLayer.h60
-rw-r--r--platform/darwin/src/MGLCircleStyleLayer.mm4
-rw-r--r--platform/darwin/src/MGLClockDirectionFormatter.h6
-rw-r--r--platform/darwin/src/MGLClockDirectionFormatter.m8
-rw-r--r--platform/darwin/src/MGLCompassDirectionFormatter.h6
-rw-r--r--platform/darwin/src/MGLCompassDirectionFormatter.m20
-rw-r--r--platform/darwin/src/MGLCoordinateFormatter.h8
-rw-r--r--platform/darwin/src/MGLCoordinateFormatter.m16
-rw-r--r--platform/darwin/src/MGLFeature.h44
-rw-r--r--platform/darwin/src/MGLFeature.mm30
-rw-r--r--platform/darwin/src/MGLFeature_Private.h2
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.h48
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.mm4
-rw-r--r--platform/darwin/src/MGLForegroundStyleLayer.h6
-rw-r--r--platform/darwin/src/MGLGeometry.h2
-rw-r--r--platform/darwin/src/MGLGeometry.mm2
-rw-r--r--platform/darwin/src/MGLGeometry_Private.h4
-rw-r--r--platform/darwin/src/MGLLineStyleLayer.h78
-rw-r--r--platform/darwin/src/MGLLineStyleLayer.mm4
-rw-r--r--platform/darwin/src/MGLMapCamera.h4
-rw-r--r--platform/darwin/src/MGLMapCamera.mm8
-rw-r--r--platform/darwin/src/MGLMultiPoint.h30
-rw-r--r--platform/darwin/src/MGLMultiPoint.mm10
-rw-r--r--platform/darwin/src/MGLNetworkConfiguration.h10
-rw-r--r--platform/darwin/src/MGLOfflinePack.h32
-rw-r--r--platform/darwin/src/MGLOfflinePack.mm46
-rw-r--r--platform/darwin/src/MGLOfflinePack_Private.h10
-rw-r--r--platform/darwin/src/MGLOfflineRegion_Private.h2
-rw-r--r--platform/darwin/src/MGLOfflineStorage.h46
-rw-r--r--platform/darwin/src/MGLOfflineStorage.mm12
-rw-r--r--platform/darwin/src/MGLOpenGLStyleLayer.mm44
-rw-r--r--platform/darwin/src/MGLOverlay.h8
-rw-r--r--platform/darwin/src/MGLPointAnnotation.h8
-rw-r--r--platform/darwin/src/MGLPointAnnotation.mm2
-rw-r--r--platform/darwin/src/MGLPointCollection.h10
-rw-r--r--platform/darwin/src/MGLPointCollection.mm4
-rw-r--r--platform/darwin/src/MGLPolygon+MGLAdditions.m6
-rw-r--r--platform/darwin/src/MGLPolygon.h24
-rw-r--r--platform/darwin/src/MGLPolygon.mm10
-rw-r--r--platform/darwin/src/MGLPolyline.h20
-rw-r--r--platform/darwin/src/MGLPolyline.mm12
-rw-r--r--platform/darwin/src/MGLRasterSource.h24
-rw-r--r--platform/darwin/src/MGLRasterSource.mm4
-rw-r--r--platform/darwin/src/MGLRasterStyleLayer.h34
-rw-r--r--platform/darwin/src/MGLRasterStyleLayer.mm4
-rw-r--r--platform/darwin/src/MGLShape.h28
-rw-r--r--platform/darwin/src/MGLShape.mm4
-rw-r--r--platform/darwin/src/MGLShapeCollection.h14
-rw-r--r--platform/darwin/src/MGLShapeCollection.mm2
-rw-r--r--platform/darwin/src/MGLShapeSource.h38
-rw-r--r--platform/darwin/src/MGLShapeSource.mm22
-rw-r--r--platform/darwin/src/MGLSource.h8
-rw-r--r--platform/darwin/src/MGLSource_Private.h14
-rw-r--r--platform/darwin/src/MGLStyle.h74
-rw-r--r--platform/darwin/src/MGLStyle.mm8
-rw-r--r--platform/darwin/src/MGLStyleLayer.h12
-rw-r--r--platform/darwin/src/MGLStyleLayer.h.ejs12
-rw-r--r--platform/darwin/src/MGLStyleLayer.mm2
-rw-r--r--platform/darwin/src/MGLStyleLayer.mm.ejs4
-rw-r--r--platform/darwin/src/MGLStyleLayer_Private.h4
-rw-r--r--platform/darwin/src/MGLStyleValue.h28
-rw-r--r--platform/darwin/src/MGLStyleValue_Private.h28
-rw-r--r--platform/darwin/src/MGLSymbolStyleLayer.h342
-rw-r--r--platform/darwin/src/MGLSymbolStyleLayer.mm4
-rw-r--r--platform/darwin/src/MGLTilePyramidOfflineRegion.h12
-rw-r--r--platform/darwin/src/MGLTilePyramidOfflineRegion.mm8
-rw-r--r--platform/darwin/src/MGLTileSource.h46
-rw-r--r--platform/darwin/src/MGLTileSource.mm14
-rw-r--r--platform/darwin/src/MGLTileSource_Private.h4
-rw-r--r--platform/darwin/src/MGLValueEvaluator.h14
-rw-r--r--platform/darwin/src/MGLVectorSource.h8
-rw-r--r--platform/darwin/src/MGLVectorSource.mm2
-rw-r--r--platform/darwin/src/MGLVectorStyleLayer.h40
-rw-r--r--platform/darwin/src/NSArray+MGLAdditions.mm6
-rw-r--r--platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm12
-rw-r--r--platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm10
-rw-r--r--platform/darwin/src/NSData+MGLAdditions.mm4
-rw-r--r--platform/darwin/src/NSExpression+MGLAdditions.mm4
-rw-r--r--platform/darwin/src/NSPredicate+MGLAdditions.mm48
-rw-r--r--platform/darwin/src/NSString+MGLAdditions.h2
-rw-r--r--platform/darwin/src/NSString+MGLAdditions.m2
-rw-r--r--platform/darwin/src/NSValue+MGLAdditions.h8
-rw-r--r--platform/darwin/src/http_file_source.mm22
91 files changed, 878 insertions, 878 deletions
diff --git a/platform/darwin/src/MGLAccountManager.h b/platform/darwin/src/MGLAccountManager.h
index c1aebd879c..741cc323cb 100644
--- a/platform/darwin/src/MGLAccountManager.h
+++ b/platform/darwin/src/MGLAccountManager.h
@@ -17,17 +17,17 @@ MGL_EXPORT
Set the
<a href="https://www.mapbox.com/help/define-access-token/">Mapbox access token</a>
to be used by all instances of MGLMapView in the current application.
-
+
Mapbox-hosted vector tiles and styles require an API access token, which you
can obtain from the
<a href="https://www.mapbox.com/studio/account/tokens/">Mapbox account page</a>.
Access tokens associate requests to Mapbox’s vector tile and style APIs with
your Mapbox account. They also deter other developers from using your styles
without your permission.
-
+
@param accessToken A Mapbox access token. Calling this method with a value of
`nil` has no effect.
-
+
@note You must set the access token before attempting to load any Mapbox-hosted
style. Therefore, you should generally set it before creating an instance of
MGLMapView. The recommended way to set an access token is to add an entry to
diff --git a/platform/darwin/src/MGLAccountManager.m b/platform/darwin/src/MGLAccountManager.m
index 31baf4e249..0f5d033031 100644
--- a/platform/darwin/src/MGLAccountManager.m
+++ b/platform/darwin/src/MGLAccountManager.m
@@ -65,7 +65,7 @@
if (!accessToken.length) {
return;
}
-
+
[MGLAccountManager sharedManager].accessToken = accessToken;
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
diff --git a/platform/darwin/src/MGLAnnotation.h b/platform/darwin/src/MGLAnnotation.h
index 4c8f600240..a0a58e83a6 100644
--- a/platform/darwin/src/MGLAnnotation.h
+++ b/platform/darwin/src/MGLAnnotation.h
@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
the visual representation of the annotation but typically coordinate (in
conjunction with the map view’s delegate) the creation of an appropriate
objects to handle the display.
-
+
An object that adopts this protocol must implement the `coordinate` property.
The other methods of this protocol are optional.
*/
@@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The string containing the annotation’s title.
-
+
Although this property is optional, if you support the selection of annotations
in your map view, you are expected to provide this property. This string is
displayed in the callout for the associated annotation.
@@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The string containing the annotation’s subtitle.
-
+
This string is displayed in the callout for the associated annotation.
*/
@property (nonatomic, readonly, copy, nullable) NSString *subtitle;
diff --git a/platform/darwin/src/MGLAttributionInfo.h b/platform/darwin/src/MGLAttributionInfo.h
index c4e037059e..031a10060f 100644
--- a/platform/darwin/src/MGLAttributionInfo.h
+++ b/platform/darwin/src/MGLAttributionInfo.h
@@ -16,7 +16,7 @@ MGL_EXPORT
/**
Returns an initialized attribution info object with the given title and URL.
-
+
@param title The attribution statement’s title.
@param URL A URL to more information about the entity named in the attribution.
@return An initialized attribution info object.
@@ -30,7 +30,7 @@ MGL_EXPORT
/**
The URL to more information about the entity named in the attribution.
-
+
If this property is set, the attribution statement should be displayed as a
hyperlink or action button. Otherwise, if it is `nil`, the attribution
statement should be displayed as plain text.
@@ -40,7 +40,7 @@ MGL_EXPORT
/**
A Boolean value indicating whether the attribution statement is a shortcut to a
feedback tool.
-
+
If this property is set, the statement should be treated as a way for the user
to provide feedback rather than an attribution statement.
*/
@@ -49,7 +49,7 @@ MGL_EXPORT
/**
Returns a copy of the `URL` property modified to account for the given center
coordinate and zoom level.
-
+
@param centerCoordinate The map’s center coordinate.
@param zoomLevel The map’s zoom level. See the `MGLMapView.zoomLevel` property
for more information.
diff --git a/platform/darwin/src/MGLAttributionInfo.mm b/platform/darwin/src/MGLAttributionInfo.mm
index 2546808b34..fa2ae787a5 100644
--- a/platform/darwin/src/MGLAttributionInfo.mm
+++ b/platform/darwin/src/MGLAttributionInfo.mm
@@ -18,7 +18,7 @@
if (!htmlString) {
return @[];
}
-
+
NSDictionary *options = @{
NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding),
@@ -56,7 +56,7 @@
}
NSString *styledHTML = [NSString stringWithFormat:@"<style type='text/css'>%@</style>%@", css, htmlString];
NSData *htmlData = [styledHTML dataUsingEncoding:NSUTF8StringEncoding];
-
+
#if TARGET_OS_IPHONE
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithData:htmlData
options:options
@@ -67,7 +67,7 @@
options:options
documentAttributes:nil];
#endif
-
+
NSMutableArray *infos = [NSMutableArray array];
[attributedString enumerateAttribute:NSLinkAttributeName
inRange:attributedString.mgl_wholeRange
@@ -75,7 +75,7 @@
usingBlock:
^(id _Nullable value, NSRange range, BOOL * _Nonnull stop) {
NSCAssert(!value || [value isKindOfClass:[NSURL class]], @"If present, URL attribute must be an NSURL.");
-
+
// Detect feedback links by the bogus style rule applied above.
NSNumber *strokeWidth = [attributedString attribute:NSStrokeWidthAttributeName
atIndex:range.location
@@ -85,14 +85,14 @@
isFeedbackLink = YES;
[attributedString removeAttribute:NSStrokeWidthAttributeName range:range];
}
-
+
// Omit whitespace-only strings.
NSAttributedString *title = [[attributedString attributedSubstringFromRange:range]
mgl_attributedStringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (!title.length) {
return;
}
-
+
MGLAttributionInfo *info = [[MGLAttributionInfo alloc] initWithTitle:title URL:value];
info.feedbackLink = isFeedbackLink;
[infos addObject:info];
@@ -124,7 +124,7 @@
if (!self.feedbackLink) {
return nil;
}
-
+
NSURLComponents *components = [NSURLComponents componentsWithURL:self.URL resolvingAgainstBaseURL:NO];
components.fragment = [NSString stringWithFormat:@"/%.5f/%.5f/%i",
centerCoordinate.longitude, centerCoordinate.latitude, (int)round(zoomLevel + 1)];
@@ -142,7 +142,7 @@
/**
Returns whether the given attribution info object overlaps with the receiver by
its plain text title.
-
+
@return `NSOrderedAscending` if the given object is a superset of the receiver,
`NSOrderedDescending` if it is a subset of the receiver, or `NSOrderedSame`
if there is no overlap.
@@ -179,14 +179,14 @@
didInsertInfo = YES;
}
break;
-
+
case NSOrderedAscending:
// The info object we’re adding is a subset of the existing one.
// Don’t add the object and stop looking.
shouldAddInfo = NO;
*stop = YES;
break;
-
+
default:
break;
}
diff --git a/platform/darwin/src/MGLAttributionInfo_Private.h b/platform/darwin/src/MGLAttributionInfo_Private.h
index c9a428b571..4b28fa5266 100644
--- a/platform/darwin/src/MGLAttributionInfo_Private.h
+++ b/platform/darwin/src/MGLAttributionInfo_Private.h
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Parses and returns the attribution infos contained in the given HTML source
code string.
-
+
@param htmlString The HTML source code to parse.
@param fontSize The default text size in points.
@param linkColor The default link color.
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
Adds the given attribution info object to the receiver as long as it isn’t
redundant to any object already in the receiver. Any existing object that is
redundant to the given object is replaced by the given object.
-
+
@param info The info object to add to the receiver.
@return True if the given info object was added to the receiver.
*/
@@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
Adds each of the given attribution info objects to the receiver as long as it
isn’t redundant to any object already in the receiver. Any existing object that
is redundant to the given object is replaced by the given object.
-
+
@param infos An array of info objects to add to the receiver.
*/
- (void)growArrayByAddingAttributionInfosFromArray:(NS_ARRAY_OF(MGLAttributionInfo *) *)infos;
diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.h b/platform/darwin/src/MGLBackgroundStyleLayer.h
index 06d7c9ee08..60090ebfef 100644
--- a/platform/darwin/src/MGLBackgroundStyleLayer.h
+++ b/platform/darwin/src/MGLBackgroundStyleLayer.h
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLFoundation.h"
@@ -13,11 +13,11 @@ NS_ASSUME_NONNULL_BEGIN
map content. If the style’s other layers use the Mapbox Streets source, the
background style layer is responsible for drawing land, whereas the oceans and
other bodies of water are drawn by `MGLFillStyleLayer` objects.
-
+
A background style layer is typically the bottommost layer in a style, because
it covers the entire map and can occlude any layers below it. You can therefore
access it by getting the last item in the `MGLStyle.layers` array.
-
+
If the background style layer is transparent or omitted from the style, any
portion of the map view that does not show another style layer is transparent.
*/
@@ -31,11 +31,11 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The color with which the background will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing
`UIColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `backgroundPattern` is set to
`nil`. Otherwise, it is ignored.
*/
@@ -43,11 +43,11 @@ MGL_EXPORT
#else
/**
The color with which the background will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing
`NSColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `backgroundPattern` is set to
`nil`. Otherwise, it is ignored.
*/
@@ -56,7 +56,7 @@ MGL_EXPORT
/**
The opacity at which the background will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.mm b/platform/darwin/src/MGLBackgroundStyleLayer.mm
index caf8ca9681..9c359c2db6 100644
--- a/platform/darwin/src/MGLBackgroundStyleLayer.mm
+++ b/platform/darwin/src/MGLBackgroundStyleLayer.mm
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h
index 8d8c4588e7..5f6fa313fb 100644
--- a/platform/darwin/src/MGLCircleStyleLayer.h
+++ b/platform/darwin/src/MGLCircleStyleLayer.h
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLFoundation.h"
@@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Controls the scaling behavior of the circle when the map is pitched.
-
+
Values of this type are used in the `MGLCircleStyleLayer.circleScaleAlignment`
property.
*/
@@ -26,7 +26,7 @@ typedef NS_ENUM(NSUInteger, MGLCircleScaleAlignment) {
/**
Controls the translation reference point.
-
+
Values of this type are used in the `MGLCircleStyleLayer.circleTranslationAnchor`
property.
*/
@@ -44,25 +44,25 @@ typedef NS_ENUM(NSUInteger, MGLCircleTranslationAnchor) {
/**
An `MGLCircleStyleLayer` is a style layer that renders one or more filled
circles on the map.
-
+
Use a circle style layer to configure the visual appearance of point or point
collection features in vector tiles loaded by an `MGLVectorSource` object or
`MGLPointAnnotation`, `MGLPointFeature`, `MGLPointCollection`, or
`MGLPointCollectionFeature` instances in an `MGLShapeSource` object.
-
+
A circle style layer renders circles whose radii are measured in screen units.
To display circles on the map whose radii correspond to real-world distances,
use many-sided regular polygons and configure their appearance using an
`MGLFillStyleLayer` object.
-
+
You can access an existing circle style layer using the
`-[MGLStyle layerWithIdentifier:]` method if you know its identifier;
otherwise, find it using the `MGLStyle.layers` property. You can also create a
new circle style layer and add it to the style using a method such as
`-[MGLStyle addLayer:]`.
-
+
### Example
-
+
```swift
let layer = MGLCircleStyleLayer(identifier: "circles", source: population)
layer.sourceLayerIdentifier = "population"
@@ -84,7 +84,7 @@ MGL_EXPORT
/**
Amount to blur the circle. 1 blurs the circle such that only the centerpoint is
full opacity.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
@@ -94,7 +94,7 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The fill color of the circle.
-
+
The default value of this property is an `MGLStyleValue` object containing
`UIColor.blackColor`. Set this property to `nil` to reset it to the default
value.
@@ -103,7 +103,7 @@ MGL_EXPORT
#else
/**
The fill color of the circle.
-
+
The default value of this property is an `MGLStyleValue` object containing
`NSColor.blackColor`. Set this property to `nil` to reset it to the default
value.
@@ -113,7 +113,7 @@ MGL_EXPORT
/**
The opacity at which the circle will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
@@ -122,9 +122,9 @@ MGL_EXPORT
/**
Circle radius.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `5`. Set this property to `nil` to reset
it to the default value.
@@ -133,11 +133,11 @@ MGL_EXPORT
/**
Controls the scaling behavior of the circle when the map is pitched.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLCircleScaleAlignmentMap`. Set this property to
`nil` to reset it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-circle-pitch-scale"><code>circle-pitch-scale</code></a>
layout property in the Mapbox Style Specification.
@@ -149,7 +149,7 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The stroke color of the circle.
-
+
The default value of this property is an `MGLStyleValue` object containing
`UIColor.blackColor`. Set this property to `nil` to reset it to the default
value.
@@ -158,7 +158,7 @@ MGL_EXPORT
#else
/**
The stroke color of the circle.
-
+
The default value of this property is an `MGLStyleValue` object containing
`NSColor.blackColor`. Set this property to `nil` to reset it to the default
value.
@@ -168,7 +168,7 @@ MGL_EXPORT
/**
The opacity of the circle's stroke.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
@@ -178,9 +178,9 @@ MGL_EXPORT
/**
The width of the circle's stroke. Strokes are placed outside of the
"circle-radius".
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
@@ -190,13 +190,13 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The geometry's offset.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points downward. Set this property to `nil` to reset it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-circle-translate"><code>circle-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -205,13 +205,13 @@ MGL_EXPORT
#else
/**
The geometry's offset.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points upward. Set this property to `nil` to reset it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-circle-translate"><code>circle-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -223,14 +223,14 @@ MGL_EXPORT
/**
Controls the translation reference point.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLCircleTranslationAnchorMap`. Set this property
to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `circleTranslation` is non-`nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-circle-translate-anchor"><code>circle-translate-anchor</code></a>
layout property in the Mapbox Style Specification.
diff --git a/platform/darwin/src/MGLCircleStyleLayer.mm b/platform/darwin/src/MGLCircleStyleLayer.mm
index adc5ed8dd3..4a639db995 100644
--- a/platform/darwin/src/MGLCircleStyleLayer.mm
+++ b/platform/darwin/src/MGLCircleStyleLayer.mm
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
@@ -59,7 +59,7 @@ namespace mbgl {
- (NSString *)sourceIdentifier
{
MGLAssertStyleLayerIsValid();
-
+
return @(self.rawLayer->getSourceID().c_str());
}
diff --git a/platform/darwin/src/MGLClockDirectionFormatter.h b/platform/darwin/src/MGLClockDirectionFormatter.h
index a428f51c63..86a9452846 100644
--- a/platform/darwin/src/MGLClockDirectionFormatter.h
+++ b/platform/darwin/src/MGLClockDirectionFormatter.h
@@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
of headings relative to the user, known as <i>clock positions</i>. For
example, a value of `90` may be formatted as “3 o’clock”, depending on the
locale.
-
+
Use this class to create localized heading strings when displaying directions
relative to the user’s current location and heading. To format a direction
irrespective of the user’s orientation, use `MGLCompassDirectionFormatter`
@@ -21,14 +21,14 @@ MGL_EXPORT
/**
The unit style used by this formatter.
-
+
This property defaults to `NSFormattingUnitStyleMedium`.
*/
@property (nonatomic) NSFormattingUnitStyle unitStyle;
/**
Returns a clock position string for the provided value.
-
+
@param direction The heading, measured in degrees, where 0° means “straight
ahead” and 90° means “directly to your right”.
@return The clock position string appropriately formatted for the receiver’s
diff --git a/platform/darwin/src/MGLClockDirectionFormatter.m b/platform/darwin/src/MGLClockDirectionFormatter.m
index fd67968e65..62a0ea995d 100644
--- a/platform/darwin/src/MGLClockDirectionFormatter.m
+++ b/platform/darwin/src/MGLClockDirectionFormatter.m
@@ -28,16 +28,16 @@
case NSFormattingUnitStyleShort:
format = NSLocalizedStringWithDefaultValue(@"CLOCK_FMT_SHORT", @"Foundation", nil, @"%@:00", @"Clock position format, short: {hours}:00");
break;
-
+
case NSFormattingUnitStyleMedium:
format = NSLocalizedStringWithDefaultValue(@"CLOCK_FMT_MEDIUM", @"Foundation", nil, @"%@ o’clock", @"Clock position format, medium: {hours} o’clock");
-
+
break;
-
+
case NSFormattingUnitStyleLong:
format = NSLocalizedStringWithDefaultValue(@"CLOCK_FMT_LONG", @"Foundation", nil, @"%@ o’clock", @"Clock position format, long: {hours} o’clock");
break;
-
+
default:
break;
}
diff --git a/platform/darwin/src/MGLCompassDirectionFormatter.h b/platform/darwin/src/MGLCompassDirectionFormatter.h
index 714e1cc035..b4a3087509 100644
--- a/platform/darwin/src/MGLCompassDirectionFormatter.h
+++ b/platform/darwin/src/MGLCompassDirectionFormatter.h
@@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
The `MGLCompassDirectionFormatter` class provides properly formatted
descriptions of absolute headings. For example, a value of `90` may be
formatted as “east”, depending on the locale.
-
+
Use this class to create localized heading strings when displaying directions
irrespective of the user’s current location. To format a direction relative to
the user’s current location, use `MGLClockDirectionFormatter` instead.
@@ -19,14 +19,14 @@ MGL_EXPORT
/**
The unit style used by this formatter.
-
+
This property defaults to `NSFormattingUnitStyleMedium`.
*/
@property (nonatomic) NSFormattingUnitStyle unitStyle;
/**
Returns a heading string for the provided value.
-
+
@param direction The heading, measured in degrees, where 0° means “due north”
and 90° means “due east”.
@return The heading string appropriately formatted for the formatter’s locale.
diff --git a/platform/darwin/src/MGLCompassDirectionFormatter.m b/platform/darwin/src/MGLCompassDirectionFormatter.m
index c46fe9e4d5..5f0cfae6f7 100644
--- a/platform/darwin/src/MGLCompassDirectionFormatter.m
+++ b/platform/darwin/src/MGLCompassDirectionFormatter.m
@@ -28,7 +28,7 @@
NSLocalizedStringWithDefaultValue(@"COMPASS_NEbE_SHORT", @"Foundation", nil, @"NEbE", @"Northeast by east, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_ENE_SHORT", @"Foundation", nil, @"ENE", @"East-northeast, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_EbN_SHORT", @"Foundation", nil, @"EbN", @"East by north, short"),
-
+
NSLocalizedStringWithDefaultValue(@"COMPASS_E_SHORT", @"Foundation", nil, @"E", @"East, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_EbS_SHORT", @"Foundation", nil, @"EbS", @"East by south, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_ESE_SHORT", @"Foundation", nil, @"ESE", @"East-southeast, short"),
@@ -37,7 +37,7 @@
NSLocalizedStringWithDefaultValue(@"COMPASS_SEbS_SHORT", @"Foundation", nil, @"SEbS", @"Southeast by south, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_SSE_SHORT", @"Foundation", nil, @"SSE", @"South-southeast, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_SbE_SHORT", @"Foundation", nil, @"SbE", @"South by east, short"),
-
+
NSLocalizedStringWithDefaultValue(@"COMPASS_S_SHORT", @"Foundation", nil, @"S", @"South, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_SbW_SHORT", @"Foundation", nil, @"SbW", @"South by west, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_SSW_SHORT", @"Foundation", nil, @"SSW", @"South-southwest, short"),
@@ -46,7 +46,7 @@
NSLocalizedStringWithDefaultValue(@"COMPASS_SWbW_SHORT", @"Foundation", nil, @"SWbW", @"Southwest by west, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_WSW_SHORT", @"Foundation", nil, @"WSW", @"West-southwest, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_WbS_SHORT", @"Foundation", nil, @"WbS", @"West by south, short"),
-
+
NSLocalizedStringWithDefaultValue(@"COMPASS_W_SHORT", @"Foundation", nil, @"W", @"West, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_WbN_SHORT", @"Foundation", nil, @"WbN", @"West by north, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_WNW_SHORT", @"Foundation", nil, @"WNW", @"West-northwest, short"),
@@ -56,7 +56,7 @@
NSLocalizedStringWithDefaultValue(@"COMPASS_NNW_SHORT", @"Foundation", nil, @"NNW", @"North-northwest, short"),
NSLocalizedStringWithDefaultValue(@"COMPASS_NbW_SHORT", @"Foundation", nil, @"NbW", @"North by west, short"),
];
-
+
longStrings = @[
NSLocalizedStringWithDefaultValue(@"COMPASS_N_LONG", @"Foundation", nil, @"north", @"North, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_NbE_LONG", @"Foundation", nil, @"north by east", @"North by east, long"),
@@ -66,7 +66,7 @@
NSLocalizedStringWithDefaultValue(@"COMPASS_NEbE_LONG", @"Foundation", nil, @"northeast by east", @"Northeast by east, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_ENE_LONG", @"Foundation", nil, @"east-northeast", @"East-northeast, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_EbN_LONG", @"Foundation", nil, @"east by north", @"East by north, long"),
-
+
NSLocalizedStringWithDefaultValue(@"COMPASS_E_LONG", @"Foundation", nil, @"east", @"East, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_EbS_LONG", @"Foundation", nil, @"east by south", @"East by south, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_ESE_LONG", @"Foundation", nil, @"east-southeast", @"East-southeast, long"),
@@ -75,7 +75,7 @@
NSLocalizedStringWithDefaultValue(@"COMPASS_SEbS_LONG", @"Foundation", nil, @"southeast by south", @"Southeast by south, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_SSE_LONG", @"Foundation", nil, @"south-southeast", @"South-southeast, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_SbE_LONG", @"Foundation", nil, @"south by east", @"South by east, long"),
-
+
NSLocalizedStringWithDefaultValue(@"COMPASS_S_LONG", @"Foundation", nil, @"south", @"South, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_SbW_LONG", @"Foundation", nil, @"south by west", @"South by west, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_SSW_LONG", @"Foundation", nil, @"south-southwest", @"South-southwest, long"),
@@ -84,7 +84,7 @@
NSLocalizedStringWithDefaultValue(@"COMPASS_SWbW_LONG", @"Foundation", nil, @"southwest by west", @"Southwest by west, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_WSW_LONG", @"Foundation", nil, @"west-southwest", @"West-southwest, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_WbS_LONG", @"Foundation", nil, @"west by south", @"West by south, long"),
-
+
NSLocalizedStringWithDefaultValue(@"COMPASS_W_LONG", @"Foundation", nil, @"west", @"West, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_WbN_LONG", @"Foundation", nil, @"west by north", @"West by north, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_WNW_LONG", @"Foundation", nil, @"west-northwest", @"West-northwest, long"),
@@ -94,15 +94,15 @@
NSLocalizedStringWithDefaultValue(@"COMPASS_NNW_LONG", @"Foundation", nil, @"north-northwest", @"North-northwest, long"),
NSLocalizedStringWithDefaultValue(@"COMPASS_NbW_LONG", @"Foundation", nil, @"north by west", @"North by west, long"),
];
-
+
NSAssert(shortStrings.count == longStrings.count, @"Long and short compass direction string arrays must have the same size.");
});
-
+
NSInteger cardinalPoint = wrap(round(wrap(direction, 0, 360) / 360 * shortStrings.count), 0, shortStrings.count);
switch (self.unitStyle) {
case NSFormattingUnitStyleShort:
return shortStrings[cardinalPoint];
-
+
case NSFormattingUnitStyleMedium:
case NSFormattingUnitStyleLong:
return longStrings[cardinalPoint];
diff --git a/platform/darwin/src/MGLCoordinateFormatter.h b/platform/darwin/src/MGLCoordinateFormatter.h
index c42c196d5a..63f0de8f19 100644
--- a/platform/darwin/src/MGLCoordinateFormatter.h
+++ b/platform/darwin/src/MGLCoordinateFormatter.h
@@ -15,7 +15,7 @@ MGL_EXPORT
/**
Determines whether the output may contain minutes of arc when nonzero.
-
+
The default value of this property is `YES`, causing the receiver to include
minutes of arc in its output. If `allowsSeconds` is `YES`, this property is
ignored and the output always includes minutes of arc.
@@ -24,7 +24,7 @@ MGL_EXPORT
/**
Determines whether the output may contain seconds of arc when nonzero.
-
+
The default value of this property is `YES`, causing the receiver to include
seconds of arc in its output.
*/
@@ -32,14 +32,14 @@ MGL_EXPORT
/**
The unit style used by this formatter.
-
+
The default value of this property is `NSFormattingUnitStyleMedium`.
*/
@property (nonatomic) NSFormattingUnitStyle unitStyle;
/**
Returns a coordinate string for the provided value.
-
+
@param coordinate The coordinate’s value.
@return The coordinate string appropriately formatted for the formatter’s
locale.
diff --git a/platform/darwin/src/MGLCoordinateFormatter.m b/platform/darwin/src/MGLCoordinateFormatter.m
index 682f771faa..fb577d3be3 100644
--- a/platform/darwin/src/MGLCoordinateFormatter.m
+++ b/platform/darwin/src/MGLCoordinateFormatter.m
@@ -28,7 +28,7 @@
negativeLongitudeFormat = NSLocalizedStringWithDefaultValue(@"COORD_W_SHORT", @"Foundation", nil, @"%@W", @"West longitude format, short: {longitude}");
stringFormat = NSLocalizedStringWithDefaultValue(@"COORD_FMT_SHORT", @"Foundation", nil, @"%@, %@", @"Coordinate pair format, short: {latitude}, {longitude}");
break;
-
+
case NSFormattingUnitStyleMedium:
positiveLatitudeFormat = NSLocalizedStringWithDefaultValue(@"COORD_N_MEDIUM", @"Foundation", nil, @"%@ north", @"North latitude format, medium: {latitude}");
negativeLatitudeFormat = NSLocalizedStringWithDefaultValue(@"COORD_S_MEDIUM", @"Foundation", nil, @"%@ south", @"South latitude format, medium: {latitude}");
@@ -36,7 +36,7 @@
negativeLongitudeFormat = NSLocalizedStringWithDefaultValue(@"COORD_W_MEDIUM", @"Foundation", nil, @"%@ west", @"West longitude format, medium: {longitude}");
stringFormat = NSLocalizedStringWithDefaultValue(@"COORD_FMT_MEDIUM", @"Foundation", nil, @"%@, %@", @"Coordinate pair format, medium: {latitude}, {longitude}");
break;
-
+
case NSFormattingUnitStyleLong:
positiveLatitudeFormat = NSLocalizedStringWithDefaultValue(@"COORD_N_LONG", @"Foundation", nil, @"%@ north", @"North latitude format, long: {latitude}");
negativeLatitudeFormat = NSLocalizedStringWithDefaultValue(@"COORD_S_LONG", @"Foundation", nil, @"%@ south", @"South latitude format, long: {latitude}");
@@ -57,7 +57,7 @@
- (NSString *)stringFromLocationDegrees:(CLLocationDegrees)degrees positiveFormat:(NSString *)positiveFormat negativeFormat:(NSString *)negativeFormat {
CLLocationDegrees minutes = (fabs(degrees) - floor(fabs(degrees))) * 60;
CLLocationDegrees seconds = (minutes - floor(minutes)) * 60;
-
+
NSString *degreesFormat;
NSString *minutesFormat;
NSString *secondsFormat;
@@ -71,7 +71,7 @@
degreesMinutesFormat = NSLocalizedStringWithDefaultValue(@"COORD_DM_SHORT", @"Foundation", nil, @"%@%@", @"Coordinate format, short: {degrees}{minutes}");
degreesMinutesSecondsFormat = NSLocalizedStringWithDefaultValue(@"COORD_DMS_SHORT", @"Foundation", nil, @"%@%@%@", @"Coordinate format, short: {degrees}{minutes}{seconds}");
break;
-
+
case NSFormattingUnitStyleMedium:
degreesFormat = NSLocalizedStringWithDefaultValue(@"COORD_DEG_MEDIUM", @"Foundation", nil, @"%d°", @"Degrees format, medium: {degrees}");
minutesFormat = NSLocalizedStringWithDefaultValue(@"COORD_MIN_MEDIUM", @"Foundation", nil, @"%d′", @"Minutes format, medium: {minutes}");
@@ -79,7 +79,7 @@
degreesMinutesFormat = NSLocalizedStringWithDefaultValue(@"COORD_DM_MEDIUM", @"Foundation", nil, @"%@%@", @"Coordinate format, medium: {degrees}{minutes}");
degreesMinutesSecondsFormat = NSLocalizedStringWithDefaultValue(@"COORD_DMS_MEDIUM", @"Foundation", nil, @"%@%@%@", @"Coordinate format, medium: {degrees}{minutes}{seconds}");
break;
-
+
case NSFormattingUnitStyleLong:
degreesFormat = NSLocalizedStringWithDefaultValue(@"COORD_DEG_LONG", @"Foundation", nil, @"%d degree(s)", @"Degrees format, long");
minutesFormat = NSLocalizedStringWithDefaultValue(@"COORD_MIN_LONG", @"Foundation", nil, @"%d minute(s)", @"Minutes format, long");
@@ -88,9 +88,9 @@
degreesMinutesSecondsFormat = NSLocalizedStringWithDefaultValue(@"COORD_DMS_LONG", @"Foundation", nil, @"%@, %@, and %@", @"Coordinate format, long: {degrees}{minutes}{seconds}");
break;
}
-
+
NSString *degreesString = [NSString stringWithFormat:degreesFormat, (int)floor(fabs(degrees))];
-
+
NSString *string;
if (trunc(seconds) > 0 && self.allowsSeconds) {
NSString *minutesString = [NSString stringWithFormat:minutesFormat, (int)floor(minutes)];
@@ -104,7 +104,7 @@
} else {
string = [NSString stringWithFormat:degreesFormat, (int)round(fabs(degrees))];
}
-
+
if (degrees == 0) {
return string;
}
diff --git a/platform/darwin/src/MGLFeature.h b/platform/darwin/src/MGLFeature.h
index 82dbb450cf..8ba5687480 100644
--- a/platform/darwin/src/MGLFeature.h
+++ b/platform/darwin/src/MGLFeature.h
@@ -14,14 +14,14 @@ NS_ASSUME_NONNULL_BEGIN
contained in an `MGLShapeSource` or `MGLVectorSource` object. Each concrete
subclass of `MGLShape` in turn has a subclass that conforms to this protocol. A
feature object associates a shape with an optional identifier and attributes.
-
+
You can add custom data to display on the map by creating feature objects and
adding them to an `MGLShapeSource` using the
`-[MGLShapeSource initWithIdentifier:shape:options:]` method or
`MGLShapeSource.shape` property. Similarly, you can add `MGLPointFeature`,
`MGLPolylineFeature`, and `MGLPolygonFeature` objects to the map as annotations
using `-[MGLMapView addAnnotations:]` and related methods.
-
+
In addition to adding data to the map, you can also extract data from the map:
`-[MGLMapView visibleFeaturesAtPoint:]` and related methods return feature
objects that correspond to features in the source. This enables you to inspect
@@ -33,12 +33,12 @@ NS_ASSUME_NONNULL_BEGIN
/**
An object that uniquely identifies the feature in its containing content
source.
-
+
You can configure an `MGLVectorStyleLayer` object to include or exclude a
specific feature in an `MGLShapeSource` or `MGLVectorSource`. In the
`MGLVectorStyleLayer.predicate` property, compare the special `$id` attribute
to the feature’s identifier.
-
+
In vector tiles loaded by `MGLVectorSource` objects, the identifier corresponds
to the
<a href="https://github.com/mapbox/vector-tile-spec/tree/master/2.1#42-features">feature identifier</a>
@@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
this property is `nil`. If specified, the identifier may be an integer,
floating-point number, or string. These data types are mapped to instances of
the following Foundation classes:
-
+
<table>
<thead>
<tr><th>In the tile source</th><th>This property</th></tr>
@@ -57,12 +57,12 @@ NS_ASSUME_NONNULL_BEGIN
<tr><td>String</td> <td><code>NSString</code></td></tr>
</tbody>
</table>
-
+
For details about the identifiers used in most Mapbox-provided styles, consult
the
<a href="https://www.mapbox.com/vector-tiles/mapbox-streets/">Mapbox Streets</a>
layer reference.
-
+
The identifier should be set before adding the feature to an `MGLShapeSource`
object; setting it afterwards has no effect on the map’s contents. While it is
possible to change this value on feature instances obtained from
@@ -73,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
A dictionary of attributes for this feature.
-
+
You can configure an `MGLVectorStyleLayer` object to include or exclude a
specific feature in an `MGLShapeSource` or `MGLVectorSource`. In the
`MGLVectorStyleLayer.predicate` property, compare a key of the attribute
@@ -82,20 +82,20 @@ NS_ASSUME_NONNULL_BEGIN
a value above 50 to the important features’ `importance` attribute, then set
`MGLVectorStyleLayer.predicate` to an `NSPredicate` with the format
`importance > 50`.
-
+
You can also configure some attributes of an `MGLSymbolStyleLayer` object to
include the value of an attribute in this dictionary whenever it renders this
feature. For example, to label features in an `MGLShapeSource` object by their
names, you can assign a `name` attribute to each of the source’s features, then
set `MGLSymbolStyleLayer.textField` to an `MGLStyleValue` object containing the
string `{name}`.
-
+
In vector tiles loaded by `MGLVectorSource` objects, the keys and values of
each feature’s attribute dictionary are determined by the source. Each
attribute name is a string, while each attribute value may be a null value,
Boolean value, integer, floating-point number, or string. These data types are
mapped to instances of the following Foundation classes:
-
+
<table>
<thead>
<tr><th>In the tile source</th><th>In this dictionary</th></tr>
@@ -108,14 +108,14 @@ NS_ASSUME_NONNULL_BEGIN
<tr><td>String</td> <td><code>NSString</code></td></tr>
</tbody>
</table>
-
+
For details about the attribute names and values found in Mapbox-provided
vector tile sources, consult the
<a href="https://www.mapbox.com/vector-tiles/mapbox-streets/">Mapbox Streets</a>
and
<a href="https://www.mapbox.com/vector-tiles/mapbox-terrain/">Mapbox Terrain</a>
layer references.
-
+
Note that while it is possible to change this value on feature
instances obtained from `-[MGLMapView visibleFeaturesAtPoint:]` and related
methods, there will be no effect on the map. Setting this value can be useful
@@ -126,7 +126,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Returns the feature attribute for the given attribute name.
-
+
See the `attributes` property’s documentation for details on keys and values
associated with this method.
*/
@@ -135,10 +135,10 @@ NS_ASSUME_NONNULL_BEGIN
/**
Returns a dictionary that can be serialized as a GeoJSON Feature representation
of an instance of an `MGLFeature` subclass.
-
- The dictionary includes a `geometry` key corresponding to the receiver’s
- underlying geometry data, a `properties` key corresponding to the receiver’s
- `attributes` property, and an `id` key corresponding to the receiver’s
+
+ The dictionary includes a `geometry` key corresponding to the receiver’s
+ underlying geometry data, a `properties` key corresponding to the receiver’s
+ `attributes` property, and an `id` key corresponding to the receiver’s
`identifier` property.
*/
- (NS_DICTIONARY_OF(NSString *, id) *)geoJSONDictionary;
@@ -156,7 +156,7 @@ MGL_EXPORT
/**
An `MGLPolylineFeature` object associates a polyline shape with an optional
identifier and attributes.
-
+
A polyline feature is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.4">LineString</a>
feature in GeoJSON.
@@ -176,7 +176,7 @@ MGL_EXPORT
/**
An `MGLPointCollectionFeature` object associates a point collection with an
optional identifier and attributes.
-
+
A point collection feature is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.3">MultiPoint</a>
feature in GeoJSON.
@@ -191,7 +191,7 @@ MGL_EXPORT
/**
An `MGLMultiPolylineFeature` object associates a multipolyline shape with an
optional identifier and attributes.
-
+
A multipolyline feature is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.5">MultiLineString</a>
feature in GeoJSON.
@@ -211,7 +211,7 @@ MGL_EXPORT
/**
An `MGLShapeCollectionFeature` object associates a shape collection with an
optional identifier and attributes.
-
+
A shape collection feature is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.3">feature collection</a>
in GeoJSON.
diff --git a/platform/darwin/src/MGLFeature.mm b/platform/darwin/src/MGLFeature.mm
index 3bd7eae535..e169ee19bb 100644
--- a/platform/darwin/src/MGLFeature.mm
+++ b/platform/darwin/src/MGLFeature.mm
@@ -225,21 +225,21 @@ public:
feature.coordinate = toLocationCoordinate2D(geometry);
return feature;
}
-
+
MGLShape <MGLFeature> * operator()(const mbgl::LineString<T> &geometry) const {
std::vector<CLLocationCoordinate2D> coordinates = toLocationCoordinates2D(geometry);
return [MGLPolylineFeature polylineWithCoordinates:&coordinates[0] count:coordinates.size()];
}
-
+
MGLShape <MGLFeature> * operator()(const mbgl::Polygon<T> &geometry) const {
return toShape<MGLPolygonFeature>(geometry);
}
-
+
MGLShape <MGLFeature> * operator()(const mbgl::MultiPoint<T> &geometry) const {
std::vector<CLLocationCoordinate2D> coordinates = toLocationCoordinates2D(geometry);
return [[MGLPointCollectionFeature alloc] initWithCoordinates:&coordinates[0] count:coordinates.size()];
}
-
+
MGLShape <MGLFeature> * operator()(const mbgl::MultiLineString<T> &geometry) const {
NSMutableArray *polylines = [NSMutableArray arrayWithCapacity:geometry.size()];
for (auto &lineString : geometry) {
@@ -247,19 +247,19 @@ public:
MGLPolyline *polyline = [MGLPolyline polylineWithCoordinates:&coordinates[0] count:coordinates.size()];
[polylines addObject:polyline];
}
-
+
return [MGLMultiPolylineFeature multiPolylineWithPolylines:polylines];
}
-
+
MGLShape <MGLFeature> * operator()(const mbgl::MultiPolygon<T> &geometry) const {
NSMutableArray *polygons = [NSMutableArray arrayWithCapacity:geometry.size()];
for (auto &polygon : geometry) {
[polygons addObject:toShape(polygon)];
}
-
+
return [MGLMultiPolygonFeature multiPolygonWithPolygons:polygons];
}
-
+
MGLShape <MGLFeature> * operator()(const mapbox::geometry::geometry_collection<T> &collection) const {
NSMutableArray *shapes = [NSMutableArray arrayWithCapacity:collection.size()];
for (auto &geometry : collection) {
@@ -269,19 +269,19 @@ public:
}
return [MGLShapeCollectionFeature shapeCollectionWithShapes:shapes];
}
-
+
private:
static CLLocationCoordinate2D toLocationCoordinate2D(const mbgl::Point<T> &point) {
return CLLocationCoordinate2DMake(point.y, point.x);
}
-
+
static std::vector<CLLocationCoordinate2D> toLocationCoordinates2D(const std::vector<mbgl::Point<T>> &points) {
std::vector<CLLocationCoordinate2D> coordinates;
coordinates.reserve(points.size());
std::transform(points.begin(), points.end(), std::back_inserter(coordinates), toLocationCoordinate2D);
return coordinates;
}
-
+
template<typename U = MGLPolygon>
static U *toShape(const mbgl::Polygon<T> &geometry) {
auto &linearRing = geometry.front();
@@ -296,7 +296,7 @@ private:
[innerPolygons addObject:innerPolygon];
}
}
-
+
return [U polygonWithCoordinates:&coordinates[0] count:coordinates.size() interiorPolygons:innerPolygons];
}
};
@@ -309,12 +309,12 @@ public:
MGLShape <MGLFeature> *shape = mapbox::geometry::geometry<T>::visit(geometry, evaluator);
return shape;
}
-
+
MGLShape <MGLFeature> * operator()(const mbgl::Feature &feature) const {
MGLShape <MGLFeature> *shape = (MGLShape <MGLFeature> *)MGLFeatureFromMBGLFeature(feature);
return shape;
}
-
+
MGLShape <MGLFeature> * operator()(const mbgl::FeatureCollection &collection) const {
NSMutableArray *shapes = [NSMutableArray arrayWithCapacity:collection.size()];
for (const auto &feature : collection) {
@@ -345,7 +345,7 @@ id <MGLFeature> MGLFeatureFromMBGLFeature(const mbgl::Feature &feature) {
shape.identifier = mbgl::FeatureIdentifier::visit(*feature.id, ValueEvaluator());
}
shape.attributes = attributes;
-
+
return shape;
}
diff --git a/platform/darwin/src/MGLFeature_Private.h b/platform/darwin/src/MGLFeature_Private.h
index 6751b3196a..4137200b98 100644
--- a/platform/darwin/src/MGLFeature_Private.h
+++ b/platform/darwin/src/MGLFeature_Private.h
@@ -28,7 +28,7 @@ MGLShape* MGLShapeFromGeoJSON(const mapbox::geojson::geojson &geojson);
/**
Takes an `mbgl::Feature` object, an identifer, and attributes dictionary and
- returns the feature object with converted `mbgl::FeatureIdentifier` and
+ returns the feature object with converted `mbgl::FeatureIdentifier` and
`mbgl::PropertyMap` properties.
*/
mbgl::Feature mbglFeature(mbgl::Feature feature, id identifier, NSDictionary *attributes);
diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h
index 2ab02acf5a..f4ba7a0098 100644
--- a/platform/darwin/src/MGLFillStyleLayer.h
+++ b/platform/darwin/src/MGLFillStyleLayer.h
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLFoundation.h"
@@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Controls the translation reference point.
-
+
Values of this type are used in the `MGLFillStyleLayer.fillTranslationAnchor`
property.
*/
@@ -27,20 +27,20 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) {
/**
An `MGLFillStyleLayer` is a style layer that renders one or more filled (and
optionally stroked) polygons on the map.
-
+
Use a fill style layer to configure the visual appearance of polygon or
multipolygon features in vector tiles loaded by an `MGLVectorSource` object or
`MGLPolygon`, `MGLPolygonFeature`, `MGLMultiPolygon`, or
`MGLMultiPolygonFeature` instances in an `MGLShapeSource` object.
-
+
You can access an existing fill style layer using the
`-[MGLStyle layerWithIdentifier:]` method if you know its identifier;
otherwise, find it using the `MGLStyle.layers` property. You can also create a
new fill style layer and add it to the style using a method such as
`-[MGLStyle addLayer:]`.
-
+
### Example
-
+
```swift
let layer = MGLFillStyleLayer(identifier: "parks", source: parks)
layer.sourceLayerIdentifier = "parks"
@@ -56,11 +56,11 @@ MGL_EXPORT
/**
Whether or not the fill should be antialiased.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `YES`. Set this property to `nil` to reset it to
the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-fill-antialias"><code>fill-antialias</code></a>
layout property in the Mapbox Style Specification.
@@ -72,11 +72,11 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The color of the filled part of this layer.
-
+
The default value of this property is an `MGLStyleValue` object containing
`UIColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `fillPattern` is set to `nil`.
Otherwise, it is ignored.
*/
@@ -84,11 +84,11 @@ MGL_EXPORT
#else
/**
The color of the filled part of this layer.
-
+
The default value of this property is an `MGLStyleValue` object containing
`NSColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `fillPattern` is set to `nil`.
Otherwise, it is ignored.
*/
@@ -98,7 +98,7 @@ MGL_EXPORT
/**
The opacity of the entire fill layer. In contrast to the `fillColor`, this
value will also affect the 1pt stroke around the fill, if the stroke is used.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
@@ -108,7 +108,7 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The outline color of the fill. Matches the value of `fillColor` if unspecified.
-
+
This property is only applied to the style if `fillPattern` is set to `nil`,
and `fillAntialiased` is set to an `MGLStyleValue` object containing an
`NSNumber` object containing `YES`. Otherwise, it is ignored.
@@ -117,7 +117,7 @@ MGL_EXPORT
#else
/**
The outline color of the fill. Matches the value of `fillColor` if unspecified.
-
+
This property is only applied to the style if `fillPattern` is set to `nil`,
and `fillAntialiased` is set to an `MGLStyleValue` object containing an
`NSNumber` object containing `YES`. Otherwise, it is ignored.
@@ -134,13 +134,13 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The geometry's offset.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points downward. Set this property to `nil` to reset it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-fill-translate"><code>fill-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -149,13 +149,13 @@ MGL_EXPORT
#else
/**
The geometry's offset.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points upward. Set this property to `nil` to reset it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-fill-translate"><code>fill-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -167,14 +167,14 @@ MGL_EXPORT
/**
Controls the translation reference point.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLFillTranslationAnchorMap`. Set this property to
`nil` to reset it to the default value.
-
+
This property is only applied to the style if `fillTranslation` is non-`nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-fill-translate-anchor"><code>fill-translate-anchor</code></a>
layout property in the Mapbox Style Specification.
diff --git a/platform/darwin/src/MGLFillStyleLayer.mm b/platform/darwin/src/MGLFillStyleLayer.mm
index 63a482ac2e..57014e6f60 100644
--- a/platform/darwin/src/MGLFillStyleLayer.mm
+++ b/platform/darwin/src/MGLFillStyleLayer.mm
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
@@ -54,7 +54,7 @@ namespace mbgl {
- (NSString *)sourceIdentifier
{
MGLAssertStyleLayerIsValid();
-
+
return @(self.rawLayer->getSourceID().c_str());
}
diff --git a/platform/darwin/src/MGLForegroundStyleLayer.h b/platform/darwin/src/MGLForegroundStyleLayer.h
index 474e1f6307..87763f4634 100644
--- a/platform/darwin/src/MGLForegroundStyleLayer.h
+++ b/platform/darwin/src/MGLForegroundStyleLayer.h
@@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
`MGLForegroundStyleLayer` is an abstract superclass for style layers whose
content is defined by an `MGLSource` object.
-
+
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of `MGLRasterStyleLayer`
and the concrete subclasses of `MGLVectorStyleLayer`.
@@ -25,11 +25,11 @@ MGL_EXPORT
/**
Returns a foreground style layer initialized with an identifier and source.
-
+
After initializing and configuring the style layer, add it to a map view’s
style using the `-[MGLStyle addLayer:]` or
`-[MGLStyle insertLayer:belowLayer:]` method.
-
+
@param identifier A string that uniquely identifies the source in the style to
which it is added.
@param source The source from which to obtain the data to style. If the source
diff --git a/platform/darwin/src/MGLGeometry.h b/platform/darwin/src/MGLGeometry.h
index 408bdb2632..9fcb9dd37c 100644
--- a/platform/darwin/src/MGLGeometry.h
+++ b/platform/darwin/src/MGLGeometry.h
@@ -101,7 +101,7 @@ NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsOffset(MGLCoordinateBounds boun
/**
Returns `YES` if the coordinate bounds covers no area.
-
+
@note A bounds may be empty but have a non-zero coordinate span (e.g., when its
northeast point lies due north of its southwest point).
*/
diff --git a/platform/darwin/src/MGLGeometry.mm b/platform/darwin/src/MGLGeometry.mm
index 36e096dd03..8c0c5f9cb7 100644
--- a/platform/darwin/src/MGLGeometry.mm
+++ b/platform/darwin/src/MGLGeometry.mm
@@ -6,7 +6,7 @@
/** Vertical field of view, measured in degrees, for determining the altitude
of the viewpoint.
-
+
TransformState::getProjMatrix() has a variable vertical field of view that
defaults to 2 arctan ⅓ rad ≈ 36.9° but MapKit uses a vertical field of view of 30°.
flyTo() assumes a field of view of 2 arctan ½ rad. */
diff --git a/platform/darwin/src/MGLGeometry_Private.h b/platform/darwin/src/MGLGeometry_Private.h
index fc57460128..e6b37b3530 100644
--- a/platform/darwin/src/MGLGeometry_Private.h
+++ b/platform/darwin/src/MGLGeometry_Private.h
@@ -45,7 +45,7 @@ NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(NSEdgeInsets insets) {
#endif
/** Converts a map zoom level to a camera altitude.
-
+
@param zoomLevel The zoom level to convert.
@param pitch The camera pitch, measured in degrees.
@param latitude The latitude of the point at the center of the viewport.
@@ -54,7 +54,7 @@ NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(NSEdgeInsets insets) {
CLLocationDistance MGLAltitudeForZoomLevel(double zoomLevel, CGFloat pitch, CLLocationDegrees latitude, CGSize size);
/** Converts a camera altitude to a map zoom level.
-
+
@param altitude The altitude to convert, measured in meters.
@param pitch The camera pitch, measured in degrees.
@param latitude The latitude of the point at the center of the viewport.
diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h
index 98f2778291..d8c8f6a466 100644
--- a/platform/darwin/src/MGLLineStyleLayer.h
+++ b/platform/darwin/src/MGLLineStyleLayer.h
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLFoundation.h"
@@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The display of line endings.
-
+
Values of this type are used in the `MGLLineStyleLayer.lineCap`
property.
*/
@@ -34,7 +34,7 @@ typedef NS_ENUM(NSUInteger, MGLLineCap) {
/**
The display of lines when joining.
-
+
Values of this type are used in the `MGLLineStyleLayer.lineJoin`
property.
*/
@@ -59,7 +59,7 @@ typedef NS_ENUM(NSUInteger, MGLLineJoin) {
/**
Controls the translation reference point.
-
+
Values of this type are used in the `MGLLineStyleLayer.lineTranslationAnchor`
property.
*/
@@ -77,20 +77,20 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslationAnchor) {
/**
An `MGLLineStyleLayer` is a style layer that renders one or more stroked
polylines on the map.
-
+
Use a line style layer to configure the visual appearance of polyline or
multipolyline features in vector tiles loaded by an `MGLVectorSource` object or
`MGLPolyline`, `MGLPolylineFeature`, `MGLMultiPolyline`, or
`MGLMultiPolylineFeature` instances in an `MGLShapeSource` object.
-
+
You can access an existing line style layer using the
`-[MGLStyle layerWithIdentifier:]` method if you know its identifier;
otherwise, find it using the `MGLStyle.layers` property. You can also create a
new line style layer and add it to the style using a method such as
`-[MGLStyle addLayer:]`.
-
+
### Example
-
+
```swift
let layer = MGLLineStyleLayer(identifier: "trails-path", source: trails)
layer.sourceLayerIdentifier = "trails"
@@ -111,7 +111,7 @@ MGL_EXPORT
/**
The display of line endings.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLLineCapButt`. Set this property to `nil` to
reset it to the default value.
@@ -120,7 +120,7 @@ MGL_EXPORT
/**
The display of lines when joining.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLLineJoinMiter`. Set this property to `nil` to
reset it to the default value.
@@ -129,11 +129,11 @@ MGL_EXPORT
/**
Used to automatically convert miter joins to bevel joins for sharp angles.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `2`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `lineJoin` is set to an
`MGLStyleValue` object containing an `NSValue` object containing
`MGLLineJoinMiter`. Otherwise, it is ignored.
@@ -142,11 +142,11 @@ MGL_EXPORT
/**
Used to automatically convert round joins to miter joins for shallow angles.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1.05`. Set this property to `nil` to
reset it to the default value.
-
+
This property is only applied to the style if `lineJoin` is set to an
`MGLStyleValue` object containing an `NSValue` object containing
`MGLLineJoinRound`. Otherwise, it is ignored.
@@ -157,9 +157,9 @@ MGL_EXPORT
/**
Blur applied to the line, in points.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
@@ -169,11 +169,11 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The color with which the line will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing
`UIColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `linePattern` is set to `nil`.
Otherwise, it is ignored.
*/
@@ -181,11 +181,11 @@ MGL_EXPORT
#else
/**
The color with which the line will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing
`NSColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `linePattern` is set to `nil`.
Otherwise, it is ignored.
*/
@@ -196,12 +196,12 @@ MGL_EXPORT
Specifies the lengths of the alternating dashes and gaps that form the dash
pattern. The lengths are later scaled by the line width. To convert a dash
length to points, multiply the length by the current line width.
-
+
This property is measured in line widths.
-
+
This property is only applied to the style if `linePattern` is set to `nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-line-dasharray"><code>line-dasharray</code></a>
layout property in the Mapbox Style Specification.
@@ -213,9 +213,9 @@ MGL_EXPORT
/**
Draws a line casing outside of a line's actual path. Value indicates the width
of the inner gap.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
@@ -227,9 +227,9 @@ MGL_EXPORT
the right, relative to the direction of the line, and a negative value to the
left. For polygon features, a positive value results in an inset, and a
negative value results in an outset.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
@@ -238,7 +238,7 @@ MGL_EXPORT
/**
The opacity at which the line will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
@@ -254,13 +254,13 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The geometry's offset.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points downward. Set this property to `nil` to reset it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-line-translate"><code>line-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -269,13 +269,13 @@ MGL_EXPORT
#else
/**
The geometry's offset.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points upward. Set this property to `nil` to reset it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-line-translate"><code>line-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -287,14 +287,14 @@ MGL_EXPORT
/**
Controls the translation reference point.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLLineTranslationAnchorMap`. Set this property to
`nil` to reset it to the default value.
-
+
This property is only applied to the style if `lineTranslation` is non-`nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-line-translate-anchor"><code>line-translate-anchor</code></a>
layout property in the Mapbox Style Specification.
@@ -305,9 +305,9 @@ MGL_EXPORT
/**
Stroke thickness.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
diff --git a/platform/darwin/src/MGLLineStyleLayer.mm b/platform/darwin/src/MGLLineStyleLayer.mm
index 13408d426c..73ffa9a5ae 100644
--- a/platform/darwin/src/MGLLineStyleLayer.mm
+++ b/platform/darwin/src/MGLLineStyleLayer.mm
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
@@ -66,7 +66,7 @@ namespace mbgl {
- (NSString *)sourceIdentifier
{
MGLAssertStyleLayerIsValid();
-
+
return @(self.rawLayer->getSourceID().c_str());
}
diff --git a/platform/darwin/src/MGLMapCamera.h b/platform/darwin/src/MGLMapCamera.h
index 584d370e6b..a76405df6f 100644
--- a/platform/darwin/src/MGLMapCamera.h
+++ b/platform/darwin/src/MGLMapCamera.h
@@ -34,7 +34,7 @@ MGL_EXPORT
/**
Returns a new camera based on information about the camera’s viewpoint
and focus point.
-
+
@param centerCoordinate The geographic coordinate on which the map should be
centered.
@param eyeCoordinate The geometric coordinate at which the camera should be
@@ -49,7 +49,7 @@ MGL_EXPORT
/**
Returns a new camera with the given distance, pitch, and heading.
-
+
@param centerCoordinate The geographic coordinate on which the map should be
centered.
@param distance The straight-line distance from the viewpoint to the
diff --git a/platform/darwin/src/MGLMapCamera.mm b/platform/darwin/src/MGLMapCamera.mm
index fafbefd17a..260ea31bbd 100644
--- a/platform/darwin/src/MGLMapCamera.mm
+++ b/platform/darwin/src/MGLMapCamera.mm
@@ -20,16 +20,16 @@
{
mbgl::LatLng centerLatLng = mbgl::LatLng(centerCoordinate.latitude, centerCoordinate.longitude);
mbgl::LatLng eyeLatLng = mbgl::LatLng(eyeCoordinate.latitude, eyeCoordinate.longitude);
-
+
mbgl::ProjectedMeters centerMeters = mbgl::Projection::projectedMetersForLatLng(centerLatLng);
mbgl::ProjectedMeters eyeMeters = mbgl::Projection::projectedMetersForLatLng(eyeLatLng);
CLLocationDirection heading = std::atan((centerMeters.northing - eyeMeters.northing) /
(centerMeters.easting - eyeMeters.easting));
-
+
double groundDistance = std::hypot(centerMeters.northing - eyeMeters.northing,
centerMeters.easting - eyeMeters.easting);
CGFloat pitch = std::atan(eyeAltitude / groundDistance);
-
+
return [[self alloc] initWithCenterCoordinate:centerCoordinate
altitude:eyeAltitude
pitch:pitch
@@ -108,7 +108,7 @@
{
return YES;
}
-
+
MGLMapCamera *otherCamera = other;
return (_centerCoordinate.latitude == otherCamera.centerCoordinate.latitude
&& _centerCoordinate.longitude == otherCamera.centerCoordinate.longitude
diff --git a/platform/darwin/src/MGLMultiPoint.h b/platform/darwin/src/MGLMultiPoint.h
index 31ab5744a3..ca08e5405a 100644
--- a/platform/darwin/src/MGLMultiPoint.h
+++ b/platform/darwin/src/MGLMultiPoint.h
@@ -9,12 +9,12 @@ NS_ASSUME_NONNULL_BEGIN
/**
The `MGLMultiPoint` class is an abstract superclass used to define shapes
composed of multiple vertices.
-
+
You do not create instances of this class directly. Instead, you create
instances of the `MGLPolyline` or `MGLPolygon` classes. However, you can use
the method and properties of this class to access information about the
vertices of the line or polygon.
-
+
Do not confuse `MGLMultiPoint` with `MGLPointCollection`, which represents a
collection of related but disconnected points.
*/
@@ -23,7 +23,7 @@ MGL_EXPORT
/**
The array of vertices associated with the shape.
-
+
This C array is a pointer to a structure inside the multipoint object, which
may have a lifetime shorter than the multipoint object and will certainly not
have a longer lifetime. Therefore, you should copy the C array if it needs to
@@ -36,7 +36,7 @@ MGL_EXPORT
/**
Retrieves the vertices of part of the shape.
-
+
@param coords On input, you must provide a C array of `CLLocationCoordinate2D`
structures large enough to hold the desired number of coordinates. On
output, this structure contains the requested coordinate data.
@@ -50,7 +50,7 @@ MGL_EXPORT
/**
Sets the shape’s vertices to the given C array of vertices.
-
+
@param coords The array of coordinates defining the shape. The data in this
array is copied to the shape’s `coordinates` property.
@param count The number of coordinates from the `coords` array.
@@ -60,7 +60,7 @@ MGL_EXPORT
/**
Inserts the given vertices into the shape. If the shape is currently visible on
the map, it is redrawn immediately.
-
+
@param coords The array of coordinates to insert into the shape. The data in
this array is copied to the shape’s `coordinates` property.
@param count The number of items in the `coords` array.
@@ -72,7 +72,7 @@ MGL_EXPORT
/**
Appends the given vertices to the shape. If the shape is currently visible on
the map, it is redrawn immediately.
-
+
@param coords The array of coordinates to add to the shape. The data in this
array is copied to the shape’s `coordinates` property.
@param count The number of items in the `coords` array.
@@ -83,15 +83,15 @@ MGL_EXPORT
Replaces the vertices at the given range in the shape with the same number of
vertices from a given C array. If the shape is currently visible on the map, it
is redrawn immediately.
-
+
The number of coordinates in `coords` must be equal to the length of `range`.
If you want to insert or delete one or more vertices, use the
`-replaceCoordinatesInRange:withCoordinates:count:` method.
-
+
If `range` extends beyond the shape’s `coordinates` property, an
`NSRangeException` is raised. If you want to append new vertices to the shape,
use the `-appendCoordinates:count:` method.
-
+
@param range The range of vertices to replace. The `location` field indicates
the first vertex you are replacing, with `0` being the first vertex, `1`
being the second vertex, and so on. The `length` field indicates the number
@@ -105,15 +105,15 @@ MGL_EXPORT
Replaces the vertices at the given range in the shape with the specified number
of vertices from a given C array. If the shape is currently visible on the map,
it is redrawn immediately.
-
+
If `count` is greater than the `length` field of `range`, some vertices will
effectively be inserted into the shape. On the other hand, if `count` is less
than the `length` field of `range`, some vertices will effectively be removed.
-
+
If `range` extends beyond the shape’s `coordinates` property, an
`NSRangeException` is raised. If you want to append new vertices to the shape,
use the `-appendCoordinates:count:` method.
-
+
@param range The range of vertices to replace. The `location` field indicates
the first vertex you are replacing, with `0` being the first vertex, `1`
being the second vertex, and so on. The `length` field indicates the number
@@ -130,10 +130,10 @@ MGL_EXPORT
/**
Removes the vertices at the given range from the shape. If the shape is
currently visible on the map, it is redrawn immediately.
-
+
If `range` extends beyond the shape’s `coordinates` property, an
`NSRangeException` is raised.
-
+
@param range The range of vertices to remove. The `location` field indicates
the first vertex you are removing, with `0` being the first vertex, `1`
being the second vertex, and so on. The `length` field indicates the number
diff --git a/platform/darwin/src/MGLMultiPoint.mm b/platform/darwin/src/MGLMultiPoint.mm
index 3b03b78ca6..8e8c5be304 100644
--- a/platform/darwin/src/MGLMultiPoint.mm
+++ b/platform/darwin/src/MGLMultiPoint.mm
@@ -44,7 +44,7 @@
{
if (self == other) return YES;
if (![other isKindOfClass:[MGLMultiPoint class]]) return NO;
-
+
MGLMultiPoint *otherMultipoint = other;
return ([super isEqual:otherMultipoint]
&& _coordinates == otherMultipoint->_coordinates);
@@ -97,7 +97,7 @@
[NSException raise:NSInvalidArgumentException
format:@"A multipoint must have at least one vertex."];
}
-
+
[self willChangeValueForKey:@"coordinates"];
_coordinates = { coords, coords + count };
_bounds = {};
@@ -108,13 +108,13 @@
if (!count) {
return;
}
-
+
if (index > _coordinates.size()) {
[NSException raise:NSRangeException
format:@"Invalid index %lu for existing coordinate count %ld",
(unsigned long)index, (unsigned long)[self pointCount]];
}
-
+
[self willChangeValueForKey:@"coordinates"];
_coordinates.insert(_coordinates.begin() + index, count, *coords);
_bounds = {};
@@ -135,7 +135,7 @@
if (!count && !range.length) {
return;
}
-
+
if (NSMaxRange(range) > _coordinates.size()) {
[NSException raise:NSRangeException
format:@"Invalid range %@ for existing coordinate count %ld",
diff --git a/platform/darwin/src/MGLNetworkConfiguration.h b/platform/darwin/src/MGLNetworkConfiguration.h
index 88fb07e111..644291ee13 100644
--- a/platform/darwin/src/MGLNetworkConfiguration.h
+++ b/platform/darwin/src/MGLNetworkConfiguration.h
@@ -3,11 +3,11 @@
NS_ASSUME_NONNULL_BEGIN
/**
- The MGLNetworkConfiguration object provides a global way to set a base API URL for
+ The MGLNetworkConfiguration object provides a global way to set a base API URL for
retrieval of map data, styles, and other resources.
-
- Currently, MGLNetworkConfiguration is private API in code but is able to be used
- by any applications via the `MGLMapboxAPIBaseURL` dictionary key in the
+
+ Currently, MGLNetworkConfiguration is private API in code but is able to be used
+ by any applications via the `MGLMapboxAPIBaseURL` dictionary key in the
application's `Info.plist`.
*/
@interface MGLNetworkConfiguration : NSObject
@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
/// Returns the shared instance of the `MGLNetworkConfiguration` class.
+ (instancetype)sharedManager;
-/// The current API base URL. If `nil`, the Mapbox default base API URL is in use.
+/// The current API base URL. If `nil`, the Mapbox default base API URL is in use.
@property (atomic, nullable) NSURL *apiBaseURL;
@end
diff --git a/platform/darwin/src/MGLOfflinePack.h b/platform/darwin/src/MGLOfflinePack.h
index 8436434e68..0b2db35b1a 100644
--- a/platform/darwin/src/MGLOfflinePack.h
+++ b/platform/darwin/src/MGLOfflinePack.h
@@ -11,20 +11,20 @@ NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM (NSInteger, MGLOfflinePackState) {
/**
It is unknown whether the pack is inactive, active, or complete.
-
+
This is the initial state of a pack. The state of a pack becomes known by
the time the shared `MGLOfflineStorage` object sends the first
`MGLOfflinePackProgressChangedNotification` about the pack. For inactive
packs, you must explicitly request a progress update using the
`-[MGLOfflinePack requestProgress]` method.
-
+
An invalid pack always has a state of `MGLOfflinePackStateInvalid`, never
`MGLOfflinePackStateUnknown`.
*/
MGLOfflinePackStateUnknown = 0,
/**
The pack is incomplete and is not currently downloading.
-
+
This is the initial state of a pack that is created using the
`-[MGLOfflineStorage addPackForRegion:withContext:completionHandler:]`
method, as well as after the `-[MGLOfflinePack suspend]` method is
@@ -33,7 +33,7 @@ typedef NS_ENUM (NSInteger, MGLOfflinePackState) {
MGLOfflinePackStateInactive = 1,
/**
The pack is incomplete and is currently downloading.
-
+
This is the state of a pack after the `-[MGLOfflinePack resume]` method is
called.
*/
@@ -77,7 +77,7 @@ typedef struct MGLOfflinePackProgress {
/**
The minimum number of resources that must be downloaded in order to view
the pack’s full region without any omissions.
-
+
At the beginning of a download, this count is a lower bound; the number of
expected resources may increase as the download progresses.
*/
@@ -85,7 +85,7 @@ typedef struct MGLOfflinePackProgress {
/**
The maximum number of resources that must be downloaded in order to view
the pack’s full region without any omissions.
-
+
At the beginning of a download, when the exact number of required resources
is unknown, this field is set to `UINT64_MAX`. Thus this count is always an
upper bound.
@@ -96,7 +96,7 @@ typedef struct MGLOfflinePackProgress {
/**
An `MGLOfflinePack` represents a collection of resources necessary for viewing
a region offline to a local database.
-
+
To create an instance of `MGLOfflinePack`, use the
`+[MGLOfflineStorage addPackForRegion:withContext:completionHandler:]` method.
A pack created using `-[MGLOfflinePack init]` is immediately invalid.
@@ -111,7 +111,7 @@ MGL_EXPORT
/**
Arbitrary data stored alongside the downloaded resources.
-
+
The context typically holds application-specific information for identifying
the pack, such as a user-selected name.
*/
@@ -119,7 +119,7 @@ MGL_EXPORT
/**
The pack’s current state.
-
+
The state of an inactive or completed pack is computed lazily and is set to
`MGLOfflinePackStateUnknown` by default. To request the pack’s status, use the
`-requestProgress` method. To get notified when the state becomes known and
@@ -132,7 +132,7 @@ MGL_EXPORT
/**
The pack’s current progress.
-
+
The progress of an inactive or completed pack is computed lazily, and all its
fields are set to 0 by default. To request the pack’s progress, use the
`-requestProgress` method. To get notified when the progress becomes
@@ -145,33 +145,33 @@ MGL_EXPORT
/**
Resumes downloading if the pack is inactive.
-
+
When a pack resumes after being suspended, it may begin by iterating over the
already downloaded resources. As a result, the `progress` structure’s
`countOfResourcesCompleted` field may revert to 0 before rapidly returning to
the level of progress at the time the pack was suspended.
-
+
To temporarily suspend downloading, call the `-suspend` method.
*/
- (void)resume;
/**
Temporarily stops downloading if the pack is active.
-
+
A pack suspends asynchronously, so some network requests may be sent after this
method is called. Regardless, the `progress` property will not be updated until
`-resume` is called.
-
+
If the pack previously reached a higher level of progress before being
suspended, it may wait to suspend until it returns to that level.
-
+
To resume downloading, call the `-resume` method.
*/
- (void)suspend;
/**
Request an asynchronous update to the pack’s `state` and `progress` properties.
-
+
The state and progress of an inactive or completed pack are computed lazily. If
you need the state or progress of a pack whose `state` property is currently
set to `MGLOfflinePackStateUnknown`, observe KVO change notifications on this
diff --git a/platform/darwin/src/MGLOfflinePack.mm b/platform/darwin/src/MGLOfflinePack.mm
index 1f2fd95f2b..218e32940d 100644
--- a/platform/darwin/src/MGLOfflinePack.mm
+++ b/platform/darwin/src/MGLOfflinePack.mm
@@ -8,7 +8,7 @@
/**
Assert that the current offline pack is valid.
-
+
This macro should be used at the beginning of any public-facing instance method
of `MGLOfflinePack`. For private methods, an assertion is more appropriate.
*/
@@ -26,11 +26,11 @@
class MBGLOfflineRegionObserver : public mbgl::OfflineRegionObserver {
public:
MBGLOfflineRegionObserver(MGLOfflinePack *pack_) : pack(pack_) {}
-
+
void statusChanged(mbgl::OfflineRegionStatus status) override;
void responseError(mbgl::Response::Error error) override;
void mapboxTileCountLimitExceeded(uint64_t limit) override;
-
+
private:
__weak MGLOfflinePack *pack = nullptr;
};
@@ -59,7 +59,7 @@ private:
if (self = [super init]) {
_mbglOfflineRegion = region;
_state = MGLOfflinePackStateUnknown;
-
+
mbgl::DefaultFileSource *mbglFileSource = [[MGLOfflineStorage sharedOfflineStorage] mbglFileSource];
mbglFileSource->setOfflineRegionObserver(*_mbglOfflineRegion, std::make_unique<MBGLOfflineRegionObserver>(self));
}
@@ -72,7 +72,7 @@ private:
- (id <MGLOfflineRegion>)region {
MGLAssertOfflinePackIsValid();
-
+
const mbgl::OfflineRegionDefinition &regionDefinition = _mbglOfflineRegion->getDefinition();
NSAssert([MGLTilePyramidOfflineRegion conformsToProtocol:@protocol(MGLOfflineRegion_Private)], @"MGLTilePyramidOfflineRegion should conform to MGLOfflineRegion_Private.");
return [(id <MGLOfflineRegion_Private>)[MGLTilePyramidOfflineRegion alloc] initWithOfflineRegionDefinition:regionDefinition];
@@ -80,35 +80,35 @@ private:
- (NSData *)context {
MGLAssertOfflinePackIsValid();
-
+
const mbgl::OfflineRegionMetadata &metadata = _mbglOfflineRegion->getMetadata();
return [NSData dataWithBytes:&metadata[0] length:metadata.size()];
}
- (void)resume {
MGLAssertOfflinePackIsValid();
-
+
self.state = MGLOfflinePackStateActive;
-
+
mbgl::DefaultFileSource *mbglFileSource = [[MGLOfflineStorage sharedOfflineStorage] mbglFileSource];
mbglFileSource->setOfflineRegionDownloadState(*_mbglOfflineRegion, mbgl::OfflineRegionDownloadState::Active);
}
- (void)suspend {
MGLAssertOfflinePackIsValid();
-
+
if (self.state == MGLOfflinePackStateActive) {
self.state = MGLOfflinePackStateInactive;
_isSuspending = YES;
}
-
+
mbgl::DefaultFileSource *mbglFileSource = [[MGLOfflineStorage sharedOfflineStorage] mbglFileSource];
mbglFileSource->setOfflineRegionDownloadState(*_mbglOfflineRegion, mbgl::OfflineRegionDownloadState::Inactive);
}
- (void)invalidate {
NSAssert(_state != MGLOfflinePackStateInvalid, @"Cannot invalidate an already invalid offline pack.");
-
+
self.state = MGLOfflinePackStateInvalid;
mbgl::DefaultFileSource *mbglFileSource = [[MGLOfflineStorage sharedOfflineStorage] mbglFileSource];
mbglFileSource->setOfflineRegionObserver(*self.mbglOfflineRegion, nullptr);
@@ -123,9 +123,9 @@ private:
NSAssert(_state == MGLOfflinePackStateInvalid, @"A valid MGLOfflinePack has no mbgl::OfflineRegion.");
return;
}
-
+
NSAssert(_state != MGLOfflinePackStateInvalid, @"Cannot change the state of an invalid offline pack.");
-
+
if (!_isSuspending || state != MGLOfflinePackStateActive) {
_isSuspending = NO;
_state = state;
@@ -134,9 +134,9 @@ private:
- (void)requestProgress {
MGLAssertOfflinePackIsValid();
-
+
mbgl::DefaultFileSource *mbglFileSource = [[MGLOfflineStorage sharedOfflineStorage] mbglFileSource];
-
+
__weak MGLOfflinePack *weakSelf = self;
mbglFileSource->getOfflineRegionStatus(*_mbglOfflineRegion, [&, weakSelf](__unused std::exception_ptr exception, mbgl::optional<mbgl::OfflineRegionStatus> status) {
if (status) {
@@ -151,21 +151,21 @@ private:
- (void)offlineRegionStatusDidChange:(mbgl::OfflineRegionStatus)status {
NSAssert(_state != MGLOfflinePackStateInvalid, @"Cannot change update progress of an invalid offline pack.");
-
+
switch (status.downloadState) {
case mbgl::OfflineRegionDownloadState::Inactive:
self.state = status.complete() ? MGLOfflinePackStateComplete : MGLOfflinePackStateInactive;
break;
-
+
case mbgl::OfflineRegionDownloadState::Active:
self.state = MGLOfflinePackStateActive;
break;
}
-
+
if (_isSuspending) {
return;
}
-
+
MGLOfflinePackProgress progress;
progress.countOfResourcesCompleted = status.completedResourceCount;
progress.countOfBytesCompleted = status.completedResourceSize;
@@ -174,7 +174,7 @@ private:
progress.countOfResourcesExpected = status.requiredResourceCount;
progress.maximumResourcesExpected = status.requiredResourceCountIsPrecise ? status.requiredResourceCount : UINT64_MAX;
self.progress = progress;
-
+
[self.delegate offlinePack:self progressDidChange:progress];
}
@@ -184,15 +184,15 @@ NSError *MGLErrorFromResponseError(mbgl::Response::Error error) {
case mbgl::Response::Error::Reason::NotFound:
errorCode = MGLErrorCodeNotFound;
break;
-
+
case mbgl::Response::Error::Reason::Server:
errorCode = MGLErrorCodeBadServerResponse;
break;
-
+
case mbgl::Response::Error::Reason::Connection:
errorCode = MGLErrorCodeConnectionFailed;
break;
-
+
default:
break;
}
diff --git a/platform/darwin/src/MGLOfflinePack_Private.h b/platform/darwin/src/MGLOfflinePack_Private.h
index 95d8ba4323..65156b4e90 100644
--- a/platform/darwin/src/MGLOfflinePack_Private.h
+++ b/platform/darwin/src/MGLOfflinePack_Private.h
@@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The pack’s delegate.
-
+
You can use the offline pack delegate to be notified of any changes in the
pack’s progress and of any errors while downloading. For more information, see
the `MGLOfflinePackDelegate` documentation.
@@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Sent whenever the pack’s state or download progress changes. Every change to a
field in the `progress` property corresponds to an invocation of this method.
-
+
@param pack The pack whose state of progress changed.
@param progress The updated progress. To get the updated state, refer to the
`state` property.
@@ -50,11 +50,11 @@ NS_ASSUME_NONNULL_BEGIN
/**
Sent whenever the pack encounters an error while downloading.
-
+
Download errors may be recoverable. For example, this pack’s implementation may
attempt to re-request failed resources based on an exponential backoff
strategy or upon the restoration of network access.
-
+
@param pack The pack that encountered an error.
@param error A download error. For a list of possible error codes, see
`MGLErrorCode`.
@@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Sent when the maximum number of Mapbox-hosted tiles has been downloaded and
stored on the current device.
-
+
Once this limit is reached, no instance of `MGLOfflinePack` can download
additional tiles from Mapbox APIs until already downloaded tiles are removed by
calling the `-[MGLOfflineStorage removePack:withCompletionHandler:]` method.
diff --git a/platform/darwin/src/MGLOfflineRegion_Private.h b/platform/darwin/src/MGLOfflineRegion_Private.h
index 22106987d0..b1dec8dd64 100644
--- a/platform/darwin/src/MGLOfflineRegion_Private.h
+++ b/platform/darwin/src/MGLOfflineRegion_Private.h
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Initializes and returns an offline region backed by the given C++ region
definition object.
-
+
@param definition A reference to an offline region definition backing the
offline region.
*/
diff --git a/platform/darwin/src/MGLOfflineStorage.h b/platform/darwin/src/MGLOfflineStorage.h
index 9125c5341e..2d376c9222 100644
--- a/platform/darwin/src/MGLOfflineStorage.h
+++ b/platform/darwin/src/MGLOfflineStorage.h
@@ -14,14 +14,14 @@ NS_ASSUME_NONNULL_BEGIN
downloaded or because the pack discovers during the download that more
resources are required for offline viewing. This notification is posted
whenever any field in the `progress` property changes.
-
+
The `object` is the `MGLOfflinePack` object whose progress changed. The
`userInfo` dictionary contains the pack’s current state in the
`MGLOfflinePackStateUserInfoKey` key and details about the pack’s current
progress in the `MGLOfflinePackProgressUserInfoKey` key. You may also consult
the `MGLOfflinePack.state` and `MGLOfflinePack.progress` properties, which
provide the same values.
-
+
If you only need to observe changes in a particular pack’s progress, you can
alternatively observe KVO change notifications to the pack’s `progress` key
path.
@@ -34,7 +34,7 @@ extern MGL_EXPORT const NSNotificationName MGLOfflinePackProgressChangedNotifica
may not warrant the user’s attention. For example, the pack’s implementation
may attempt to re-request failed resources based on an exponential backoff
strategy or upon the restoration of network access.
-
+
The `object` is the `MGLOfflinePack` object that encountered the error. The
`userInfo` dictionary contains the error object in the
`MGLOfflinePackErrorUserInfoKey` key.
@@ -44,11 +44,11 @@ extern MGL_EXPORT const NSNotificationName MGLOfflinePackErrorNotification;
/**
Posted by the shared `MGLOfflineStorage` object when the maximum number of
Mapbox-hosted tiles has been downloaded and stored on the current device.
-
+
The `object` is the `MGLOfflinePack` object that reached the tile limit in the
course of downloading. The `userInfo` dictionary contains the tile limit in the
`MGLOfflinePackMaximumCountUserInfoKey` key.
-
+
Once this limit is reached, no instance of `MGLOfflinePack` can download
additional tiles from Mapbox APIs until already downloaded tiles are removed by
calling the `-[MGLOfflineStorage removePack:withCompletionHandler:]` method.
@@ -107,10 +107,10 @@ extern MGL_EXPORT NSString * const MGLOfflinePackMaximumCountUserInfoKey __attri
/**
A block to be called once an offline pack has been completely created and
added.
-
+
An application typically calls the `-resume` method on the pack inside this
completion handler to begin the download.
-
+
@param pack Contains a pointer to the newly added pack, or `nil` if there was
an error creating or adding the pack.
@param error Contains a pointer to an error object (if any) indicating why the
@@ -121,11 +121,11 @@ typedef void (^MGLOfflinePackAdditionCompletionHandler)(MGLOfflinePack * _Nullab
/**
A block to be called once an offline pack has been completely invalidated and
removed.
-
+
Avoid any references to the pack inside this completion handler: by the time
this completion handler is executed, the pack has become invalid, and any
messages passed to it will raise an exception.
-
+
@param error Contains a pointer to an error object (if any) indicating why the
pack could not be invalidated or removed.
*/
@@ -147,13 +147,13 @@ MGL_EXPORT
/**
An array of all known offline packs, in the order in which they were created.
-
+
This property is set to `nil`, indicating that the receiver does not yet know
the existing packs, for an undefined amount of time starting from the moment
the shared offline storage object is initialized until the packs are fetched
from the database. After that point, this property is always non-nil, but it
may be empty to indicate that no packs are present.
-
+
To detect when the shared offline storage object has finished loading its
`packs` property, observe KVO change notifications on the `packs` key path.
The initial load results in an `NSKeyValueChangeSetting` change.
@@ -163,19 +163,19 @@ MGL_EXPORT
/**
Creates and registers an offline pack that downloads the resources needed to
use the given region offline.
-
+
The resulting pack is added to the shared offline storage object’s `packs`
property, then the `completion` block is executed with that pack passed in.
-
+
The pack has an initial state of `MGLOfflinePackStateInactive`. To begin
downloading resources, call `-[MGLOfflinePack resume]` on the pack from within
the completion handler. To monitor download progress, add an observer for
`MGLOfflinePackProgressChangedNotification`s about that pack.
-
+
To detect when any call to this method results in a new pack, observe KVO
change notifications on the shared offline storage object’s `packs` key path.
Additions to that array result in an `NSKeyValueChangeInsertion` change.
-
+
@param region A region to download.
@param context Arbitrary data to store alongside the downloaded resources.
@param completion The completion handler to call once the pack has been added.
@@ -186,17 +186,17 @@ MGL_EXPORT
/**
Unregisters the given offline pack and allows resources that are no longer
required by any remaining packs to be potentially freed.
-
+
As soon as this method is called on a pack, the pack becomes invalid; any
attempt to send it a message will result in an exception being thrown. If an
error occurs and the pack cannot be removed, do not attempt to reuse the pack
object. Instead, if you need continued access to the pack, suspend all packs
and use the `-reloadPacks` method to obtain valid pointers to all the packs.
-
+
To detect when any call to this method results in a pack being removed, observe
KVO change notifications on the shared offline storage object’s `packs` key
path. Removals from that array result in an `NSKeyValueChangeRemoval` change.
-
+
When you remove an offline pack, any resources that are required by that pack,
but not other packs, become eligible for deletion from offline storage. Because
the backing store used for offline storage is also used as a general purpose
@@ -216,9 +216,9 @@ MGL_EXPORT
`packs` property change, even if the underlying data for these packs has not
changed. If this method is called while a pack is actively downloading, the
behavior is undefined.
-
+
You typically do not need to call this method.
-
+
To detect when the shared offline storage object has finished reloading its
`packs` property, observe KVO change notifications on the `packs` key path.
A reload results in an `NSKeyValueChangeSetting` change.
@@ -228,12 +228,12 @@ MGL_EXPORT
/**
Sets the maximum number of Mapbox-hosted tiles that may be downloaded and
stored on the current device.
-
+
Once this limit is reached, an
`MGLOfflinePackMaximumMapboxTilesReachedNotification` is posted for every
attempt to download additional tiles until already downloaded tiles are removed
by calling the `-removePack:withCompletionHandler:` method.
-
+
@note The <a href="https://www.mapbox.com/tos/">Mapbox Terms of Service</a>
prohibits changing or bypassing this limit without permission from Mapbox.
Contact your Mapbox sales representative to have the limit raised.
@@ -242,7 +242,7 @@ MGL_EXPORT
/**
The cumulative size, measured in bytes, of all downloaded resources on disk.
-
+
The returned value includes all resources, including tiles, whether downloaded
as part of an offline pack or due to caching during normal use of `MGLMapView`.
*/
diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm
index 10acc58b25..bdecd101d2 100644
--- a/platform/darwin/src/MGLOfflineStorage.mm
+++ b/platform/darwin/src/MGLOfflineStorage.mm
@@ -161,11 +161,11 @@ NSString * const MGLOfflinePackMaximumCountUserInfoKey = MGLOfflinePackUserInfoK
- (void)dealloc {
[[MGLNetworkConfiguration sharedManager] removeObserver:self forKeyPath:@"apiBaseURL"];
[[MGLAccountManager sharedManager] removeObserver:self forKeyPath:@"accessToken"];
-
+
for (MGLOfflinePack *pack in self.packs) {
[pack invalidate];
}
-
+
delete _mbglFileSource;
_mbglFileSource = nullptr;
}
@@ -210,7 +210,7 @@ NSString * const MGLOfflinePackMaximumCountUserInfoKey = MGLOfflinePackUserInfoK
@"Regions of type %@ are unsupported.", NSStringFromClass([region class])];
return;
}
-
+
const mbgl::OfflineTilePyramidRegionDefinition regionDefinition = [(id <MGLOfflineRegion_Private>)region offlineRegionDefinition];
mbgl::OfflineRegionMetadata metadata(context.length);
[context getBytes:&metadata[0] length:metadata.size()];
@@ -247,7 +247,7 @@ NSString * const MGLOfflinePackMaximumCountUserInfoKey = MGLOfflinePackUserInfoK
completion(nil);
return;
}
-
+
self.mbglFileSource->deleteOfflineRegion(std::move(*mbglOfflineRegion), [&, completion](std::exception_ptr exception) {
NSError *error;
if (exception) {
@@ -269,7 +269,7 @@ NSString * const MGLOfflinePackMaximumCountUserInfoKey = MGLOfflinePackUserInfoK
[pack invalidate];
}
self.packs = [packs mutableCopy];
-
+
for (MGLOfflinePack *pack in packs) {
pack.delegate = self;
}
@@ -312,7 +312,7 @@ NSString * const MGLOfflinePackMaximumCountUserInfoKey = MGLOfflinePackUserInfoK
if (!cachePath) {
return 0;
}
-
+
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:cachePath error:NULL];
return attributes.fileSize;
}
diff --git a/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/darwin/src/MGLOpenGLStyleLayer.mm
index 5d81eb85ea..da131b6de8 100644
--- a/platform/darwin/src/MGLOpenGLStyleLayer.mm
+++ b/platform/darwin/src/MGLOpenGLStyleLayer.mm
@@ -11,7 +11,7 @@
/**
Runs the preparation handler block contained in the given context, which is
implicitly an instance of `MGLOpenGLStyleLayer`.
-
+
@param context An `MGLOpenGLStyleLayer` instance that was provided as context
when creating an OpenGL style layer.
*/
@@ -23,7 +23,7 @@ void MGLPrepareCustomStyleLayer(void *context) {
/**
Runs the drawing handler block contained in the given context, which is
implicitly an instance of `MGLOpenGLStyleLayer`.
-
+
@param context An `MGLOpenGLStyleLayer` instance that was provided as context
when creating an OpenGL style layer.
*/
@@ -43,7 +43,7 @@ void MGLDrawCustomStyleLayer(void *context, const mbgl::style::CustomLayerRender
/**
Runs the completion handler block contained in the given context, which is
implicitly an instance of `MGLOpenGLStyleLayer`.
-
+
@param context An `MGLOpenGLStyleLayer` instance that was provided as context
when creating an OpenGL style layer.
*/
@@ -55,18 +55,18 @@ void MGLFinishCustomStyleLayer(void *context) {
/**
An `MGLOpenGLStyleLayer` is a style layer that is rendered by OpenGL code that
you provide.
-
+
By default, this class does nothing. You can subclass this class to provide
custom OpenGL drawing code that is run on each frame of the map. Your subclass
should override the `-didMoveToMapView:`, `-willMoveFromMapView:`, and
`-drawInMapView:withContext:` methods.
-
+
You can access an existing OpenGL style layer using the
`-[MGLStyle layerWithIdentifier:]` method if you know its identifier;
otherwise, find it using the `MGLStyle.layers` property. You can also create a
new OpenGL style layer and add it to the style using a method such as
`-[MGLStyle addLayer:]`.
-
+
@warning This API is undocumented and therefore unsupported. It may change at
any time without notice.
*/
@@ -76,7 +76,7 @@ void MGLFinishCustomStyleLayer(void *context) {
/**
The map view whose style currently contains the layer.
-
+
If the layer is not currently part of any map view’s style, this property is
set to `nil`.
*/
@@ -90,11 +90,11 @@ void MGLFinishCustomStyleLayer(void *context) {
/**
Returns an OpenGL style layer object initialized with the given identifier.
-
+
After initializing and configuring the style layer, add it to a map view’s
style using the `-[MGLStyle addLayer:]` or
`-[MGLStyle insertLayer:belowLayer:]` method.
-
+
@param identifier A string that uniquely identifies the layer in the style to
which it is added.
@return An initialized OpenGL style layer.
@@ -154,58 +154,58 @@ void MGLFinishCustomStyleLayer(void *context) {
/**
Called immediately after a layer is added to a map view’s style.
-
+
This method is intended to be overridden in a subclass. You can use this method
to perform any setup work before the layer is used to draw a frame. For
example, you might use this method to compile an OpenGL shader. The default
implementation of this method does nothing.
-
+
Any resource acquired in this method must be released in
`-willMoveFromMapView:`.
-
+
@param mapView The map view to whose style the layer has been added.
*/
- (void)didMoveToMapView:(MGLMapView *)mapView {
-
+
}
/**
Called immediately before a layer is removed from a map view’s style.
-
+
This method is intended to be overridden in a subclass. You can use this method
to perform any teardown work once the layer has drawn its last frame and is
about to be removed from the style. The default implementation of this method
does nothing.
-
+
This method may be called even if `-didMoveToMapView:` has not been called.
-
+
@param mapView The map view from whose style the layer is about to be removed.
*/
- (void)willMoveFromMapView:(MGLMapView *)mapView {
-
+
}
/**
Called each time the layer needs to draw a new frame in a map view.
-
+
This method is intended to be overridden in a subclass. You can use this method
to draw the layer’s content. The default implementation of this method does
nothing.
-
+
Your implementation should not make any assumptions about the OpenGL state,
other than that the current OpenGL context is active. It may make changes to
the OpenGL state. It is not required to reset values such as the depth mask,
stencil mask, or corresponding test flags to their original values.
-
+
Be sure to draw your fragments with a <var>z</var> value of 1 to take advantage
of the opaque fragment culling, in case the style contains any opaque layers
above this layer.
-
+
@param mapView The map view to which the layer draws.
@param context A context structure with information defining the frame to draw.
*/
- (void)drawInMapView:(MGLMapView *)mapView withContext:(MGLStyleLayerDrawingContext)context {
-
+
}
/**
diff --git a/platform/darwin/src/MGLOverlay.h b/platform/darwin/src/MGLOverlay.h
index cc32bad1e6..462a0c1031 100644
--- a/platform/darwin/src/MGLOverlay.h
+++ b/platform/darwin/src/MGLOverlay.h
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
both a point and an area on a map. Overlay objects are essentially data objects
that contain the geographic data needed to represent the map area. Overlays can
take the form of a polyline or polygon.
-
+
You use overlays to layer more sophisticated content on top of a map view. For
example, you could use an overlay to show the boundaries of a national park or
trace a bus route along city streets. This SDK defines several concrete classes
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The cooordinate rectangle that encompasses the overlay. (required) (read-only)
-
+
This property contains the smallest rectangle that completely encompasses the
overlay. Implementers of this protocol must set this area when implementing
their overlay class, and after setting it, you must not change it.
@@ -36,11 +36,11 @@ NS_ASSUME_NONNULL_BEGIN
/**
Returns a Boolean indicating whether the specified rectangle intersects the
receiver’s shape.
-
+
You can implement this method to provide more specific bounds checking for an
overlay. If you do not implement it, the bounding rectangle is used to detect
intersections.
-
+
@param overlayBounds The rectangle to intersect with the receiver’s area.
@return `YES` if any part of the map rectangle intersects the receiver’s shape
or `NO` if it does not.
diff --git a/platform/darwin/src/MGLPointAnnotation.h b/platform/darwin/src/MGLPointAnnotation.h
index aeac43bd39..1ef0962f99 100644
--- a/platform/darwin/src/MGLPointAnnotation.h
+++ b/platform/darwin/src/MGLPointAnnotation.h
@@ -12,12 +12,12 @@ NS_ASSUME_NONNULL_BEGIN
`MGLPointAnnotation` object is known as a point annotation or point shape. For
example, you could use a point shape to represent a city at low zoom levels, an
address at high zoom levels, or the location of a long press gesture.
-
+
You can add point shapes to the map by adding them to an `MGLShapeSource`
object. Configure the appearance of an `MGLShapeSource`’s or
`MGLVectorSource`’s point shapes collectively using an `MGLCircleStyleLayer` or
`MGLSymbolStyleLayer` object.
-
+
For more interactivity, add a selectable point annotation to a map view using
the `-[MGLMapView addAnnotation:]` method. Alternatively, define your own model
class that conforms to the `MGLAnnotation` protocol. Configure a point
@@ -26,10 +26,10 @@ NS_ASSUME_NONNULL_BEGIN
`-[MGLMapViewDelegate mapView:viewForAnnotation:]` (iOS only). A point
annotation’s `MGLShape.title` and `MGLShape.subtitle` properties define the
default content of the annotation’s callout (on iOS) or popover (on macOS).
-
+
To group multiple related points together in one shape, use an
`MGLPointCollection` or `MGLShapeCollection` object.
-
+
A point shape is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.2">Point</a> geometry
in GeoJSON.
diff --git a/platform/darwin/src/MGLPointAnnotation.mm b/platform/darwin/src/MGLPointAnnotation.mm
index a2108a9e3b..5fd3e25991 100644
--- a/platform/darwin/src/MGLPointAnnotation.mm
+++ b/platform/darwin/src/MGLPointAnnotation.mm
@@ -33,7 +33,7 @@
{
if (other == self) return YES;
if (![other isKindOfClass:[MGLPointAnnotation class]]) return NO;
-
+
MGLPointAnnotation *otherAnnotation = other;
return ([super isEqual:other]
&& self.coordinate.latitude == otherAnnotation.coordinate.latitude
diff --git a/platform/darwin/src/MGLPointCollection.h b/platform/darwin/src/MGLPointCollection.h
index c7054c6bbf..74b30385a0 100644
--- a/platform/darwin/src/MGLPointCollection.h
+++ b/platform/darwin/src/MGLPointCollection.h
@@ -11,17 +11,17 @@
points in the collection may be related but are not connected spatially. For
example, you could use a point collection to represent all the trees in an
orchard.
-
+
You can add point collections to the map by adding them to an `MGLShapeSource`
object. Configure the appearance of an `MGLShapeSource`’s or
`MGLVectorSource`’s point collections collectively using an
`MGLCircleStyleLayer` or `MGLSymbolStyleLayer` object.
-
+
You cannot add an `MGLPointCollection` object directly to a map view as an
annotation. However, you can create individual `MGLPointAnnotation` objects
from the `coordinates` array and add those annotation objects to the map view
using the `-[MGLMapView addAnnotations:]` method.
-
+
A point collection is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.3">MultiPoint</a>
geometry in GeoJSON. Do not confuse `MGLPointCollection` with `MGLMultiPoint`,
@@ -33,7 +33,7 @@ MGL_EXPORT
/**
Creates and returns a `MGLPointCollection` object from the specified set of
coordinates.
-
+
@param coords The array of coordinates defining the shape. The data in this
array is copied to the new object.
@param count The number of items in the `coords` array.
@@ -49,7 +49,7 @@ MGL_EXPORT
/**
Retrieves one or more coordinates associated with the shape.
-
+
@param coords On input, you must provide a C array of structures large enough
to hold the desired number of coordinates. On output, this structure
contains the requested coordinate data.
diff --git a/platform/darwin/src/MGLPointCollection.mm b/platform/darwin/src/MGLPointCollection.mm
index acd78b8b33..ac4aaed60c 100644
--- a/platform/darwin/src/MGLPointCollection.mm
+++ b/platform/darwin/src/MGLPointCollection.mm
@@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
- (BOOL)isEqual:(id)other {
if (self == other) return YES;
if (![other isKindOfClass:[MGLPointCollection class]]) return NO;
-
+
MGLPointCollection *otherCollection = (MGLPointCollection *)other;
return ([super isEqual:other]
&& ((![self geoJSONDictionary] && ![otherCollection geoJSONDictionary]) || [[self geoJSONDictionary] isEqualToDictionary:[otherCollection geoJSONDictionary]]));
@@ -112,7 +112,7 @@ NS_ASSUME_NONNULL_BEGIN
CLLocationCoordinate2D coordinate = self.coordinates[index];
[coordinates addObject:@[@(coordinate.longitude), @(coordinate.latitude)]];
}
-
+
return @{@"type": @"MultiPoint",
@"coordinates": coordinates};
}
diff --git a/platform/darwin/src/MGLPolygon+MGLAdditions.m b/platform/darwin/src/MGLPolygon+MGLAdditions.m
index def4687016..3e76a37157 100644
--- a/platform/darwin/src/MGLPolygon+MGLAdditions.m
+++ b/platform/darwin/src/MGLPolygon+MGLAdditions.m
@@ -4,14 +4,14 @@
- (NS_ARRAY_OF(id) *)mgl_coordinates {
NSMutableArray *coordinates = [NSMutableArray array];
-
+
NSMutableArray *exteriorRing = [NSMutableArray array];
for (NSUInteger index = 0; index < self.pointCount; index++) {
CLLocationCoordinate2D coordinate = self.coordinates[index];
[exteriorRing addObject:@[@(coordinate.longitude), @(coordinate.latitude)]];
}
[coordinates addObject:exteriorRing];
-
+
for (MGLPolygon *interiorPolygon in self.interiorPolygons) {
NSMutableArray *interiorRing = [NSMutableArray array];
for (int index = 0; index < interiorPolygon.pointCount; index++) {
@@ -20,7 +20,7 @@
}
[coordinates addObject:interiorRing];
}
-
+
return [coordinates copy];
}
diff --git a/platform/darwin/src/MGLPolygon.h b/platform/darwin/src/MGLPolygon.h
index 560741a150..3fcc1be76d 100644
--- a/platform/darwin/src/MGLPolygon.h
+++ b/platform/darwin/src/MGLPolygon.h
@@ -14,25 +14,25 @@ NS_ASSUME_NONNULL_BEGIN
vertices, specified as `CLLocationCoordinate2D` instances, and the edges that
connect them. For example, you could use a polygon shape to represent a
building, a lake, or an area you want to highlight.
-
+
You can add polygon shapes to the map by adding them to an `MGLShapeSource`
object. Configure the appearance of an `MGLShapeSource`’s or
`MGLVectorSource`’s polygons collectively using an `MGLFillStyleLayer` or
`MGLSymbolStyleLayer` object.
-
+
Alternatively, you can add a polygon overlay directly to a map view using the
`-[MGLMapView addAnnotation:]` or `-[MGLMapView addOverlay:]` method. Configure
a polygon overlay’s appearance using
`-[MGLMapViewDelegate mapView:strokeColorForShapeAnnotation:]` and
`-[MGLMapViewDelegate mapView:fillColorForPolygonAnnotation:]`.
-
+
The vertices are automatically connected in the order in which you provide
them. You should close the polygon by specifying the same
`CLLocationCoordinate2D` as the first and last vertices; otherwise, the
polygon’s fill may not cover the area you expect it to. To avoid filling the
space within the shape, give the polygon a transparent fill or use an
`MGLPolyline` object.
-
+
A polygon may have one or more interior polygons, or holes, that you specify as
`MGLPolygon` objects with the `+polygonWithCoordinates:count:interiorPolygons:`
method. For example, if a polygon represents a lake, it could exclude an island
@@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
have interior polygons. To represent a shape that includes a polygon within a
hole or, more generally, to group multiple polygons together in one shape, use
an `MGLMultiPolygon` or `MGLShapeCollection` object.
-
+
To make the polygon straddle the antimeridian, specify some longitudes less
than −180 degrees or greater than 180 degrees.
*/
@@ -49,11 +49,11 @@ MGL_EXPORT
/**
The array of polygons nested inside the receiver.
-
+
The area occupied by any interior polygons is excluded from the overall shape.
Interior polygons should not overlap. An interior polygon should not have
interior polygons of its own.
-
+
If there are no interior polygons, the value of this property is `nil`.
*/
@property (nonatomic, nullable, readonly) NS_ARRAY_OF(MGLPolygon *) *interiorPolygons;
@@ -61,7 +61,7 @@ MGL_EXPORT
/**
Creates and returns an `MGLPolygon` object from the specified set of
coordinates.
-
+
@param coords The array of coordinates defining the shape. The data in this
array is copied to the new object.
@param count The number of items in the `coords` array.
@@ -72,7 +72,7 @@ MGL_EXPORT
/**
Creates and returns an `MGLPolygon` object from the specified set of
coordinates and interior polygons.
-
+
@param coords The array of coordinates defining the shape. The data in this
array is copied to the new object.
@param count The number of items in the `coords` array.
@@ -92,12 +92,12 @@ MGL_EXPORT
atoll: the inner island would be one `MGLPolygon` object, while the surrounding
atoll would be another. You could also use a multipolygon shape to represent a
group of disconnected but related buildings.
-
+
You can add multipolygon shapes to the map by adding them to an
`MGLShapeSource` object. Configure the appearance of an `MGLShapeSource`’s or
`MGLVectorSource`’s multipolygons collectively using an `MGLFillStyleLayer` or
`MGLSymbolStyleLayer` object.
-
+
You cannot add an `MGLMultiPolygon` object directly to a map view using
`-[MGLMapView addAnnotation:]` or `-[MGLMapView addOverlay:]`. However, you can
add the `polygons` array’s items as overlays individually.
@@ -112,7 +112,7 @@ MGL_EXPORT
/**
Creates and returns a multipolygon object consisting of the given polygons.
-
+
@param polygons The array of polygons defining the shape.
@return A new multipolygon object.
*/
diff --git a/platform/darwin/src/MGLPolygon.mm b/platform/darwin/src/MGLPolygon.mm
index 565de017cc..ceafe873bf 100644
--- a/platform/darwin/src/MGLPolygon.mm
+++ b/platform/darwin/src/MGLPolygon.mm
@@ -44,7 +44,7 @@
- (BOOL)isEqual:(id)other {
if (self == other) return YES;
if (![other isKindOfClass:[MGLPolygon class]]) return NO;
-
+
MGLPolygon *otherPolygon = (MGLPolygon *)other;
return ([super isEqual:otherPolygon] &&
[[self geoJSONDictionary] isEqualToDictionary:[otherPolygon geoJSONDictionary]]);
@@ -80,7 +80,7 @@
}
- (mbgl::Annotation)annotationObjectWithDelegate:(id <MGLMultiPointDelegate>)delegate {
-
+
mbgl::FillAnnotation annotation { [self polygon] };
annotation.opacity = { static_cast<float>([delegate alphaForShapeAnnotation:self]) };
annotation.outlineColor = { [delegate strokeColorForShapeAnnotation:self] };
@@ -115,9 +115,9 @@
- (instancetype)initWithPolygons:(NS_ARRAY_OF(MGLPolygon *) *)polygons {
if (self = [super init]) {
_polygons = polygons;
-
+
mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty();
-
+
for (MGLPolygon *polygon in _polygons) {
bounds.extend(MGLLatLngBoundsFromCoordinateBounds(polygon.overlayBounds));
}
@@ -141,7 +141,7 @@
- (BOOL)isEqual:(id)other {
if (self == other) return YES;
if (![other isKindOfClass:[MGLMultiPolygon class]]) return NO;
-
+
MGLMultiPolygon *otherMultiPolygon = other;
return [super isEqual:other]
&& [self.polygons isEqualToArray:otherMultiPolygon.polygons];
diff --git a/platform/darwin/src/MGLPolyline.h b/platform/darwin/src/MGLPolyline.h
index ca1f8e36cc..b3db0fd39f 100644
--- a/platform/darwin/src/MGLPolyline.h
+++ b/platform/darwin/src/MGLPolyline.h
@@ -14,28 +14,28 @@ NS_ASSUME_NONNULL_BEGIN
specified as `CLLocationCoordinate2D` instances, and the line segments that
connect them. For example, you could use an polyline to represent a road or the
path along which something moves.
-
+
You can add polyline shapes to the map by adding them to an `MGLShapeSource`
object. Configure the appearance of an `MGLShapeSource`’s or
`MGLVectorSource`’s polylines collectively using an `MGLLineStyleLayer` or
`MGLSymbolStyleLayer` object.
-
+
Alternatively, you can add a polyline overlay directly to a map view using the
`-[MGLMapView addAnnotation:]` or `-[MGLMapView addOverlay:]` method. Configure
a polyline overlay’s appearance using
`-[MGLMapViewDelegate mapView:strokeColorForShapeAnnotation:]` and
`-[MGLMapViewDelegate mapView:lineWidthForPolylineAnnotation:]`.
-
+
The vertices are automatically connected in the order in which you provide
them. The first and last vertices are not connected to each other, but you can
specify the same `CLLocationCoordinate2D` as the first and last vertices in
order to close the polyline. To fill the space within the shape, use an
`MGLPolygon` object. To group multiple polylines together in one shape, use an
`MGLMultiPolyline` or `MGLShapeCollection` object.
-
+
To make the polyline straddle the antimeridian, specify some longitudes less
than −180 degrees or greater than 180 degrees.
-
+
A polyline is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.4">LineString</a>
geometry in GeoJSON.
@@ -46,7 +46,7 @@ MGL_EXPORT
/**
Creates and returns an `MGLPolyline` object from the specified set of
coordinates.
-
+
@param coords The array of coordinates defining the shape. The data in this
array is copied to the new object.
@param count The number of items in the `coords` array.
@@ -61,16 +61,16 @@ MGL_EXPORT
polylines. For example, you could use a multipolyline shape to represent both
sides of a divided highway (dual carriageway), excluding the median (central
reservation): each carriageway would be a distinct `MGLPolyline` object.
-
+
You can add multipolyline shapes to the map by adding them to an
`MGLShapeSource` object. Configure the appearance of an `MGLShapeSource`’s or
`MGLVectorSource`’s multipolylines collectively using an `MGLLineStyleLayer` or
`MGLSymbolStyleLayer` object.
-
+
You cannot add an `MGLMultiPolyline` object directly to a map view using
`-[MGLMapView addAnnotation:]` or `-[MGLMapView addOverlay:]`. However, you can
add the `polylines` array’s items as overlays individually.
-
+
A multipolyline is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.5">MultiLineString</a>
geometry in GeoJSON.
@@ -85,7 +85,7 @@ MGL_EXPORT
/**
Creates and returns a multipolyline object consisting of the given polylines.
-
+
@param polylines The array of polylines defining the shape.
@return A new multipolyline object.
*/
diff --git a/platform/darwin/src/MGLPolyline.mm b/platform/darwin/src/MGLPolyline.mm
index e6b1cdebf6..454a1b964b 100644
--- a/platform/darwin/src/MGLPolyline.mm
+++ b/platform/darwin/src/MGLPolyline.mm
@@ -20,13 +20,13 @@
- (mbgl::LineString<double>)lineString {
NSUInteger count = self.pointCount;
CLLocationCoordinate2D *coordinates = self.coordinates;
-
+
mbgl::LineString<double> geometry;
geometry.reserve(self.pointCount);
for (NSUInteger i = 0; i < count; i++) {
geometry.push_back(mbgl::Point<double>(coordinates[i].longitude, coordinates[i].latitude));
}
-
+
return geometry;
}
@@ -69,9 +69,9 @@
- (instancetype)initWithPolylines:(NS_ARRAY_OF(MGLPolyline *) *)polylines {
if (self = [super init]) {
_polylines = polylines;
-
+
mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty();
-
+
for (MGLPolyline *polyline in _polylines) {
bounds.extend(MGLLatLngBoundsFromCoordinateBounds(polyline.overlayBounds));
}
@@ -96,7 +96,7 @@
{
if (self == other) return YES;
if (![other isKindOfClass:[MGLMultiPolyline class]]) return NO;
-
+
MGLMultiPolyline *otherMultipoline = other;
return ([super isEqual:otherMultipoline]
&& [self.polylines isEqualToArray:otherMultipoline.polylines]);
@@ -127,7 +127,7 @@
NSMutableArray *coordinates = [NSMutableArray array];
for (MGLPolylineFeature *feature in self.polylines) {
[coordinates addObject: feature.mgl_coordinates];
- }
+ }
return @{@"type": @"MultiLineString",
@"coordinates": coordinates};
}
diff --git a/platform/darwin/src/MGLRasterSource.h b/platform/darwin/src/MGLRasterSource.h
index ac5be60105..694a818246 100644
--- a/platform/darwin/src/MGLRasterSource.h
+++ b/platform/darwin/src/MGLRasterSource.h
@@ -10,12 +10,12 @@ NS_ASSUME_NONNULL_BEGIN
width and height (measured in points) at which the map displays each raster
image tile when the map’s zoom level is an integer. The raster source scales
its images up or down when the map’s zoom level falls between two integers.
-
+
The default value for this option is 512. Version 4 of the
<a href="https://www.mapbox.com/api-documentation/#maps">Mapbox Maps API</a>
requires a value of 256, as do many third-party tile servers, so consult your
provider’s documentation for the correct value.
-
+
This option is only applicable to `MGLRasterSource` objects; it is ignored when
initializing `MGLVectorSource` objects.
*/
@@ -29,16 +29,16 @@ extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionTileSize;
A raster source is added to an `MGLStyle` object along with one or more
`MGLRasterStyleLayer` objects. Use a raster style layer to control the
appearance of content supplied by the raster source.
-
+
Each
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-raster"><code>raster</code></a>
source defined by the style JSON file is represented at runtime by an
`MGLRasterSource` object that you can use to initialize new style layers. You
can also add and remove sources dynamically using methods such as
`-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`.
-
+
### Example
-
+
```swift
let source = MGLRasterSource(identifier: "clouds", tileURLTemplates: ["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [
.minimumZoomLevel: 9,
@@ -58,21 +58,21 @@ MGL_EXPORT
/**
Returns a raster source initialized with an identifier and configuration URL.
-
+
After initializing and configuring the source, add it to a map view’s style
using the `-[MGLStyle addSource:]` method.
-
+
The URL may be a full HTTP or HTTPS URL or, for tile sets hosted by Mapbox, a
Mapbox URL indicating a map identifier (`mapbox://<mapid>`). The URL should
point to a JSON file that conforms to the
<a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>.
-
+
If a Mapbox URL is specified, this source uses a tile size of 256. For all
other tile sets, the default value is 512. (See the
`MGLTileSourceOptionTileSize` documentation for more information about tile
sizes.) If you need to use a tile size other than the default, use the
`-initWithIdentifier:configurationURL:tileSize:` method.
-
+
@param identifier A string that uniquely identifies the source in the style to
which it is added.
@param configurationURL A URL to a TileJSON configuration file describing the
@@ -84,15 +84,15 @@ MGL_EXPORT
/**
Returns a raster source initialized with an identifier, configuration URL, and
tile size.
-
+
After initializing and configuring the source, add it to a map view’s style
using the `-[MGLStyle addSource:]` method.
-
+
The URL may be a full HTTP or HTTPS URL or, for tile sets hosted by Mapbox, a
Mapbox URL indicating a map identifier (`mapbox://<mapid>`). The URL should
point to a JSON file that conforms to the
<a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>.
-
+
@param identifier A string that uniquely identifies the source in the style to
which it is added.
@param configurationURL A URL to a TileJSON configuration file describing the
diff --git a/platform/darwin/src/MGLRasterSource.mm b/platform/darwin/src/MGLRasterSource.mm
index fd36413fe0..ccd5212b2a 100644
--- a/platform/darwin/src/MGLRasterSource.mm
+++ b/platform/darwin/src/MGLRasterSource.mm
@@ -50,7 +50,7 @@ static const CGFloat MGLRasterSourceRetinaTileSize = 512;
- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NS_ARRAY_OF(NSString *) *)tileURLTemplates options:(nullable NS_DICTIONARY_OF(MGLTileSourceOption, id) *)options {
if (self = [super initWithIdentifier:identifier tileURLTemplates:tileURLTemplates options:options]) {
mbgl::Tileset tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, options);
-
+
uint16_t tileSize = MGLRasterSourceRetinaTileSize;
if (NSNumber *tileSizeNumber = options[MGLTileSourceOptionTileSize]) {
if (![tileSizeNumber isKindOfClass:[NSNumber class]]) {
@@ -59,7 +59,7 @@ static const CGFloat MGLRasterSourceRetinaTileSize = 512;
}
tileSize = static_cast<uint16_t>(round(tileSizeNumber.doubleValue));
}
-
+
auto source = std::make_unique<mbgl::style::RasterSource>(identifier.UTF8String, tileSet, tileSize);
_pendingSource = std::move(source);
self.rawSource = _pendingSource.get();
diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h
index cd57a74f6a..d2b887d56f 100644
--- a/platform/darwin/src/MGLRasterStyleLayer.h
+++ b/platform/darwin/src/MGLRasterStyleLayer.h
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLFoundation.h"
@@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
An `MGLRasterStyleLayer` is a style layer that renders raster tiles on the map.
-
+
Use a raster style layer to configure the color parameters of raster tiles
loaded by an `MGLRasterSource` object. For example, you could use a raster
style layer to render <a href="https://www.mapbox.com/satellite/">Mapbox
@@ -18,15 +18,15 @@ NS_ASSUME_NONNULL_BEGIN
set</a> uploaded to Mapbox Studio, or a raster map authored in <a
href="https://tilemill-project.github.io/tilemill/">TileMill</a>, the classic
Mapbox Editor, or Mapbox Studio Classic.
-
+
You can access an existing raster style layer using the
`-[MGLStyle layerWithIdentifier:]` method if you know its identifier;
otherwise, find it using the `MGLStyle.layers` property. You can also create a
new raster style layer and add it to the style using a method such as
`-[MGLStyle addLayer:]`.
-
+
### Example
-
+
```swift
let layer = MGLRasterStyleLayer(identifier: "clouds", source: source)
layer.rasterOpacity = MGLStyleValue(rawValue: 0.5)
@@ -41,11 +41,11 @@ MGL_EXPORT
/**
Increase or reduce the brightness of the image. The value is the maximum
brightness.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-raster-brightness-max"><code>raster-brightness-max</code></a>
layout property in the Mapbox Style Specification.
@@ -57,11 +57,11 @@ MGL_EXPORT
/**
Increase or reduce the brightness of the image. The value is the minimum
brightness.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-raster-brightness-min"><code>raster-brightness-min</code></a>
layout property in the Mapbox Style Specification.
@@ -72,7 +72,7 @@ MGL_EXPORT
/**
Increase or reduce the contrast of the image.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
@@ -81,9 +81,9 @@ MGL_EXPORT
/**
Fade duration when a new tile is added.
-
+
This property is measured in milliseconds.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `300`. Set this property to `nil` to
reset it to the default value.
@@ -92,13 +92,13 @@ MGL_EXPORT
/**
Rotates hues around the color wheel.
-
+
This property is measured in degrees.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-raster-hue-rotate"><code>raster-hue-rotate</code></a>
layout property in the Mapbox Style Specification.
@@ -109,7 +109,7 @@ MGL_EXPORT
/**
The opacity at which the image will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
@@ -118,7 +118,7 @@ MGL_EXPORT
/**
Increase or reduce the saturation of the image.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
diff --git a/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/darwin/src/MGLRasterStyleLayer.mm
index 87afb8da9d..1e0b1602f5 100644
--- a/platform/darwin/src/MGLRasterStyleLayer.mm
+++ b/platform/darwin/src/MGLRasterStyleLayer.mm
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
@@ -45,7 +45,7 @@
- (NSString *)sourceIdentifier
{
MGLAssertStyleLayerIsValid();
-
+
return @(self.rawLayer->getSourceID().c_str());
}
diff --git a/platform/darwin/src/MGLShape.h b/platform/darwin/src/MGLShape.h
index d1c150d02e..bd8b6152d2 100644
--- a/platform/darwin/src/MGLShape.h
+++ b/platform/darwin/src/MGLShape.h
@@ -9,19 +9,19 @@ NS_ASSUME_NONNULL_BEGIN
`MGLShape` is an abstract class that represents a shape or annotation. Shapes
constitute the content of a map – not only the overlays atop the map, but also
the content that forms the base map.
-
+
You do not create instances of this class directly or create subclasses of this
- class. Instead, you create instances of `MGLPointAnnotation`,
+ class. Instead, you create instances of `MGLPointAnnotation`,
`MGLPointCollection`, `MGLPolyline`, `MGLMultiPolyline`, `MGLPolygon`,
`MGLMultiPolygon`, or `MGLShapeCollection`. The shape classes correspond to the
<a href="https://tools.ietf.org/html/rfc7946#section-3.1">Geometry</a> object
types in the GeoJSON standard, but some have nonstandard names for backwards
compatibility.
-
+
Although you do not create instances of this class directly, you can use its
`+[MGLShape shapeWithData:encoding:error:]` factory method to create one of the
concrete subclasses of `MGLShape` noted above from GeoJSON data.
-
+
You can add shapes to the map by adding them to an `MGLShapeSource` object.
Configure the appearance of an `MGLShapeSource`’s or `MGLVectorSource`’s shapes
collectively using a concrete instance of `MGLVectorStyleLayer`. Alternatively,
@@ -36,21 +36,21 @@ MGL_EXPORT
/**
Returns an `MGLShape` object initialized with the given data interpreted as a
string containing a GeoJSON object.
-
+
If the GeoJSON object is a geometry, the returned value is a kind of
`MGLShape`. If it is a feature object, the returned value is a kind of
`MGLShape` that conforms to the `MGLFeature` protocol. If it is a feature
collection object, the returned value is an instance of
`MGLShapeCollectionFeature`.
-
+
### Example
-
+
```swift
let url = mainBundle.url(forResource: "amsterdam", withExtension: "geojson")!
let data = try! Data(contentsOf: url)
let feature = try! MGLShape(data: data, encoding: String.Encoding.utf8.rawValue) as! MGLShapeCollectionFeature
```
-
+
@param data String data containing GeoJSON source code.
@param encoding The encoding used by `data`.
@param outError Upon return, if an error has occurred, a pointer to an
@@ -65,9 +65,9 @@ MGL_EXPORT
/**
The title of the shape annotation.
-
+
The default value of this property is `nil`.
-
+
This property is ignored when the shape is used in an `MGLShapeSource`. To name
a shape used in a shape source, create an `MGLFeature` and add an attribute to
the `MGLFeature.attributes` property.
@@ -77,7 +77,7 @@ MGL_EXPORT
/**
The subtitle of the shape annotation. The default value of this property is
`nil`.
-
+
This property is ignored when the shape is used in an `MGLShapeSource`. To
provide additional information about a shape used in a shape source, create an
`MGLFeature` and add an attribute to the `MGLFeature.attributes` property.
@@ -88,9 +88,9 @@ MGL_EXPORT
/**
The tooltip of the shape annotation.
-
+
The default value of this property is `nil`.
-
+
This property is ignored when the shape is used in an `MGLShapeSource`.
*/
@property (nonatomic, copy, nullable) NSString *toolTip;
@@ -102,7 +102,7 @@ MGL_EXPORT
/**
Returns the GeoJSON string representation of the shape encapsulated in a data
object.
-
+
@param encoding The string encoding to use.
@return A data object containing the shape’s GeoJSON string representation.
*/
diff --git a/platform/darwin/src/MGLShape.mm b/platform/darwin/src/MGLShape.mm
index 984235fd97..e76e06c7e4 100644
--- a/platform/darwin/src/MGLShape.mm
+++ b/platform/darwin/src/MGLShape.mm
@@ -21,7 +21,7 @@ bool operator==(const CLLocationCoordinate2D lhs, const CLLocationCoordinate2D r
}
return nil;
}
-
+
try {
const auto geojson = mapbox::geojson::parse(string.UTF8String);
return MGLShapeFromGeoJSON(geojson);
@@ -81,7 +81,7 @@ bool operator==(const CLLocationCoordinate2D lhs, const CLLocationCoordinate2D r
{
if (other == self) { return YES; }
id <MGLAnnotation> annotation = other;
-
+
#if TARGET_OS_IPHONE
return ((!_title && ![annotation title]) || [_title isEqualToString:[annotation title]])
&& ((!_subtitle && ![annotation subtitle]) || [_subtitle isEqualToString:[annotation subtitle]]);
diff --git a/platform/darwin/src/MGLShapeCollection.h b/platform/darwin/src/MGLShapeCollection.h
index 79b7e9223a..bb107ee7f0 100644
--- a/platform/darwin/src/MGLShapeCollection.h
+++ b/platform/darwin/src/MGLShapeCollection.h
@@ -11,26 +11,26 @@ NS_ASSUME_NONNULL_BEGIN
An `MGLShapeCollection` object represents a shape consisting of zero or more
distinct but related shapes that are instances of `MGLShape`. The constituent
shapes can be a mixture of different kinds of shapes.
-
+
`MGLShapeCollection` is most commonly used to add multiple shapes to a single
`MGLShapeSource`. Configure the appearance of an `MGLShapeSource`’s or
`MGLVectorSource`’s shape collection collectively using an
`MGLSymbolStyleLayer` object, or use multiple instances of
`MGLCircleStyleLayer`, `MGLFillStyleLayer`, and `MGLLineStyleLayer` to
configure the appearance of each kind of shape inside the collection.
-
+
You cannot add an `MGLShapeCollection` object directly to a map view as an
annotation. However, you can create individual `MGLPointAnnotation`,
`MGLPolyline`, and `MGLPolygon` objects from the `shapes` array and add those
annotation objects to the map view using the `-[MGLMapView addAnnotations:]`
method.
-
+
To represent a collection of point, polyline, or polygon shapes, it may be more
convenient to use an `MGLPointCollection`, `MGLMultiPolyline`, or
`MGLMultiPolygon` object, respectively.
-
- A shape collection is known as a
- <a href="https://tools.ietf.org/html/rfc7946#section-3.1.8">GeometryCollection</a>
+
+ A shape collection is known as a
+ <a href="https://tools.ietf.org/html/rfc7946#section-3.1.8">GeometryCollection</a>
geometry in GeoJSON.
*/
MGL_EXPORT
@@ -43,7 +43,7 @@ MGL_EXPORT
/**
Creates and returns a shape collection consisting of the given shapes.
-
+
@param shapes The array of shapes defining the shape collection. The data in
this array is copied to the new object.
@return A new shape collection object.
diff --git a/platform/darwin/src/MGLShapeCollection.mm b/platform/darwin/src/MGLShapeCollection.mm
index 4b468a1cbb..03cab0043f 100644
--- a/platform/darwin/src/MGLShapeCollection.mm
+++ b/platform/darwin/src/MGLShapeCollection.mm
@@ -32,7 +32,7 @@
- (BOOL)isEqual:(id)other {
if (self == other) return YES;
if (![other isKindOfClass:[MGLShapeCollection class]]) return NO;
-
+
MGLShapeCollection *otherShapeCollection = other;
return [super isEqual:otherShapeCollection]
&& [_shapes isEqualToArray:otherShapeCollection.shapes];
diff --git a/platform/darwin/src/MGLShapeSource.h b/platform/darwin/src/MGLShapeSource.h
index 54c5668260..24cdf82bea 100644
--- a/platform/darwin/src/MGLShapeSource.h
+++ b/platform/darwin/src/MGLShapeSource.h
@@ -21,7 +21,7 @@ typedef NSString *MGLShapeSourceOption NS_STRING_ENUM;
This attribute corresponds to the
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson-cluster"><code>cluster</code></a>
source property in the Mapbox Style Specification.
-
+
This option only affects point features within a shape source.
*/
extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClustered;
@@ -35,7 +35,7 @@ extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionClusterRadius;
/**
An `NSNumber` object containing an integer; specifies the maximum zoom level at
- which to cluster points if clustering is enabled. Defaults to one zoom level
+ which to cluster points if clustering is enabled. Defaults to one zoom level
less than the value of `MGLShapeSourceOptionMaximumZoomLevel` so that, at the
maximum zoom level, the shapes are not clustered.
@@ -58,8 +58,8 @@ extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionMaximumZoomLeve
/**
An `NSNumber` object containing an integer; specifies the size of the tile
- buffer on each side. A value of 0 produces no buffer. A value of 512 produces a
- buffer as wide as the tile itself. Larger values produce fewer rendering
+ buffer on each side. A value of 0 produces no buffer. A value of 512 produces a
+ buffer as wide as the tile itself. Larger values produce fewer rendering
artifacts near tile edges and slower performance. The default value is 128.
This attribute corresponds to the
@@ -86,7 +86,7 @@ extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionSimplificationT
<a href="http://geojson.org/">GeoJSON</a> code. A shape source is added to an
`MGLStyle` object along with an `MGLVectorStyleLayer` object. The vector style
layer defines the appearance of any content supplied by the shape source.
-
+
Each
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-geojson"><code>geojson</code></a>
source defined by the style JSON file is represented at runtime by an
@@ -94,12 +94,12 @@ extern MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionSimplificationT
initialize new style layers. You can also add and remove sources dynamically
using methods such as `-[MGLStyle addSource:]` and
`-[MGLStyle sourceWithIdentifier:]`.
-
+
Any vector style layer initialized with a shape source should have a `nil`
value in its `sourceLayerIdentifier` property.
-
+
### Example
-
+
```swift
var coordinates: [CLLocationCoordinate2D] = [
CLLocationCoordinate2D(latitude: 37.77, longitude: -122.42),
@@ -118,7 +118,7 @@ MGL_EXPORT
/**
Returns a shape source with an identifier, URL, and dictionary of options for
the source.
-
+
@param identifier A string that uniquely identifies the source.
@param url An HTTP(S) URL, absolute file URL, or local file URL relative to the
current application’s resource bundle.
@@ -130,17 +130,17 @@ MGL_EXPORT
/**
Returns a shape source with an identifier, a shape, and dictionary of options
for the source.
-
+
To specify attributes about the shape, use an instance of an `MGLShape`
subclass that conforms to the `MGLFeature` protocol, such as `MGLPointFeature`.
To include multiple shapes in the source, use an `MGLShapeCollection` or
`MGLShapeCollectionFeature` object, or use the
- `-initWithIdentifier:features:options:` or
+ `-initWithIdentifier:features:options:` or
`-initWithIdentifier:shapes:options:` methods.
-
+
To create a shape from GeoJSON source code, use the
`+[MGLShape shapeWithData:encoding:error:]` method.
-
+
@param identifier A string that uniquely identifies the source.
@param shape A concrete subclass of `MGLShape`
@param options An `NSDictionary` of options for this source.
@@ -151,7 +151,7 @@ MGL_EXPORT
/**
Returns a shape source with an identifier, an array of features, and a dictionary
of options for the source.
-
+
Unlike `-initWithIdentifier:shapes:options:`, this method accepts `MGLFeature`
instances, such as `MGLPointFeature` objects, whose attributes you can use when
applying a predicate to `MGLVectorStyleLayer` or configuring a style layer’s
@@ -170,11 +170,11 @@ MGL_EXPORT
/**
Returns a shape source with an identifier, an array of shapes, and a dictionary of
options for the source.
-
+
Any `MGLFeature` instance passed into this initializer is treated as an ordinary
shape, causing any attributes to be inaccessible to an `MGLVectorStyleLayer` when
- evaluating a predicate or configuring certain layout or paint attributes. To
- preserve the attributes associated with each feature, use the
+ evaluating a predicate or configuring certain layout or paint attributes. To
+ preserve the attributes associated with each feature, use the
`-initWithIdentifier:features:options:` method instead.
To create a shape from GeoJSON source code, use the
@@ -196,8 +196,8 @@ MGL_EXPORT
If the receiver was initialized using `-initWithIdentifier:URL:options:`, this
property is set to `nil`. This property is unavailable until the receiver is
passed into `-[MGLStyle addSource:]`.
-
- You can get/set the shapes within a collection via this property. Actions must
+
+ You can get/set the shapes within a collection via this property. Actions must
be performed on the application's main thread.
*/
@property (nonatomic, copy, nullable) MGLShape *shape;
diff --git a/platform/darwin/src/MGLShapeSource.mm b/platform/darwin/src/MGLShapeSource.mm
index 245b7f2de2..07033d8d45 100644
--- a/platform/darwin/src/MGLShapeSource.mm
+++ b/platform/darwin/src/MGLShapeSource.mm
@@ -34,10 +34,10 @@ const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance = @"MGLSh
if (self = [super initWithIdentifier:identifier]) {
auto geoJSONOptions = MGLGeoJSONOptionsFromDictionary(options);
auto source = std::make_unique<mbgl::style::GeoJSONSource>(identifier.UTF8String, geoJSONOptions);
-
+
_pendingSource = std::move(source);
self.rawSource = _pendingSource.get();
-
+
self.URL = url;
}
return self;
@@ -47,10 +47,10 @@ const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance = @"MGLSh
if (self = [super initWithIdentifier:identifier]) {
auto geoJSONOptions = MGLGeoJSONOptionsFromDictionary(options);
auto source = std::make_unique<mbgl::style::GeoJSONSource>(identifier.UTF8String, geoJSONOptions);
-
+
_pendingSource = std::move(source);
self.rawSource = _pendingSource.get();
-
+
self.shape = shape;
}
return self;
@@ -128,7 +128,7 @@ const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance = @"MGLSh
mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NS_DICTIONARY_OF(MGLShapeSourceOption, id) *options) {
auto geoJSONOptions = mbgl::style::GeoJSONOptions();
-
+
if (NSNumber *value = options[MGLShapeSourceOptionMaximumZoomLevel]) {
if (![value isKindOfClass:[NSNumber class]]) {
[NSException raise:NSInvalidArgumentException
@@ -136,7 +136,7 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NS_DICTIONARY_OF(MGL
}
geoJSONOptions.maxzoom = value.integerValue;
}
-
+
if (NSNumber *value = options[MGLShapeSourceOptionBuffer]) {
if (![value isKindOfClass:[NSNumber class]]) {
[NSException raise:NSInvalidArgumentException
@@ -144,7 +144,7 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NS_DICTIONARY_OF(MGL
}
geoJSONOptions.buffer = value.integerValue;
}
-
+
if (NSNumber *value = options[MGLShapeSourceOptionSimplificationTolerance]) {
if (![value isKindOfClass:[NSNumber class]]) {
[NSException raise:NSInvalidArgumentException
@@ -152,7 +152,7 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NS_DICTIONARY_OF(MGL
}
geoJSONOptions.tolerance = value.doubleValue;
}
-
+
if (NSNumber *value = options[MGLShapeSourceOptionClusterRadius]) {
if (![value isKindOfClass:[NSNumber class]]) {
[NSException raise:NSInvalidArgumentException
@@ -160,7 +160,7 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NS_DICTIONARY_OF(MGL
}
geoJSONOptions.clusterRadius = value.integerValue;
}
-
+
if (NSNumber *value = options[MGLShapeSourceOptionMaximumZoomLevelForClustering]) {
if (![value isKindOfClass:[NSNumber class]]) {
[NSException raise:NSInvalidArgumentException
@@ -168,7 +168,7 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NS_DICTIONARY_OF(MGL
}
geoJSONOptions.clusterMaxZoom = value.integerValue;
}
-
+
if (NSNumber *value = options[MGLShapeSourceOptionClustered]) {
if (![value isKindOfClass:[NSNumber class]]) {
[NSException raise:NSInvalidArgumentException
@@ -176,6 +176,6 @@ mbgl::style::GeoJSONOptions MGLGeoJSONOptionsFromDictionary(NS_DICTIONARY_OF(MGL
}
geoJSONOptions.cluster = value.boolValue;
}
-
+
return geoJSONOptions;
}
diff --git a/platform/darwin/src/MGLSource.h b/platform/darwin/src/MGLSource.h
index 7b3242e3ae..8bf48907cc 100644
--- a/platform/darwin/src/MGLSource.h
+++ b/platform/darwin/src/MGLSource.h
@@ -10,12 +10,12 @@ NS_ASSUME_NONNULL_BEGIN
`MGLStyle` object along with an `MGLForegroundStyleLayer` object. The
foreground style layer defines the appearance of any content supplied by the
source.
-
+
Each source defined by the style JSON file is represented at runtime by an
`MGLSource` object that you can use to refine the map’s content. You can also
add and remove sources dynamically using methods such as
`-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`.
-
+
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of `MGLShapeSource` and the
concrete subclasses of `MGLTileSource`, `MGLVectorSource` and `MGLRasterSource`.
@@ -29,10 +29,10 @@ MGL_EXPORT
/**
Returns a source initialized with an identifier.
-
+
After initializing and configuring the source, add it to a map view’s style
using the `-[MGLStyle addSource:]` method.
-
+
@param identifier A string that uniquely identifies the source in the style to
which it is added.
@return An initialized source.
diff --git a/platform/darwin/src/MGLSource_Private.h b/platform/darwin/src/MGLSource_Private.h
index 6e1d2e379c..acb325e2f3 100644
--- a/platform/darwin/src/MGLSource_Private.h
+++ b/platform/darwin/src/MGLSource_Private.h
@@ -18,29 +18,29 @@ namespace mbgl {
- (instancetype)initWithRawSource:(mbgl::style::Source *)rawSource;
/**
- A raw pointer to the mbgl object, which is always initialized, either to the
+ A raw pointer to the mbgl object, which is always initialized, either to the
value returned by `mbgl::Map getSource`, or for independently created objects,
to the pointer value held in `pendingSource`. In the latter case, this raw
- pointer value stays even after ownership of the object is transferred via
+ pointer value stays even after ownership of the object is transferred via
`mbgl::Map addSource`.
*/
@property (nonatomic) mbgl::style::Source *rawSource;
/**
Adds the mbgl source that this object represents to the mbgl map.
-
+
Once a mbgl source is added, ownership of the object is transferred to the
`mbgl::Map` and this object no longer has an active unique_ptr reference to the
- `mbgl::Source`. If this object's mbgl source is in that state, the mbgl source
- can still be changed but the changes will not be visible until the `MGLSource`
- is added back to the map via `-[MGLStyle addSource:]` and styled with a
+ `mbgl::Source`. If this object's mbgl source is in that state, the mbgl source
+ can still be changed but the changes will not be visible until the `MGLSource`
+ is added back to the map via `-[MGLStyle addSource:]` and styled with a
`MGLLayer`.
*/
- (void)addToMapView:(MGLMapView *)mapView;
/**
Removes the mbgl source that this object represents from the mbgl map.
-
+
When a mbgl source is removed, ownership of the object is transferred back
to the `MGLSource` instance and the unique_ptr reference is valid again. It is
safe to add the source back to the style after it is removed.
diff --git a/platform/darwin/src/MGLStyle.h b/platform/darwin/src/MGLStyle.h
index f11810fb65..567345a798 100644
--- a/platform/darwin/src/MGLStyle.h
+++ b/platform/darwin/src/MGLStyle.h
@@ -32,16 +32,16 @@ static MGL_EXPORT const NSInteger MGLStyleDefaultVersion = 9;
/**
The proxy object for the current map style.
-
+
MGLStyle provides a set of convenience methods for changing Mapbox
default styles using `-[MGLMapView styleURL]`.
<a href="https://www.mapbox.com/maps/">Learn more about Mapbox default styles</a>.
-
- It is also possible to directly manipulate the current map style
+
+ It is also possible to directly manipulate the current map style
via `-[MGLMapView style]` by updating the style's data sources or layers.
-
+
@note Wait until the map style has finished loading before modifying a map's
- style via any of the `MGLStyle` instance methods below. You can use the
+ style via any of the `MGLStyle` instance methods below. You can use the
`-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or
`-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` methods as indicators
that it's safe to modify the map's style.
@@ -211,15 +211,15 @@ MGL_EXPORT
/**
Adds a new source to the current style.
-
+
@note Adding the same source instance more than once will result in a
`MGLRedundantSourceException`. Reusing the same source identifier, even with
- different source instances, will result in a
- `MGLRedundantSourceIdentifierException`.
-
- @note Sources should be added in
+ different source instances, will result in a
+ `MGLRedundantSourceIdentifierException`.
+
+ @note Sources should be added in
`-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or
- `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map
+ `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map
has loaded the style and is ready to accept a new source.
@param source The source to add to the current style.
@@ -228,7 +228,7 @@ MGL_EXPORT
/**
Removes a source from the current style.
-
+
@note Source identifiers are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must first set the
style URL to an explicitly versioned style using a convenience method like
@@ -251,7 +251,7 @@ MGL_EXPORT
/**
Returns a style layer with the given identifier in the current style.
-
+
@note Layer identifiers are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must first set
the style URL to an explicitly versioned style using a convenience method like
@@ -259,7 +259,7 @@ MGL_EXPORT
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the default
style’s layers over time.
-
+
@return An instance of a concrete subclass of `MGLStyleLayer` associated with
the given identifier, or `nil` if the current style contains no such style
layer.
@@ -268,14 +268,14 @@ MGL_EXPORT
/**
Adds a new layer on top of existing layers.
-
+
@note Adding the same layer instance more than once will result in a
`MGLRedundantLayerException`. Reusing the same layer identifer, even with
- different layer instances, will also result in an exception.
-
- @note Layers should be added in
+ different layer instances, will also result in an exception.
+
+ @note Layers should be added in
`-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or
- `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map
+ `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map
has loaded the style and is ready to accept a new layer.
@param layer The layer object to add to the map view. This object must be an
@@ -285,14 +285,14 @@ MGL_EXPORT
/**
Inserts a new layer into the style at the given index.
-
+
@note Adding the same layer instance more than once will result in a
`MGLRedundantLayerException`. Reusing the same layer identifer, even with
- different layer instances, will also result in an exception.
-
+ different layer instances, will also result in an exception.
+
@note Layers should be added in
`-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or
- `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map
+ `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map
has loaded the style and is ready to accept a new layer.
@param layer The layer to insert.
@@ -304,7 +304,7 @@ MGL_EXPORT
/**
Inserts a new layer below another layer.
-
+
@note Layer identifiers are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must first set
the style URL to an explicitly versioned style using a convenience method like
@@ -312,7 +312,7 @@ MGL_EXPORT
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the default
style’s layers over time.
-
+
Inserting the same layer instance more than once will result in a
`MGLRedundantLayerException`. Reusing the same layer identifer, even with
different layer instances, will also result in an exception.
@@ -324,7 +324,7 @@ MGL_EXPORT
/**
Inserts a new layer above another layer.
-
+
@note Layer identifiers are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must first set
the style URL to an explicitly versioned style using a convenience method like
@@ -332,7 +332,7 @@ MGL_EXPORT
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the default
style’s layers over time.
-
+
Inserting the same layer instance more than once will result in a
`MGLRedundantLayerException`. Reusing the same layer identifer, even with
different layer instances, will also result in an exception.
@@ -344,7 +344,7 @@ MGL_EXPORT
/**
Removes a layer from the map view.
-
+
@note Layer identifiers are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must first set
the style URL to an explicitly versioned style using a convenience method like
@@ -383,7 +383,7 @@ MGL_EXPORT
/**
Deactivates the style class with the given identifier.
-
+
@note Style class names are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must first set the
style URL to an explicitly versioned style using a convenience method like
@@ -400,15 +400,15 @@ MGL_EXPORT
/**
Returns the image associated with the given name in the style.
-
+
@note Names and their associated images are not guaranteed to exist across
styles or different versions of the same style. Applications that use this
API must first set the style URL to an explicitly versioned style using a
convenience method like `+[MGLStyle outdoorsStyleURLWithVersion:]`,
`MGLMapView`'s “Style URL” inspectable in Interface Builder, or a manually
- constructed `NSURL`. This approach also avoids image name changes that will
+ constructed `NSURL`. This approach also avoids image name changes that will
occur in the default style over time.
-
+
@param name The name associated with the image you want to obtain.
@return The image associated with the given name, or `nil` if no image is
associated with that name.
@@ -417,11 +417,11 @@ MGL_EXPORT
/**
Adds or overrides an image used by the style’s layers.
-
+
To use an image in a style layer, give it a unique name using this method, then
set the `iconImageName` property of an `MGLSymbolStyleLayer` object to that
name.
-
+
@param image The image for the name.
@param name The name of the image to set to the style.
*/
@@ -429,13 +429,13 @@ MGL_EXPORT
/**
Removes a name and its associated image from the style.
-
+
@note Names and their associated images are not guaranteed to exist across
styles or different versions of the same style. Applications that use this
API must first set the style URL to an explicitly versioned style using a
convenience method like `+[MGLStyle outdoorsStyleURLWithVersion:]`,
`MGLMapView`'s “Style URL” inspectable in Interface Builder, or a manually
- constructed `NSURL`. This approach also avoids image name changes that will
+ constructed `NSURL`. This approach also avoids image name changes that will
occur in the default style over time.
@param name The name of the image to remove.
@@ -446,7 +446,7 @@ MGL_EXPORT
/**
The duration in seconds to animate any changes to the style URL or to layout and paint attributes.
-
+
By default, this property is set to zero seconds, so any changes take effect without animation.
*/
@property (nonatomic) NSTimeInterval transitionDuration;
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm
index 78c719050c..bcb8100800 100644
--- a/platform/darwin/src/MGLStyle.mm
+++ b/platform/darwin/src/MGLStyle.mm
@@ -217,7 +217,7 @@ static NSURL *MGLStyleURL_emerald;
if (![source isKindOfClass:[MGLTileSource class]]) {
continue;
}
-
+
NSArray *tileSetInfos = [source attributionInfosWithFontSize:fontSize linkColor:linkColor];
[infos growArrayByAddingAttributionInfosFromArray:tileSetInfos];
}
@@ -321,7 +321,7 @@ static NSURL *MGLStyleURL_emerald;
- (MGLStyleLayer *)layerFromMBGLLayer:(mbgl::style::Layer *)mbglLayer
{
NSParameterAssert(mbglLayer);
-
+
NSString *identifier = @(mbglLayer->getID().c_str());
MGLStyleLayer *styleLayer;
if (auto fillLayer = mbglLayer->as<mbgl::style::FillLayer>()) {
@@ -438,7 +438,7 @@ static NSURL *MGLStyleURL_emerald;
@"Make sure sibling was obtained using -[MGLStyle layerWithIdentifier:].",
sibling];
}
-
+
auto layers = self.mapView.mbglMap->getLayers();
std::string siblingIdentifier = sibling.identifier.UTF8String;
NSUInteger index = 0;
@@ -448,7 +448,7 @@ static NSURL *MGLStyleURL_emerald;
}
index++;
}
-
+
[self willChangeValueForKey:@"layers"];
if (index + 1 > layers.size()) {
[NSException raise:NSInvalidArgumentException
diff --git a/platform/darwin/src/MGLStyleLayer.h b/platform/darwin/src/MGLStyleLayer.h
index d882ced6e6..55f1a56490 100644
--- a/platform/darwin/src/MGLStyleLayer.h
+++ b/platform/darwin/src/MGLStyleLayer.h
@@ -9,11 +9,11 @@ NS_ASSUME_NONNULL_BEGIN
`MGLStyleLayer` is an abstract base class for style layers. A style layer
manages the layout and appearance of content at a specific z-index in a style.
An `MGLStyle` object consists of one or more `MGLStyleLayer` objects.
-
+
Each style layer defined by the style JSON file is represented at runtime by an
`MGLStyleLayer` object, which you can use to refine the map’s appearance. You
can also add and remove style layers dynamically.
-
+
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of
`MGLBackgroundStyleLayer` and the concrete subclasses of
@@ -28,16 +28,16 @@ MGL_EXPORT
/**
Returns a style layer object initialized with the given identifier.
-
+
The default implementation of this initializer in MGLStyleLayer creates an
invalid style layer. Call this initializer on `MGLBackgroundStyleLayer` or one of
the concrete subclasses of `MGLForegroundStyleLayer` to create a valid style
layer.
-
+
After initializing and configuring the style layer, add it to a map view’s
style using the `-[MGLStyle addLayer:]` or
- `-[MGLStyle insertLayer:belowLayer:]` method.
-
+ `-[MGLStyle insertLayer:belowLayer:]` method.
+
@param identifier A string that uniquely identifies the layer in the style to
which it is added.
@return An initialized style layer.
diff --git a/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/darwin/src/MGLStyleLayer.h.ejs
index 8ffed66b54..f0a4ba64a3 100644
--- a/platform/darwin/src/MGLStyleLayer.h.ejs
+++ b/platform/darwin/src/MGLStyleLayer.h.ejs
@@ -5,7 +5,7 @@
const paintProperties = locals.paintProperties;
const enumProperties = locals.enumProperties;
-%>
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLFoundation.h"
@@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
<% if (property.type == "enum") { -%>
/**
<%- propertyDoc(property.name, property, type, 'enum').wrap(80, 1) %>
-
+
Values of this type are used in the `MGL<%- camelize(type) %>StyleLayer.<%- camelizeWithLeadingLowercase(property.name) %>`
property.
*/
@@ -41,7 +41,7 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(property.name) %>) {
<% if (property.type == "enum") { -%>
/**
<%- propertyDoc(property.name, property, type, 'enum').wrap(80, 1) %>
-
+
Values of this type are used in the `MGL<%- camelize(type) %>StyleLayer.<%- camelizeWithLeadingLowercase(property.name) %>`
property.
*/
@@ -63,15 +63,15 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(property.name) %>) {
<% } else { -%>
/**
<%- doc.wrap(80, 1) %>
-
+
You can access an existing <%- type %> style layer using the
`-[MGLStyle layerWithIdentifier:]` method if you know its identifier;
otherwise, find it using the `MGLStyle.layers` property. You can also create a
new <%- type %> style layer and add it to the style using a method such as
`-[MGLStyle addLayer:]`.
-
+
### Example
-
+
```swift
```
*/
diff --git a/platform/darwin/src/MGLStyleLayer.mm b/platform/darwin/src/MGLStyleLayer.mm
index 97f8f86b26..47f41e0388 100644
--- a/platform/darwin/src/MGLStyleLayer.mm
+++ b/platform/darwin/src/MGLStyleLayer.mm
@@ -61,7 +61,7 @@
- (float)minimumZoomLevel
{
MGLAssertStyleLayerIsValid();
-
+
return self.rawLayer->getMinZoom();
}
diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs
index 9445c3cf21..42b366905c 100644
--- a/platform/darwin/src/MGLStyleLayer.mm.ejs
+++ b/platform/darwin/src/MGLStyleLayer.mm.ejs
@@ -4,7 +4,7 @@
const paintProperties = locals.paintProperties;
const enumProperties = locals.enumProperties;
-%>
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
@@ -95,7 +95,7 @@ namespace mbgl {
- (NSString *)sourceIdentifier
{
MGLAssertStyleLayerIsValid();
-
+
return @(self.rawLayer->getSourceID().c_str());
}
diff --git a/platform/darwin/src/MGLStyleLayer_Private.h b/platform/darwin/src/MGLStyleLayer_Private.h
index 8f1cdfb4a1..b5d709a7af 100644
--- a/platform/darwin/src/MGLStyleLayer_Private.h
+++ b/platform/darwin/src/MGLStyleLayer_Private.h
@@ -53,9 +53,9 @@ NS_ASSUME_NONNULL_BEGIN
/**
Removes the mbgl style layer that this object represents from the mbgl map.
-
+
When a mbgl style layer is removed, ownership of the object is transferred back
- to the `MGLStyleLayer` instance and the unique_ptr reference is valid again. It
+ to the `MGLStyleLayer` instance and the unique_ptr reference is valid again. It
is safe to add the layer back to the style after it is removed.
*/
- (void)removeFromMapView:(MGLMapView *)mapView;
diff --git a/platform/darwin/src/MGLStyleValue.h b/platform/darwin/src/MGLStyleValue.h
index 5b6528f6fd..2f462b5a2e 100644
--- a/platform/darwin/src/MGLStyleValue.h
+++ b/platform/darwin/src/MGLStyleValue.h
@@ -9,13 +9,13 @@ NS_ASSUME_NONNULL_BEGIN
An `MGLStyleValue` object is a generic container for a style attribute value.
The layout and paint attribute properties of `MGLStyleLayer` can be set to
`MGLStyleValue` objects.
-
+
The `MGLStyleValue` class itself represents a class cluster. Under the hood, a
particular `MGLStyleValue` object may be either an `MGLStyleConstantValue` to
represent a constant value or an `MGLStyleFunction` to represent a value
function. Do not initialize an `MGLStyleValue` object directly; instead, use
one of the class factory methods to create an `MGLStyleValue` object.
-
+
The `MGLStyleValue` class takes a generic parameter `T` that indicates the
Foundation class being wrapped by this class. Common values for `T` include:
@@ -34,7 +34,7 @@ MGL_EXPORT
/**
Creates and returns an `MGLStyleConstantValue` object containing a raw value.
-
+
@param rawValue The constant value contained by the object.
@return An `MGLStyleConstantValue` object containing `rawValue`, which is
treated as a constant value.
@@ -44,7 +44,7 @@ MGL_EXPORT
/**
Creates and returns an `MGLStyleFunction` object representing a linear zoom
level function with any number of stops.
-
+
@param stops A dictionary associating zoom levels with style values.
@return An `MGLStyleFunction` object with the given stops.
*/
@@ -53,7 +53,7 @@ MGL_EXPORT
/**
Creates and returns an `MGLStyleFunction` object representing a zoom level
function with an exponential interpolation base and any number of stops.
-
+
@param interpolationBase The exponential base of the interpolation curve.
@param stops A dictionary associating zoom levels with style values.
@return An `MGLStyleFunction` object with the given interpolation base and stops.
@@ -67,7 +67,7 @@ MGL_EXPORT
value that remains constant as the zoom level changes. The layout and paint
attribute properties of `MGLStyleLayer` objects can be set to
`MGLStyleConstantValue` objects.
-
+
The `MGLStyleConstantValue` class takes a generic parameter `T` that indicates
the Foundation class being wrapped by this class.
*/
@@ -78,7 +78,7 @@ MGL_EXPORT
/**
Creates and returns an `MGLStyleConstantValue` object containing a raw value.
-
+
@param rawValue The constant value contained by the object.
@return An `MGLStyleConstantValue` object containing `rawValue`, which is
treated as a constant value.
@@ -91,7 +91,7 @@ MGL_EXPORT
/**
Returns an `MGLStyleConstantValue` object containing a raw value.
-
+
@param rawValue The value contained by the receiver.
@return An `MGLStyleConstantValue` object containing `rawValue`.
*/
@@ -111,7 +111,7 @@ MGL_EXPORT
as the zoom level changes. The layout and paint attribute properties of an
`MGLStyleLayer` object can be set to `MGLStyleFunction` objects. Use a zoom
level function to create the illusion of depth and control data density.
-
+
The `MGLStyleFunction` class takes a generic parameter `T` that indicates the
Foundation class being wrapped by this class.
*/
@@ -123,7 +123,7 @@ MGL_EXPORT
/**
Creates and returns an `MGLStyleFunction` object representing a linear zoom
level function with any number of stops.
-
+
@param stops A dictionary associating zoom levels with style values.
@return An `MGLStyleFunction` object with the given stops.
*/
@@ -132,7 +132,7 @@ MGL_EXPORT
/**
Creates and returns an `MGLStyleFunction` object representing a zoom level
function with an exponential interpolation base and any number of stops.
-
+
@param interpolationBase The exponential base of the interpolation curve.
@param stops A dictionary associating zoom levels with style values.
@return An `MGLStyleFunction` object with the given interpolation base and stops.
@@ -144,7 +144,7 @@ MGL_EXPORT
/**
Returns an `MGLStyleFunction` object representing a zoom level function with an
exponential interpolation base and any number of stops.
-
+
@param interpolationBase The exponential base of the interpolation curve.
@param stops A dictionary associating zoom levels with style values.
@return An `MGLStyleFunction` object with the given interpolation base and stops.
@@ -155,7 +155,7 @@ MGL_EXPORT
/**
The exponential interpolation base of the function’s interpolation curve.
-
+
The exponential interpolation base controls the rate at which the function’s output values
increase. A value of 1 causes the function to increase linearly by zoom level.
A higher exponential interpolation base causes the function’s output values to vary
@@ -166,7 +166,7 @@ MGL_EXPORT
/**
A dictionary associating zoom levels with style values.
-
+
Each of the function’s stops is represented by one key-value pair in the
dictionary. Each key in the dictionary is an `NSNumber` object containing a
floating-point zoom level. Each value in the dictionary is an `MGLStyleValue`
diff --git a/platform/darwin/src/MGLStyleValue_Private.h b/platform/darwin/src/MGLStyleValue_Private.h
index 2c3de3fb74..3772a7902a 100644
--- a/platform/darwin/src/MGLStyleValue_Private.h
+++ b/platform/darwin/src/MGLStyleValue_Private.h
@@ -17,7 +17,7 @@
template <typename MBGLType, typename ObjCType, typename MBGLElement = MBGLType, typename ObjCEnum = ObjCType>
class MGLStyleValueTransformer {
public:
-
+
MGLStyleValue<ObjCType> *toStyleValue(const mbgl::style::PropertyValue<MBGLType> &mbglValue) {
if (mbglValue.isConstant()) {
return toStyleConstantValue(mbglValue.asConstant());
@@ -109,7 +109,7 @@ private:
auto rawValue = toMGLRawStyleValue(mbglValue);
return [MGLStyleConstantValue<ObjCType> valueWithRawValue:rawValue];
}
-
+
MGLStyleFunction<ObjCType> *toStyleFunction(const mbgl::style::Function<MBGLType> &mbglFunction) {
const auto &mbglStops = mbglFunction.getStops();
NSMutableDictionary *stops = [NSMutableDictionary dictionaryWithCapacity:mbglStops.size()];
@@ -133,29 +133,29 @@ private:
NSNumber *toMGLRawStyleValue(const bool mbglStopValue) {
return @(mbglStopValue);
}
-
+
NSNumber *toMGLRawStyleValue(const float mbglStopValue) {
return @(mbglStopValue);
}
-
+
NSString *toMGLRawStyleValue(const std::string &mbglStopValue) {
return @(mbglStopValue.c_str());
}
-
+
// Offsets
NSValue *toMGLRawStyleValue(const std::array<float, 2> &mbglStopValue) {
return [NSValue mgl_valueWithOffsetArray:mbglStopValue];
}
-
+
// Padding
NSValue *toMGLRawStyleValue(const std::array<float, 4> &mbglStopValue) {
return [NSValue mgl_valueWithPaddingArray:mbglStopValue];
}
-
+
MGLColor *toMGLRawStyleValue(const mbgl::Color mbglStopValue) {
return [MGLColor mgl_colorWithColor:mbglStopValue];
}
-
+
ObjCType toMGLRawStyleValue(const std::vector<MBGLElement> &mbglStopValue) {
NSMutableArray *array = [NSMutableArray arrayWithCapacity:mbglStopValue.size()];
for (const auto &mbglElement: mbglStopValue) {
@@ -169,29 +169,29 @@ private:
void getMBGLValue(NSNumber *rawValue, bool &mbglValue) {
mbglValue = !!rawValue.boolValue;
}
-
+
void getMBGLValue(NSNumber *rawValue, float &mbglValue) {
mbglValue = rawValue.floatValue;
}
-
+
void getMBGLValue(NSString *rawValue, std::string &mbglValue) {
mbglValue = rawValue.UTF8String;
}
-
+
// Offsets
void getMBGLValue(NSValue *rawValue, std::array<float, 2> &mbglValue) {
mbglValue = rawValue.mgl_offsetArrayValue;
}
-
+
// Padding
void getMBGLValue(NSValue *rawValue, std::array<float, 4> &mbglValue) {
mbglValue = rawValue.mgl_paddingArrayValue;
}
-
+
void getMBGLValue(MGLColor *rawValue, mbgl::Color &mbglValue) {
mbglValue = rawValue.mgl_color;
}
-
+
void getMBGLValue(ObjCType rawValue, std::vector<MBGLElement> &mbglValue) {
mbglValue.reserve(rawValue.count);
for (id obj in rawValue) {
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h
index 23ddd59d0d..431c87a486 100644
--- a/platform/darwin/src/MGLSymbolStyleLayer.h
+++ b/platform/darwin/src/MGLSymbolStyleLayer.h
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLFoundation.h"
@@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
In combination with `symbolPlacement`, determines the rotation behavior of
icons.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.iconRotationAlignment`
property.
*/
@@ -37,7 +37,7 @@ typedef NS_ENUM(NSUInteger, MGLIconRotationAlignment) {
/**
Scales the icon to fit around the associated text.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.iconTextFit`
property.
*/
@@ -62,7 +62,7 @@ typedef NS_ENUM(NSUInteger, MGLIconTextFit) {
/**
Label placement relative to its geometry.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.symbolPlacement`
property.
*/
@@ -80,7 +80,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolPlacement) {
/**
Part of the text placed closest to the anchor.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.textAnchor`
property.
*/
@@ -125,7 +125,7 @@ typedef NS_ENUM(NSUInteger, MGLTextAnchor) {
/**
Text justification options.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.textJustification`
property.
*/
@@ -146,7 +146,7 @@ typedef NS_ENUM(NSUInteger, MGLTextJustification) {
/**
Orientation of text when map is pitched.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.textPitchAlignment`
property.
*/
@@ -168,7 +168,7 @@ typedef NS_ENUM(NSUInteger, MGLTextPitchAlignment) {
/**
In combination with `symbolPlacement`, determines the rotation behavior of the
individual glyphs forming the text.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.textRotationAlignment`
property.
*/
@@ -195,7 +195,7 @@ typedef NS_ENUM(NSUInteger, MGLTextRotationAlignment) {
/**
Specifies how to capitalize text.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.textTransform`
property.
*/
@@ -216,7 +216,7 @@ typedef NS_ENUM(NSUInteger, MGLTextTransform) {
/**
Controls the translation reference point.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.iconTranslationAnchor`
property.
*/
@@ -233,7 +233,7 @@ typedef NS_ENUM(NSUInteger, MGLIconTranslationAnchor) {
/**
Controls the translation reference point.
-
+
Values of this type are used in the `MGLSymbolStyleLayer.textTranslationAnchor`
property.
*/
@@ -251,19 +251,19 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslationAnchor) {
/**
An `MGLSymbolStyleLayer` is a style layer that renders icon and text labels at
points or along lines on the map.
-
+
Use a symbol style layer to configure the visual appearance of labels for
features in vector tiles loaded by an `MGLVectorSource` object or `MGLShape` or
`MGLFeature` instances in an `MGLShapeSource` object.
-
+
You can access an existing symbol style layer using the
`-[MGLStyle layerWithIdentifier:]` method if you know its identifier;
otherwise, find it using the `MGLStyle.layers` property. You can also create a
new symbol style layer and add it to the style using a method such as
`-[MGLStyle addLayer:]`.
-
+
### Example
-
+
```swift
let layer = MGLSymbolStyleLayer(identifier: "coffeeshops", source: pois)
layer.sourceLayerIdentifier = "pois"
@@ -285,14 +285,14 @@ MGL_EXPORT
/**
If true, the icon will be visible even if it collides with other previously
drawn symbols.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `NO`. Set this property to `nil` to reset it to
the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-icon-allow-overlap"><code>icon-allow-overlap</code></a>
layout property in the Mapbox Style Specification.
@@ -304,14 +304,14 @@ MGL_EXPORT
/**
If true, other symbols can be visible even if they collide with the icon.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `NO`. Set this property to `nil` to reset it to
the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-icon-ignore-placement"><code>icon-ignore-placement</code></a>
layout property in the Mapbox Style Specification.
@@ -323,7 +323,7 @@ MGL_EXPORT
/**
A string with {tokens} replaced, referencing the data property to pull from.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-icon-image"><code>icon-image</code></a>
layout property in the Mapbox Style Specification.
@@ -336,11 +336,11 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
Offset distance of icon from its anchor.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 rightward and 0
downward. Set this property to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -348,11 +348,11 @@ MGL_EXPORT
#else
/**
Offset distance of icon from its anchor.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 rightward and 0
upward. Set this property to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -362,11 +362,11 @@ MGL_EXPORT
/**
If true, text will display without their corresponding icons when the icon
collides with other symbols and the text does not.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `NO`. Set this property to `nil` to reset it to
the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`, and
`text` is non-`nil`. Otherwise, it is ignored.
*/
@@ -375,13 +375,13 @@ MGL_EXPORT
/**
Size of the additional area around the icon bounding box used for detecting
symbol collisions.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `2`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -389,16 +389,16 @@ MGL_EXPORT
/**
Rotates the icon clockwise.
-
+
This property is measured in degrees.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-icon-rotate"><code>icon-rotate</code></a>
layout property in the Mapbox Style Specification.
@@ -411,11 +411,11 @@ MGL_EXPORT
/**
In combination with `symbolPlacement`, determines the rotation behavior of
icons.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLIconRotationAlignmentAuto`. Set this property
to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -423,14 +423,14 @@ MGL_EXPORT
/**
Scale factor for icon. 1 is original size, 3 triples the size.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-icon-size"><code>icon-size</code></a>
layout property in the Mapbox Style Specification.
@@ -442,11 +442,11 @@ MGL_EXPORT
/**
Scales the icon to fit around the associated text.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLIconTextFitNone`. Set this property to `nil` to
reset it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`, and
`text` is non-`nil`. Otherwise, it is ignored.
*/
@@ -455,13 +455,13 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
Size of the additional area added to dimensions determined by `iconTextFit`.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `UIEdgeInsetsZero`. Set this property to `nil` to
reset it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`, and
`text` is non-`nil`, and `iconTextFit` is set to an `MGLStyleValue` object
containing an `NSValue` object containing `MGLIconTextFitBoth`,
@@ -471,13 +471,13 @@ MGL_EXPORT
#else
/**
Size of the additional area added to dimensions determined by `iconTextFit`.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `NSEdgeInsetsZero`. Set this property to `nil` to
reset it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`, and
`text` is non-`nil`, and `iconTextFit` is set to an `MGLStyleValue` object
containing an `NSValue` object containing `MGLIconTextFitBoth`,
@@ -488,17 +488,17 @@ MGL_EXPORT
/**
If true, the icon may be flipped to prevent it from being rendered upside-down.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `NO`. Set this property to `nil` to reset it to
the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`, and
`iconRotationAlignment` is set to an `MGLStyleValue` object containing an
`NSValue` object containing `MGLIconRotationAlignmentMap`, and
`symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue`
object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-icon-keep-upright"><code>icon-keep-upright</code></a>
layout property in the Mapbox Style Specification.
@@ -511,17 +511,17 @@ MGL_EXPORT
/**
If true, the text may be flipped vertically to prevent it from being rendered
upside-down.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `YES`. Set this property to `nil` to reset it to
the default value.
-
+
This property is only applied to the style if `text` is non-`nil`, and
`textRotationAlignment` is set to an `MGLStyleValue` object containing an
`NSValue` object containing `MGLTextRotationAlignmentMap`, and
`symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue`
object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-keep-upright"><code>text-keep-upright</code></a>
layout property in the Mapbox Style Specification.
@@ -533,17 +533,17 @@ MGL_EXPORT
/**
Maximum angle change between adjacent characters.
-
+
This property is measured in degrees.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `45`. Set this property to `nil` to
reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`, and
`symbolPlacement` is set to an `MGLStyleValue` object containing an `NSValue`
object containing `MGLSymbolPlacementLine`. Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-max-angle"><code>text-max-angle</code></a>
layout property in the Mapbox Style Specification.
@@ -555,16 +555,16 @@ MGL_EXPORT
/**
The maximum line width for text wrapping.
-
+
This property is measured in ems.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `10`. Set this property to `nil` to
reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-max-width"><code>text-max-width</code></a>
layout property in the Mapbox Style Specification.
@@ -579,11 +579,11 @@ MGL_EXPORT
Recommended in layers that don't have enough padding in the vector tile to
prevent collisions, or if it is a point symbol layer placed after a line symbol
layer.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `NO`. Set this property to `nil` to reset it to
the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-symbol-avoid-edges"><code>symbol-avoid-edges</code></a>
layout property in the Mapbox Style Specification.
@@ -595,7 +595,7 @@ MGL_EXPORT
/**
Label placement relative to its geometry.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLSymbolPlacementPoint`. Set this property to
`nil` to reset it to the default value.
@@ -604,13 +604,13 @@ MGL_EXPORT
/**
Distance between two symbol anchors.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `250`. Set this property to `nil` to
reset it to the default value.
-
+
This property is only applied to the style if `symbolPlacement` is set to an
`MGLStyleValue` object containing an `NSValue` object containing
`MGLSymbolPlacementLine`. Otherwise, it is ignored.
@@ -620,10 +620,10 @@ MGL_EXPORT
/**
Value to use for a text label. Feature properties are specified using tokens
like {field_name}.
-
+
The default value of this property is an `MGLStyleValue` object containing the
empty string. Set this property to `nil` to reset it to the default value.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-field"><code>text-field</code></a>
layout property in the Mapbox Style Specification.
@@ -636,14 +636,14 @@ MGL_EXPORT
/**
If true, the text will be visible even if it collides with other previously
drawn symbols.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `NO`. Set this property to `nil` to reset it to
the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-allow-overlap"><code>text-allow-overlap</code></a>
layout property in the Mapbox Style Specification.
@@ -655,11 +655,11 @@ MGL_EXPORT
/**
Part of the text placed closest to the anchor.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLTextAnchorCenter`. Set this property to `nil`
to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -667,24 +667,24 @@ MGL_EXPORT
/**
An array of font face names used to display the text.
-
+
Each font name must be included in the `{fontstack}` portion of the JSON
stylesheet’s <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#glyphs"><code>glyphs</code></a>
property. You can register a custom font when designing the style in Mapbox
Studio. Fonts installed on the system are not used.
-
+
The first font named in the array is applied to the text. For each character in
the text, if the first font lacks a glyph for the character, the next font is
applied as a fallback, and so on.
-
+
The default value of this property is an `MGLStyleValue` object containing the
array `Open Sans Regular`, `Arial Unicode MS Regular`. Set this property to
`nil` to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-font"><code>text-font</code></a>
layout property in the Mapbox Style Specification.
@@ -696,16 +696,16 @@ MGL_EXPORT
/**
Font size.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `16`. Set this property to `nil` to
reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-size"><code>text-size</code></a>
layout property in the Mapbox Style Specification.
@@ -717,14 +717,14 @@ MGL_EXPORT
/**
If true, other symbols can be visible even if they collide with the text.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `NO`. Set this property to `nil` to reset it to
the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-ignore-placement"><code>text-ignore-placement</code></a>
layout property in the Mapbox Style Specification.
@@ -736,14 +736,14 @@ MGL_EXPORT
/**
Text justification options.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLTextJustificationCenter`. Set this property to
`nil` to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-justify"><code>text-justify</code></a>
layout property in the Mapbox Style Specification.
@@ -755,13 +755,13 @@ MGL_EXPORT
/**
Text tracking amount.
-
+
This property is measured in ems.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -769,13 +769,13 @@ MGL_EXPORT
/**
Text leading value for multi-line text.
-
+
This property is measured in ems.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1.2`. Set this property to `nil` to
reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -784,13 +784,13 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
Offset distance of text from its anchor.
-
+
This property is measured in ems.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 ems rightward and 0
ems downward. Set this property to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -798,13 +798,13 @@ MGL_EXPORT
#else
/**
Offset distance of text from its anchor.
-
+
This property is measured in ems.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 ems rightward and 0
ems upward. Set this property to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -814,11 +814,11 @@ MGL_EXPORT
/**
If true, icons will display without their corresponding text when the text
collides with other symbols and the icon does not.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing `NO`. Set this property to `nil` to reset it to
the default value.
-
+
This property is only applied to the style if `text` is non-`nil`, and
`iconImageName` is non-`nil`. Otherwise, it is ignored.
*/
@@ -827,13 +827,13 @@ MGL_EXPORT
/**
Size of the additional area around the text bounding box used for detecting
symbol collisions.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `2`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -841,11 +841,11 @@ MGL_EXPORT
/**
Orientation of text when map is pitched.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLTextPitchAlignmentAuto`. Set this property to
`nil` to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -853,16 +853,16 @@ MGL_EXPORT
/**
Rotates the text clockwise.
-
+
This property is measured in degrees.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-rotate"><code>text-rotate</code></a>
layout property in the Mapbox Style Specification.
@@ -875,11 +875,11 @@ MGL_EXPORT
/**
In combination with `symbolPlacement`, determines the rotation behavior of the
individual glyphs forming the text.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLTextRotationAlignmentAuto`. Set this property
to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -887,11 +887,11 @@ MGL_EXPORT
/**
Specifies how to capitalize text.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLTextTransformNone`. Set this property to `nil`
to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -903,11 +903,11 @@ MGL_EXPORT
/**
The tint color to apply to the icon. The `iconImageName` property must be set
to a template image.
-
+
The default value of this property is an `MGLStyleValue` object containing
`UIColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -916,11 +916,11 @@ MGL_EXPORT
/**
The tint color to apply to the icon. The `iconImageName` property must be set
to a template image.
-
+
The default value of this property is an `MGLStyleValue` object containing
`NSColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -929,13 +929,13 @@ MGL_EXPORT
/**
Fade out the halo towards the outside.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -945,11 +945,11 @@ MGL_EXPORT
/**
The color of the icon’s halo. The `iconImageName` property must be set to a
template image.
-
+
The default value of this property is an `MGLStyleValue` object containing
`UIColor.clearColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -958,11 +958,11 @@ MGL_EXPORT
/**
The color of the icon’s halo. The `iconImageName` property must be set to a
template image.
-
+
The default value of this property is an `MGLStyleValue` object containing
`NSColor.clearColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -971,13 +971,13 @@ MGL_EXPORT
/**
Distance of halo to the icon outline.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -985,11 +985,11 @@ MGL_EXPORT
/**
The opacity at which the icon will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
*/
@@ -998,16 +998,16 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
Distance that the icon's anchor is moved from its original placement.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points downward. Set this property to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-icon-translate"><code>icon-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -1016,16 +1016,16 @@ MGL_EXPORT
#else
/**
Distance that the icon's anchor is moved from its original placement.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points upward. Set this property to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`.
Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-icon-translate"><code>icon-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -1037,14 +1037,14 @@ MGL_EXPORT
/**
Controls the translation reference point.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLIconTranslationAnchorMap`. Set this property to
`nil` to reset it to the default value.
-
+
This property is only applied to the style if `iconImageName` is non-`nil`, and
`iconTranslation` is non-`nil`. Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-icon-translate-anchor"><code>icon-translate-anchor</code></a>
layout property in the Mapbox Style Specification.
@@ -1056,11 +1056,11 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The color with which the text will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing
`UIColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -1068,11 +1068,11 @@ MGL_EXPORT
#else
/**
The color with which the text will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing
`NSColor.blackColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -1081,13 +1081,13 @@ MGL_EXPORT
/**
The halo's fadeout distance towards the outside.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -1096,11 +1096,11 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
The color of the text's halo, which helps it stand out from backgrounds.
-
+
The default value of this property is an `MGLStyleValue` object containing
`UIColor.clearColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -1108,11 +1108,11 @@ MGL_EXPORT
#else
/**
The color of the text's halo, which helps it stand out from backgrounds.
-
+
The default value of this property is an `MGLStyleValue` object containing
`NSColor.clearColor`. Set this property to `nil` to reset it to the default
value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -1122,13 +1122,13 @@ MGL_EXPORT
/**
Distance of halo to the font outline. Max text halo width is 1/4 of the
font-size.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `0`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -1136,11 +1136,11 @@ MGL_EXPORT
/**
The opacity at which the text will be drawn.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSNumber` object containing the float `1`. Set this property to `nil` to reset
it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
*/
@@ -1149,16 +1149,16 @@ MGL_EXPORT
#if TARGET_OS_IPHONE
/**
Distance that the text's anchor is moved from its original placement.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points downward. Set this property to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-text-translate"><code>text-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -1167,16 +1167,16 @@ MGL_EXPORT
#else
/**
Distance that the text's anchor is moved from its original placement.
-
+
This property is measured in points.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing a `CGVector` struct set to 0 points rightward and 0
points upward. Set this property to `nil` to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`. Otherwise,
it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-text-translate"><code>text-translate</code></a>
layout property in the Mapbox Style Specification.
@@ -1188,14 +1188,14 @@ MGL_EXPORT
/**
Controls the translation reference point.
-
+
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLTextTranslationAnchorMap`. Set this property to
`nil` to reset it to the default value.
-
+
This property is only applied to the style if `text` is non-`nil`, and
`textTranslation` is non-`nil`. Otherwise, it is ignored.
-
+
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-text-translate-anchor"><code>text-translate-anchor</code></a>
layout property in the Mapbox Style Specification.
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm
index 493a8c5b6f..b0786d95c2 100644
--- a/platform/darwin/src/MGLSymbolStyleLayer.mm
+++ b/platform/darwin/src/MGLSymbolStyleLayer.mm
@@ -1,4 +1,4 @@
-// This file is generated.
+// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
@@ -113,7 +113,7 @@ namespace mbgl {
- (NSString *)sourceIdentifier
{
MGLAssertStyleLayerIsValid();
-
+
return @(self.rawLayer->getSourceID().c_str());
}
diff --git a/platform/darwin/src/MGLTilePyramidOfflineRegion.h b/platform/darwin/src/MGLTilePyramidOfflineRegion.h
index 4c6237702d..31e5a41920 100644
--- a/platform/darwin/src/MGLTilePyramidOfflineRegion.h
+++ b/platform/darwin/src/MGLTilePyramidOfflineRegion.h
@@ -15,10 +15,10 @@ MGL_EXPORT
/**
URL of the style whose resources are required for offline viewing.
-
+
In addition to the JSON stylesheet, different styles may require different font
glyphs, sprite sheets, and other resources.
-
+
The URL may be a full HTTP or HTTPS URL or a Mapbox URL indicating the style’s
map ID (`mapbox://styles/{user}/{style}`).
*/
@@ -32,14 +32,14 @@ MGL_EXPORT
/**
The minimum zoom level for which to download tiles and other resources.
-
+
For more information about zoom levels, `-[MGLMapView zoomLevel]`.
*/
@property (nonatomic, readonly) double minimumZoomLevel;
/**
The maximum zoom level for which to download tiles and other resources.
-
+
For more information about zoom levels, `-[MGLMapView zoomLevel]`.
*/
@property (nonatomic, readonly) double maximumZoomLevel;
@@ -49,9 +49,9 @@ MGL_EXPORT
/**
Initializes a newly created offline region with the given style URL, geographic
coordinate bounds, and range of zoom levels.
-
+
This is the designated initializer for `MGLTilePyramidOfflineRegion`.
-
+
@param styleURL URL of the map style for which to download resources. The URL
may be a full HTTP or HTTPS URL or a Mapbox URL indicating the style’s map
ID (`mapbox://styles/{user}/{style}`). Specify `nil` for the default style.
diff --git a/platform/darwin/src/MGLTilePyramidOfflineRegion.mm b/platform/darwin/src/MGLTilePyramidOfflineRegion.mm
index f128fbb256..e0d56484bf 100644
--- a/platform/darwin/src/MGLTilePyramidOfflineRegion.mm
+++ b/platform/darwin/src/MGLTilePyramidOfflineRegion.mm
@@ -35,7 +35,7 @@
if (!styleURL) {
styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion];
}
-
+
if (!styleURL.scheme) {
[NSException raise:@"Invalid style URL" format:
@"%@ does not support setting a relative file URL as the style URL. "
@@ -44,7 +44,7 @@
@"For Mapbox-hosted styles, use the mapbox: scheme.",
NSStringFromClass([self class])];
}
-
+
_styleURL = styleURL;
_bounds = bounds;
_minimumZoomLevel = minimumZoomLevel;
@@ -80,7 +80,7 @@
MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(sw, ne);
double minimumZoomLevel = [coder decodeDoubleForKey:@"minimumZoomLevel"];
double maximumZoomLevel = [coder decodeDoubleForKey:@"maximumZoomLevel"];
-
+
return [self initWithStyleURL:styleURL bounds:bounds fromZoomLevel:minimumZoomLevel toZoomLevel:maximumZoomLevel];
}
@@ -106,7 +106,7 @@
if (![other isKindOfClass:[self class]]) {
return NO;
}
-
+
MGLTilePyramidOfflineRegion *otherRegion = other;
return (_minimumZoomLevel == otherRegion->_minimumZoomLevel
&& _maximumZoomLevel == otherRegion->_maximumZoomLevel
diff --git a/platform/darwin/src/MGLTileSource.h b/platform/darwin/src/MGLTileSource.h
index 99d23f4add..bc29b0f95c 100644
--- a/platform/darwin/src/MGLTileSource.h
+++ b/platform/darwin/src/MGLTileSource.h
@@ -16,7 +16,7 @@ typedef NSString *MGLTileSourceOption NS_STRING_ENUM;
/**
An `NSNumber` object containing an unsigned integer that specifies the minimum
zoom level at which to display tiles from the source.
-
+
The value should be between 0 and 22, inclusive, and less than
`MGLTileSourceOptionMaximumZoomLevel`, if specified. The default value for this
option is 0.
@@ -30,7 +30,7 @@ extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionMinimumZoomLevel;
/**
An `NSNumber` object containing an unsigned integer that specifies the maximum
zoom level at which to display tiles from the source.
-
+
The value should be between 0 and 22, inclusive, and less than
`MGLTileSourceOptionMinimumZoomLevel`, if specified. The default value for this
option is 22.
@@ -46,7 +46,7 @@ extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionMaximumZoomLevel;
An HTML string defining the buttons to be displayed in an action sheet when the
source is part of a map view’s style and the map view’s attribution button is
pressed.
-
+
By default, no attribution statements are displayed. If the
`MGLTileSourceOptionAttributionInfos` option is specified, this option is
ignored.
@@ -61,7 +61,7 @@ extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionHTMLSt
An array of `MGLAttributionInfo` objects defining the buttons to be displayed
in an action sheet when the source is part of a map view’s style and the map
view’s attribution button is pressed.
-
+
By default, no attribution statements are displayed.
*/
extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionInfos;
@@ -69,7 +69,7 @@ extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionInfos;
/**
An HTML string defining the buttons to be displayed in the map view’s
attribution view when the source is part of the map view’s style.
-
+
By default, no attribution statements are displayed. If the
`MGLTileSourceOptionAttributionInfos` option is specified, this option is
ignored.
@@ -84,7 +84,7 @@ extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionHTMLSt
An array of `MGLAttributionInfo` objects defining the buttons to be displayed
in the map view’s attribution view when the source is part of the map view’s
style.
-
+
By default, no attribution statements are displayed.
*/
extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionInfos;
@@ -94,7 +94,7 @@ extern MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionAttributionInfos;
An `NSNumber` object containing an unsigned integer that specifies the tile
coordinate system for the source’s tile URLs. The integer corresponds to one of
the constants described in `MGLTileCoordinateSystem`.
-
+
The default value for this option is `MGLTileCoordinateSystemXYZ`.
This option corresponds to the `scheme` key in the
@@ -111,16 +111,16 @@ typedef NS_ENUM(NSUInteger, MGLTileCoordinateSystem) {
/**
The origin is at the top-left (northwest), and `y` values increase
southwards.
-
+
This tile coordinate system is used by Mapbox and OpenStreetMap tile
servers.
*/
MGLTileCoordinateSystemXYZ = 0,
-
+
/**
The origin is at the bottom-left (southwest), and `y` values increase
northwards.
-
+
This tile coordinate system is used by tile servers that conform to the
<a href="http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification">Tile Map Service Specification</a>.
*/
@@ -135,7 +135,7 @@ typedef NS_ENUM(NSUInteger, MGLTileCoordinateSystem) {
A tile source is added to an `MGLStyle` object along with one or more
`MGLRasterStyleLayer` or `MGLVectorStyleLayer` objects. Use a style layer to
control the appearance of content supplied by the tile source.
-
+
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of `MGLRasterSource` and
`MGLVectorSource`.
@@ -150,15 +150,15 @@ MGL_EXPORT
/**
Returns a tile source initialized with an identifier and configuration URL.
-
+
After initializing and configuring the source, add it to a map view’s style
using the `-[MGLStyle addSource:]` method.
-
+
The URL may be a full HTTP or HTTPS URL or, for tile sets hosted by Mapbox, a
Mapbox URL indicating a map identifier (`mapbox://<mapid>`). The URL should
point to a JSON file that conforms to the
<a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>.
-
+
@param identifier A string that uniquely identifies the source in the style to
which it is added.
@param configurationURL A URL to a TileJSON configuration file describing the
@@ -170,27 +170,27 @@ MGL_EXPORT
/**
Returns a tile source initialized an identifier, tile URL templates, and
options.
-
+
After initializing and configuring the source, add it to a map view’s style
using the `-[MGLStyle addSource:]` method.
-
+
#### Tile URL templates
-
+
Tile URL templates are strings that specify the URLs of the tile images to
load. Each template resembles an absolute URL, but with any number of
placeholder strings that the source evaluates based on the tile it needs to
load. For example:
-
+
<ul>
<li><code>http://www.example.com/tiles/{z}/{x}/{y}.pbf</code> could be
evaluated as <code>http://www.example.com/tiles/14/6/9.pbf</code>.</li>
<li><code>http://www.example.com/tiles/{z}/{x}/{y}{ratio}.png</code> could be
evaluated as <code>http://www.example.com/tiles/14/6/9@2x.png</code>.</li>
</ul>
-
+
Tile sources support the following placeholder strings in tile URL templates,
all of which are optional:
-
+
<table>
<thead>
<tr><th>Placeholder string</th><th>Description</th></tr>
@@ -256,11 +256,11 @@ MGL_EXPORT
</tr>
</tbody>
</table>
-
+
For more information about the `{x}`, `{y}`, and `{z}` placeholder strings,
consult the
<a href="https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames">OpenStreetMap Wiki</a>.
-
+
@param identifier A string that uniquely identifies the source in the style to
which it is added.
@param tileURLTemplates An array of tile URL template strings. Only the first
@@ -288,7 +288,7 @@ MGL_EXPORT
/**
An array of `MGLAttributionInfo` objects that define the attribution
statements to be displayed when the map is shown to the user.
-
+
By default, this array is empty. If the source is initialized with a
configuration URL, this array is also empty until the configuration JSON file
is loaded.
diff --git a/platform/darwin/src/MGLTileSource.mm b/platform/darwin/src/MGLTileSource.mm
index 1aef81d53c..aa2a299a46 100644
--- a/platform/darwin/src/MGLTileSource.mm
+++ b/platform/darwin/src/MGLTileSource.mm
@@ -53,11 +53,11 @@ const MGLTileSourceOption MGLTileSourceOptionTileCoordinateSystem = @"MGLTileSou
mbgl::Tileset MGLTileSetFromTileURLTemplates(NS_ARRAY_OF(NSString *) *tileURLTemplates, NS_DICTIONARY_OF(MGLTileSourceOption, id) * _Nullable options) {
mbgl::Tileset tileSet;
-
+
for (NSString *tileURLTemplate in tileURLTemplates) {
tileSet.tiles.push_back(tileURLTemplate.UTF8String);
}
-
+
// set the minimum / maximum zoom range to the values specified by this class if they
// were set. otherwise, use the core objects default values
if (NSNumber *minimumZoomLevel = options[MGLTileSourceOptionMinimumZoomLevel]) {
@@ -78,7 +78,7 @@ mbgl::Tileset MGLTileSetFromTileURLTemplates(NS_ARRAY_OF(NSString *) *tileURLTem
[NSException raise:NSInvalidArgumentException
format:@"MGLTileSourceOptionMinimumZoomLevel must be less than MGLTileSourceOptionMaximumZoomLevel."];
}
-
+
if (NSString *attribution = options[MGLTileSourceOptionAttributionHTMLString]) {
if (![attribution isKindOfClass:[NSString class]]) {
[NSException raise:NSInvalidArgumentException
@@ -86,13 +86,13 @@ mbgl::Tileset MGLTileSetFromTileURLTemplates(NS_ARRAY_OF(NSString *) *tileURLTem
}
tileSet.attribution = attribution.UTF8String;
}
-
+
if (NSArray *attributionInfos = options[MGLTileSourceOptionAttributionInfos]) {
if (![attributionInfos isKindOfClass:[NSArray class]]) {
[NSException raise:NSInvalidArgumentException
format:@"MGLTileSourceOptionAttributionInfos must be set to a string."];
}
-
+
NSAttributedString *attributedString = [MGLAttributionInfo attributedStringForAttributionInfos:attributionInfos];
#if TARGET_OS_IPHONE
static NSString * const NSExcludedElementsDocumentAttribute = @"ExcludedElements";
@@ -107,7 +107,7 @@ mbgl::Tileset MGLTileSetFromTileURLTemplates(NS_ARRAY_OF(NSString *) *tileURLTem
NSString *html = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
tileSet.attribution = html.UTF8String;
}
-
+
if (NSNumber *tileCoordinateSystemNumber = options[MGLTileSourceOptionTileCoordinateSystem]) {
if (![tileCoordinateSystemNumber isKindOfClass:[NSValue class]]) {
[NSException raise:NSInvalidArgumentException
@@ -124,6 +124,6 @@ mbgl::Tileset MGLTileSetFromTileURLTemplates(NS_ARRAY_OF(NSString *) *tileURLTem
break;
}
}
-
+
return tileSet;
}
diff --git a/platform/darwin/src/MGLTileSource_Private.h b/platform/darwin/src/MGLTileSource_Private.h
index 8da69274f2..0d9876d412 100644
--- a/platform/darwin/src/MGLTileSource_Private.h
+++ b/platform/darwin/src/MGLTileSource_Private.h
@@ -15,7 +15,7 @@ namespace mbgl {
/**
An HTML string to be displayed as attribution when the map is shown to a user.
-
+
The default value is `nil`. If the source is initialized with a configuration
URL, this property is also `nil` until the configuration JSON file is loaded.
*/
@@ -24,7 +24,7 @@ namespace mbgl {
/**
A structured representation of the `attribution` property. The default value is
`nil`.
-
+
@param fontSize The default text size in points, or 0 to use the default.
@param linkColor The default link color, or `nil` to use the default.
*/
diff --git a/platform/darwin/src/MGLValueEvaluator.h b/platform/darwin/src/MGLValueEvaluator.h
index b53cdaa8d2..2779deba90 100644
--- a/platform/darwin/src/MGLValueEvaluator.h
+++ b/platform/darwin/src/MGLValueEvaluator.h
@@ -10,27 +10,27 @@ public:
id operator()(const mbgl::NullValue &) const {
return [NSNull null];
}
-
+
id operator()(const bool &value) const {
return value ? @YES : @NO;
}
-
+
id operator()(const uint64_t &value) const {
return @(value);
}
-
+
id operator()(const int64_t &value) const {
return @(value);
}
-
+
id operator()(const double &value) const {
return @(value);
}
-
+
id operator()(const std::string &value) const {
return @(value.c_str());
}
-
+
id operator()(const std::vector<mbgl::Value> &values) const {
NSMutableArray *objects = [NSMutableArray arrayWithCapacity:values.size()];
for (const auto &v : values) {
@@ -38,7 +38,7 @@ public:
}
return objects;
}
-
+
id operator()(const std::unordered_map<std::string, mbgl::Value> &items) const {
NSMutableDictionary *attributes = [NSMutableDictionary dictionaryWithCapacity:items.size()];
for (auto &item : items) {
diff --git a/platform/darwin/src/MGLVectorSource.h b/platform/darwin/src/MGLVectorSource.h
index bfa52f5b49..2322c62f29 100644
--- a/platform/darwin/src/MGLVectorSource.h
+++ b/platform/darwin/src/MGLVectorSource.h
@@ -12,22 +12,22 @@ NS_ASSUME_NONNULL_BEGIN
A vector source is added to an `MGLStyle` object along with one or more
`MGLVectorStyleLayer` objects. A vector style layer defines the appearance of
any content supplied by the vector source.
-
+
Each
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#sources-vector"><code>vector</code></a>
source defined by the style JSON file is represented at runtime by an
`MGLVectorSource` object that you can use to initialize new style layers. You
can also add and remove sources dynamically using methods such as
`-[MGLStyle addSource:]` and `-[MGLStyle sourceWithIdentifier:]`.
-
+
Within each vector tile, each geometric coordinate must lie between
−1&nbsp;×&nbsp;<var>extent</var> and
(<var>extent</var>&nbsp;×&nbsp;2)&nbsp;−&nbsp;1, inclusive. Any vector style
layer initialized with a vector source must have a non-`nil` value in its
`sourceLayerIdentifier` property.
-
+
### Example
-
+
```swift
let source = MGLVectorSource(identifier: "pois", tileURLTemplates: ["https://example.com/vector-tiles/{z}/{x}/{y}.mvt"], options: [
.minimumZoomLevel: 9,
diff --git a/platform/darwin/src/MGLVectorSource.mm b/platform/darwin/src/MGLVectorSource.mm
index 8fda528546..a16cfa6d81 100644
--- a/platform/darwin/src/MGLVectorSource.mm
+++ b/platform/darwin/src/MGLVectorSource.mm
@@ -33,7 +33,7 @@
- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NS_ARRAY_OF(NSString *) *)tileURLTemplates options:(nullable NS_DICTIONARY_OF(MGLTileSourceOption, id) *)options {
if (self = [super initWithIdentifier:identifier tileURLTemplates:tileURLTemplates options:options]) {
mbgl::Tileset tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, options);
-
+
auto source = std::make_unique<mbgl::style::VectorSource>(identifier.UTF8String, tileSet);
_pendingSource = std::move(source);
self.rawSource = _pendingSource.get();
diff --git a/platform/darwin/src/MGLVectorStyleLayer.h b/platform/darwin/src/MGLVectorStyleLayer.h
index ca09c11716..c6193e6046 100644
--- a/platform/darwin/src/MGLVectorStyleLayer.h
+++ b/platform/darwin/src/MGLVectorStyleLayer.h
@@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
`MGLVectorStyleLayer` is an abstract superclass for style layers whose content
is defined by an `MGLShapeSource` or `MGLVectorSource` object.
-
+
Do not create instances of this class directly, and do not create your own
subclasses of this class. Instead, create instances of the following concrete
subclasses: `MGLCircleStyleLayer`, `MGLFillStyleLayer`, `MGLLineStyleLayer`,
@@ -27,15 +27,15 @@ MGL_EXPORT
/**
The style layer’s predicate.
-
+
Use the style layer’s predicate to include only the features in the source
layer that satisfy a condition that you define. If the style layer initially
comes from the style, its predicate corresponds to the
<a href="https://www.mapbox.com/mapbox-gl-style-spec/#layer-filter">`filter`</a>
property in the style JSON.
-
+
The following comparison operators are supported.
-
+
<ul>
<li><code>NSEqualToPredicateOperatorType</code> (<code>=</code>, <code>==</code>)</li>
<li><code>NSGreaterThanOrEqualToPredicateOperatorType</code> (<code>>=</code>, <code>=></code>)</li>
@@ -45,35 +45,35 @@ MGL_EXPORT
<li><code>NSNotEqualToPredicateOperatorType</code> (<code>!=</code>, <code><></code>)</li>
<li><code>NSBetweenPredicateOperatorType</code> (<code>BETWEEN</code>)</li>
</ul>
-
+
The following compound operators are supported:
-
+
<ul>
<li><code>NSAndPredicateType</code> (<code>AND</code>, <code>&&</code>)</li>
<li><code>NSOrPredicateType</code> (<code>OR</code>, <code>||</code>)</li>
<li><code>NSNotPredicateType</code> (<code>NOT</code>, <code>!</code>)</li>
</ul>
-
+
The following aggregate operators are supported:
-
+
<ul>
<li><code>NSInPredicateOperatorType</code> (<code>IN</code>)</li>
<li><code>NSContainsPredicateOperatorType</code> (<code>CONTAINS</code>)</li>
</ul>
-
+
To test whether a feature has or lacks a specific attribute, compare the
attribute to `NULL` or `NIL`. Predicates created using the
`+[NSPredicate predicateWithValue:]` method are also supported. String
operators and custom operators are not supported.
-
+
For details about the predicate format string syntax, consult the “Predicate
Format String Syntax” chapter of the
“<a href="https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Predicates/">Predicate Programming Guide</a>”
in Apple developer documentation.
-
+
The predicate's left-hand expression must be a string that identifies a feature
attribute or, alternatively, one of the following special attributes:
-
+
<table>
<thead>
<tr><th>Attribute</th><th>Meaning</th></tr>
@@ -115,33 +115,33 @@ MGL_EXPORT
</tr>
</tbody>
</table>
-
+
The predicate’s right-hand expression must be an `NSString` (to match strings)
or `NSNumber` (to match numbers, including Boolean values) or an array of
`NSString`s or `NSNumber`s, depending on the operator and the type of values
expected for the attribute being tested. For floating-point values, use
`-[NSNumber numberWithDouble:]` instead of `-[NSNumber numberWithFloat:]`
to avoid precision issues.
-
+
Automatic type casting is not performed. Therefore, a feature only matches this
predicate if its value for the attribute in question is of the same type as the
value specified in the predicate. Also, operator modifiers such as `c` (for
case insensitivity), `d` (for diacritic insensitivity), and `l` (for locale
sensitivity) are unsupported for comparison and aggregate operators that are
used in the predicate.
-
- It is possible to create expressions that contain special characters in the
- predicate format syntax. This includes the `$` in the `$id` and `$type` special
+
+ It is possible to create expressions that contain special characters in the
+ predicate format syntax. This includes the `$` in the `$id` and `$type` special
style attributes and also `hyphen-minus` and `tag:subtag`. However, you must use
`%K` in the format string to represent these variables:
`@"%K == 'LineString'", @"$type"`.
-
+
### Example
-
+
To filter the layer to include only the features whose `index` attribute is 5
or 10 and whose `ele` attribute is at least 1,500, you could create an
`NSCompoundPredicate` along these lines:
-
+
```swift
let layer = MGLLineStyleLayer(identifier: "contour", source: terrain)
layer.sourceLayerIdentifier = "contours"
diff --git a/platform/darwin/src/NSArray+MGLAdditions.mm b/platform/darwin/src/NSArray+MGLAdditions.mm
index 8ec344f580..3cab7ff427 100644
--- a/platform/darwin/src/NSArray+MGLAdditions.mm
+++ b/platform/darwin/src/NSArray+MGLAdditions.mm
@@ -50,15 +50,15 @@
- (std::vector<CLLocationCoordinate2D>)mgl_coordinates {
NSUInteger numberOfCoordinates = [self count];
CLLocationCoordinate2D *coords = (CLLocationCoordinate2D *)malloc(numberOfCoordinates * sizeof(CLLocationCoordinate2D));
-
+
for (NSUInteger i = 0; i < numberOfCoordinates; i++) {
coords[i] = CLLocationCoordinate2DMake([self[i][@"latitude"] doubleValue],
[self[i][@"longitude"] doubleValue]);
}
-
+
std::vector<CLLocationCoordinate2D> coordinates = { coords, coords + numberOfCoordinates };
free(coords);
-
+
return coordinates;
}
diff --git a/platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm b/platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm
index 58b37fae0e..295b3b21f8 100644
--- a/platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm
+++ b/platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm
@@ -18,28 +18,28 @@
mbgl::style::EqualsFilter eqFilter;
eqFilter.key = self.mgl_keyPath.UTF8String;
eqFilter.value = self.mgl_constantValue;
-
+
// Convert == nil to NotHasFilter.
if (eqFilter.value.is<mbgl::NullValue>()) {
mbgl::style::NotHasFilter notHasFilter;
notHasFilter.key = eqFilter.key;
return notHasFilter;
}
-
+
return eqFilter;
}
case NSNotEqualToPredicateOperatorType: {
mbgl::style::NotEqualsFilter neFilter;
neFilter.key = self.mgl_keyPath.UTF8String;
neFilter.value = self.mgl_constantValue;
-
+
// Convert != nil to HasFilter.
if (neFilter.value.is<mbgl::NullValue>()) {
mbgl::style::HasFilter hasFilter;
hasFilter.key = neFilter.key;
return hasFilter;
}
-
+
return neFilter;
}
case NSGreaterThanPredicateOperatorType: {
@@ -155,7 +155,7 @@
[NSException raise:NSInvalidArgumentException
format:@"NSPredicateOperatorType:%lu is not supported.", (unsigned long)self.predicateOperatorType];
}
-
+
return {};
}
@@ -169,7 +169,7 @@
} else if (leftType == NSConstantValueExpressionType && rightType == NSKeyPathExpressionType) {
return rightExpression.keyPath;
}
-
+
[NSException raise:NSInvalidArgumentException
format:@"Comparison predicate must compare an attribute (as a key path) to a constant or vice versa."];
return nil;
diff --git a/platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm b/platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm
index 2697467198..0039b5af82 100644
--- a/platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm
+++ b/platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm
@@ -21,19 +21,19 @@
NSAssert(self.subpredicates.count <= 1, @"NOT predicate cannot have multiple subpredicates.");
NSPredicate *subpredicate = self.subpredicates.firstObject;
mbgl::style::Filter subfilter = subpredicate.mgl_filter;
-
+
// Convert NOT(!= nil) to NotHasFilter.
if (subfilter.is<mbgl::style::HasFilter>()) {
auto hasFilter = subfilter.get<mbgl::style::HasFilter>();
return mbgl::style::NotHasFilter { .key = hasFilter.key };
}
-
+
// Convert NOT(== nil) to HasFilter.
if (subfilter.is<mbgl::style::NotHasFilter>()) {
auto hasFilter = subfilter.get<mbgl::style::NotHasFilter>();
return mbgl::style::HasFilter { .key = hasFilter.key };
}
-
+
// Convert NOT(IN) or NOT(CONTAINS) to NotInFilter.
if (subfilter.is<mbgl::style::InFilter>()) {
auto inFilter = subfilter.get<mbgl::style::InFilter>();
@@ -42,7 +42,7 @@
notInFilter.values = inFilter.values;
return notInFilter;
}
-
+
// Convert NOT(), NOT(AND), NOT(NOT), NOT(==), etc. into NoneFilter.
mbgl::style::NoneFilter noneFilter;
if (subfilter.is<mbgl::style::AnyFilter>()) {
@@ -64,7 +64,7 @@
return filter;
}
}
-
+
[NSException raise:@"Compound predicate type not handled"
format:@""];
return {};
diff --git a/platform/darwin/src/NSData+MGLAdditions.mm b/platform/darwin/src/NSData+MGLAdditions.mm
index ef171c5e1e..97c3bb4a26 100644
--- a/platform/darwin/src/NSData+MGLAdditions.mm
+++ b/platform/darwin/src/NSData+MGLAdditions.mm
@@ -8,7 +8,7 @@
{
std::string string(static_cast<const char*>(self.bytes), self.length);
std::string compressed_string = mbgl::util::compress(string);
-
+
return [NSData dataWithBytes:&compressed_string[0] length:compressed_string.length()];
}
@@ -16,7 +16,7 @@
{
std::string string(static_cast<const char*>(self.bytes), self.length);
std::string decompressed_string = mbgl::util::decompress(string);
-
+
return [NSData dataWithBytes:&decompressed_string[0] length:decompressed_string.length()];
}
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm
index b095091b17..f19a41327a 100644
--- a/platform/darwin/src/NSExpression+MGLAdditions.mm
+++ b/platform/darwin/src/NSExpression+MGLAdditions.mm
@@ -65,7 +65,7 @@
- (mbgl::FeatureIdentifier)mgl_featureIdentifier {
mbgl::Value mbglValue = self.mgl_constantMBGLValue;
-
+
if (mbglValue.is<std::string>()) {
return mbglValue.get<std::string>();
}
@@ -78,7 +78,7 @@
if (mbglValue.is<int64_t>()) {
return mbglValue.get<int64_t>();
}
-
+
return {};
}
diff --git a/platform/darwin/src/NSPredicate+MGLAdditions.mm b/platform/darwin/src/NSPredicate+MGLAdditions.mm
index 0ac68095f9..9fd6639b0a 100644
--- a/platform/darwin/src/NSPredicate+MGLAdditions.mm
+++ b/platform/darwin/src/NSPredicate+MGLAdditions.mm
@@ -4,7 +4,7 @@
class FilterEvaluator {
public:
-
+
NSArray *getPredicates(std::vector<mbgl::style::Filter> filters) {
NSMutableArray *predicates = [NSMutableArray arrayWithCapacity:filters.size()];
for (auto filter : filters) {
@@ -12,7 +12,7 @@ public:
}
return predicates;
}
-
+
NSExpression *getValues(std::vector<mbgl::Value> values) {
NSMutableArray *array = [NSMutableArray arrayWithCapacity:values.size()];
for (auto value : values) {
@@ -21,43 +21,43 @@ public:
}
return [NSExpression expressionForAggregate:array];
}
-
+
NSPredicate *operator()(mbgl::style::NullFilter filter) {
return nil;
}
-
+
NSPredicate *operator()(mbgl::style::EqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K == %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
-
+
NSPredicate *operator()(mbgl::style::NotEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K != %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
-
+
NSPredicate *operator()(mbgl::style::GreaterThanFilter filter) {
return [NSPredicate predicateWithFormat:@"%K > %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
-
+
NSPredicate *operator()(mbgl::style::GreaterThanEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K >= %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
-
+
NSPredicate *operator()(mbgl::style::LessThanFilter filter) {
return [NSPredicate predicateWithFormat:@"%K < %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
-
+
NSPredicate *operator()(mbgl::style::LessThanEqualsFilter filter) {
return [NSPredicate predicateWithFormat:@"%K <= %@", @(filter.key.c_str()), mbgl::Value::visit(filter.value, ValueEvaluator())];
}
-
+
NSPredicate *operator()(mbgl::style::InFilter filter) {
return [NSPredicate predicateWithFormat:@"%K IN %@", @(filter.key.c_str()), getValues(filter.values)];
}
-
+
NSPredicate *operator()(mbgl::style::NotInFilter filter) {
return [NSPredicate predicateWithFormat:@"NOT %K IN %@", @(filter.key.c_str()), getValues(filter.values)];
}
-
+
NSPredicate *operator()(mbgl::style::AnyFilter filter) {
NSArray *subpredicates = getPredicates(filter.filters);
if (subpredicates.count) {
@@ -65,13 +65,13 @@ public:
}
return [NSPredicate predicateWithValue:NO];
}
-
+
NSPredicate *operator()(mbgl::style::AllFilter filter) {
// Convert [all, [>=, key, lower], [<=, key, upper]] to key BETWEEN {lower, upper}
if (filter.filters.size() == 2) {
auto leftFilter = filter.filters[0];
auto rightFilter = filter.filters[1];
-
+
std::string lowerKey;
std::string upperKey;
mbgl::Value lowerBound;
@@ -83,7 +83,7 @@ public:
lowerKey = rightFilter.get<mbgl::style::GreaterThanEqualsFilter>().key;
lowerBound = rightFilter.get<mbgl::style::GreaterThanEqualsFilter>().value;
}
-
+
if (leftFilter.is<mbgl::style::LessThanEqualsFilter>()) {
upperKey = leftFilter.get<mbgl::style::LessThanEqualsFilter>().key;
upperBound = leftFilter.get<mbgl::style::LessThanEqualsFilter>().value;
@@ -91,7 +91,7 @@ public:
upperKey = rightFilter.get<mbgl::style::LessThanEqualsFilter>().key;
upperBound = rightFilter.get<mbgl::style::LessThanEqualsFilter>().value;
}
-
+
if (!lowerBound.is<mbgl::NullValue>() && !upperBound.is<mbgl::NullValue>()
&& lowerKey == upperKey) {
return [NSPredicate predicateWithFormat:@"%K BETWEEN {%@, %@}",
@@ -100,14 +100,14 @@ public:
mbgl::Value::visit(upperBound, ValueEvaluator())];
}
}
-
+
NSArray *subpredicates = getPredicates(filter.filters);
if (subpredicates.count) {
return [NSCompoundPredicate andPredicateWithSubpredicates:subpredicates];
}
return [NSPredicate predicateWithValue:YES];
}
-
+
NSPredicate *operator()(mbgl::style::NoneFilter filter) {
NSArray *subpredicates = getPredicates(filter.filters);
if (subpredicates.count > 1) {
@@ -119,15 +119,15 @@ public:
return [NSPredicate predicateWithValue:YES];
}
}
-
+
NSPredicate *operator()(mbgl::style::HasFilter filter) {
return [NSPredicate predicateWithFormat:@"%K != nil", @(filter.key.c_str())];
}
-
+
NSPredicate *operator()(mbgl::style::NotHasFilter filter) {
return [NSPredicate predicateWithFormat:@"%K == nil", @(filter.key.c_str())];
}
-
+
};
@implementation NSPredicate (MGLAdditions)
@@ -138,18 +138,18 @@ public:
{
return mbgl::style::AllFilter();
}
-
+
if ([self isEqual:[NSPredicate predicateWithValue:NO]])
{
return mbgl::style::AnyFilter();
}
-
+
if ([self.predicateFormat hasPrefix:@"BLOCKPREDICATE("])
{
[NSException raise:NSInvalidArgumentException
format:@"Block-based predicates are not supported."];
}
-
+
[NSException raise:NSInvalidArgumentException
format:@"Unrecognized predicate type."];
return {};
diff --git a/platform/darwin/src/NSString+MGLAdditions.h b/platform/darwin/src/NSString+MGLAdditions.h
index 246dc084f4..ff72e9d3af 100644
--- a/platform/darwin/src/NSString+MGLAdditions.h
+++ b/platform/darwin/src/NSString+MGLAdditions.h
@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Returns a title-cased representation of the receiver using the specified
locale.
-
+
@param The locale. For strings presented to users, pass in the current locale
(`+[NSLocale currentLocale]`). To use the system locale, pass in `nil`.
*/
diff --git a/platform/darwin/src/NSString+MGLAdditions.m b/platform/darwin/src/NSString+MGLAdditions.m
index 5c32f4b789..371ef4023e 100644
--- a/platform/darwin/src/NSString+MGLAdditions.m
+++ b/platform/darwin/src/NSString+MGLAdditions.m
@@ -45,7 +45,7 @@
scanner.charactersToBeSkipped = nil;
NSString *prefix;
[scanner scanCharactersFromSet:set intoString:&prefix];
-
+
NSString *trimmedString = [self.string stringByTrimmingCharactersInSet:set];
return [self attributedSubstringFromRange:NSMakeRange(prefix.length, trimmedString.length)];
}
diff --git a/platform/darwin/src/NSValue+MGLAdditions.h b/platform/darwin/src/NSValue+MGLAdditions.h
index 4a97c8e115..76388cf2bb 100644
--- a/platform/darwin/src/NSValue+MGLAdditions.h
+++ b/platform/darwin/src/NSValue+MGLAdditions.h
@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Creates a new value object containing the specified Core Location geographic
coordinate structure.
-
+
@param coordinate The value for the new object.
@return A new value object that contains the geographic coordinate information.
*/
@@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Creates a new value object containing the specified Mapbox coordinate span
structure.
-
+
@param span The value for the new object.
@return A new value object that contains the coordinate span information.
*/
@@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Creates a new value object containing the specified Mapbox coordinate bounds
structure.
-
+
@param bounds The value for the new object.
@return A new value object that contains the coordinate bounds information.
*/
@@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Creates a new value object containing the given `MGLOfflinePackProgress`
structure.
-
+
@param progress The value for the new object.
@return A new value object that contains the offline pack progress information.
*/
diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm
index caac2123d8..f4b2f8af01 100644
--- a/platform/darwin/src/http_file_source.mm
+++ b/platform/darwin/src/http_file_source.mm
@@ -100,7 +100,7 @@ public:
NSURLSession* session = nil;
NSString* userAgent = nil;
NSInteger accountType = 0;
-
+
private:
NSString* getUserAgent() const;
NSBundle* getSDKBundle() const;
@@ -108,7 +108,7 @@ private:
NSString *HTTPFileSource::Impl::getUserAgent() const {
NSMutableArray *userAgentComponents = [NSMutableArray array];
-
+
NSBundle *appBundle = [NSBundle mainBundle];
if (appBundle) {
NSString *appName = appBundle.infoDictionary[@"CFBundleName"];
@@ -118,7 +118,7 @@ NSString *HTTPFileSource::Impl::getUserAgent() const {
} else {
[userAgentComponents addObject:[NSProcessInfo processInfo].processName];
}
-
+
NSBundle *sdkBundle = HTTPFileSource::Impl::getSDKBundle();
if (sdkBundle) {
NSString *versionString = sdkBundle.infoDictionary[@"MGLSemanticVersionString"];
@@ -130,12 +130,12 @@ NSString *HTTPFileSource::Impl::getUserAgent() const {
sdkBundle.infoDictionary[@"CFBundleName"], versionString]];
}
}
-
+
// Avoid %s here because it inserts hidden bidirectional markers on macOS when the system
// language is set to a right-to-left language.
[userAgentComponents addObject:[NSString stringWithFormat:@"MapboxGL/%@ (%@)",
CFSTR(MBGL_VERSION_STRING), CFSTR(MBGL_VERSION_REV)]];
-
+
NSString *systemName = @"Darwin";
#if TARGET_OS_IPHONE
systemName = @"iOS";
@@ -158,7 +158,7 @@ NSString *HTTPFileSource::Impl::getUserAgent() const {
if (systemVersion) {
[userAgentComponents addObject:[NSString stringWithFormat:@"%@/%@", systemName, systemVersion]];
}
-
+
NSString *cpu = nil;
#if TARGET_CPU_X86
cpu = @"x86";
@@ -172,7 +172,7 @@ NSString *HTTPFileSource::Impl::getUserAgent() const {
if (cpu) {
[userAgentComponents addObject:[NSString stringWithFormat:@"(%@)", cpu]];
}
-
+
return [userAgentComponents componentsJoinedByString:@" "];
}
@@ -295,20 +295,20 @@ std::unique_ptr<AsyncRequest> HTTPFileSource::request(const Resource& resource,
response.error =
std::make_unique<Error>(Error::Reason::NotFound, "HTTP status code 404");
} else if (responseCode == 429) {
- //Get the standard header
+ // Get the standard header
optional<std::string> retryAfter;
NSString *retryAfterHeader = headers[@"Retry-After"];
if (retryAfterHeader) {
retryAfter = std::string([retryAfterHeader UTF8String]);
}
-
- //Fallback mapbox specific header
+
+ // Fallback mapbox specific header
optional<std::string> xRateLimitReset;
NSString *xReset = headers[@"x-rate-limit-reset"];
if (xReset) {
xRateLimitReset = std::string([xReset UTF8String]);
}
-
+
response.error = std::make_unique<Error>(Error::Reason::RateLimit, "HTTP status code 429", http::parseRetryHeaders(retryAfter, xRateLimitReset));
} else if (responseCode >= 500 && responseCode < 600) {
response.error =