From e38216d25444fd426921c372898c425d6030355e Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Tue, 17 Jan 2017 20:54:36 -0800 Subject: Typo fixes, added line to MGLStyleLayer initializer description (#7759) * Typo fixes in MGLMapCamera.h and MGLMapView.h * Added line to MGLStyleLayer initializer description * Edited line in MGLShapeCollection.h --- platform/darwin/src/MGLMapCamera.h | 2 +- platform/darwin/src/MGLShapeCollection.h | 4 ++-- platform/darwin/src/MGLStyleLayer.h | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'platform/darwin') diff --git a/platform/darwin/src/MGLMapCamera.h b/platform/darwin/src/MGLMapCamera.h index f6bff36280..abb43d9aea 100644 --- a/platform/darwin/src/MGLMapCamera.h +++ b/platform/darwin/src/MGLMapCamera.h @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)camera; /** - Returns a new camera using based on information about the camera’s viewpoint + 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 diff --git a/platform/darwin/src/MGLShapeCollection.h b/platform/darwin/src/MGLShapeCollection.h index 01aece824f..b0f3e964d4 100644 --- a/platform/darwin/src/MGLShapeCollection.h +++ b/platform/darwin/src/MGLShapeCollection.h @@ -28,8 +28,8 @@ NS_ASSUME_NONNULL_BEGIN convenient to use an `MGLPointCollection`, `MGLMultiPolyline`, or `MGLMultiPolygon` object, respectively. - A multipolyline is known as a - GeometryCollection + A shape collection is known as a + GeometryCollection geometry in GeoJSON. */ @interface MGLShapeCollection : MGLShape diff --git a/platform/darwin/src/MGLStyleLayer.h b/platform/darwin/src/MGLStyleLayer.h index 4032be9297..a91ac11c2d 100644 --- a/platform/darwin/src/MGLStyleLayer.h +++ b/platform/darwin/src/MGLStyleLayer.h @@ -27,9 +27,14 @@ NS_ASSUME_NONNULL_BEGIN /** 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. -- cgit v1.2.1 From 5a2bb8d2409b0edf53c514dd5da02e34705d67fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Sat, 21 Jan 2017 15:17:01 -0800 Subject: [ios, macos] Note that canvas sources are unsupported --- platform/darwin/docs/guides/For Style Authors.md.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/darwin') diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index 3d775c8a89..d1cbfff4f5 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -178,7 +178,7 @@ In style JSON | In the SDK `raster` | `MGLRasterSource` `vector` | `MGLVectorSource` -`image` and `video` sources are not supported. +`canvas`, `image`, and `video` sources are not supported. ### Tile sources -- cgit v1.2.1 From b32c17119e5b046aab796a29e321759095a0959b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Sat, 21 Jan 2017 18:22:19 -0800 Subject: [ios] EdgeInsets is UIEdgeInsets in Swift on iOS --- platform/darwin/docs/guides/For Style Authors.md.ejs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'platform/darwin') diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index d1cbfff4f5..ee13aa1130 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -282,9 +282,15 @@ Array (`-padding`) | `NSValue.edgeInsetsValue` | `NSValue.edgeInsetsValue` <% } -%> For padding attributes, note that the arguments to -`<%- cocoaPrefix %>EdgeInsetsMake()` in Objective-C and -`EdgeInsets(top:left:bottom:right:)` in Swift are specified in counterclockwise -order, in contrast to the clockwise order defined by the style specification. +<% if (iOS) { -%> +`UIEdgeInsetsMake()` in Objective-C and `UIEdgeInsets(top:left:bottom:right:)` +in Swift +<% } else { -%> +`NSEdgeInsetsMake()` in Objective-C and `EdgeInsets(top:left:bottom:right:)` in +Swift +<% } -%> +are specified in counterclockwise order, in contrast to the clockwise order +defined by the style specification. <% if (macOS) { -%> Additionally, on macOS, a screen coordinate of (0, 0) is located at the -- cgit v1.2.1 From 35ce4f00e50ea6f16243156cc2927e38832edfe5 Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Wed, 25 Jan 2017 09:33:27 -0800 Subject: Clarify that clustering option is for shape sources (#7837) * [ios] Clarify that shape source needed for clustering. Fixes #7821. --- platform/darwin/src/MGLShapeSource.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'platform/darwin') diff --git a/platform/darwin/src/MGLShapeSource.h b/platform/darwin/src/MGLShapeSource.h index a44db69475..995abadda7 100644 --- a/platform/darwin/src/MGLShapeSource.h +++ b/platform/darwin/src/MGLShapeSource.h @@ -20,6 +20,8 @@ typedef NSString *MGLShapeSourceOption NS_STRING_ENUM; This attribute corresponds to the cluster source property in the Mapbox Style Specification. + + This option only affects point features within a shape source. */ extern const MGLShapeSourceOption MGLShapeSourceOptionClustered; -- cgit v1.2.1 From f5bcf186f63f0f10642dcee14a680667c36cbfdb Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Wed, 25 Jan 2017 11:11:45 -0800 Subject: [ios] changed URL -> url (#7841) Changed `@param URL` -> `@param url` in `MGLShapeSource.h` Fixes #7840 --- platform/darwin/src/MGLShapeSource.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/darwin') diff --git a/platform/darwin/src/MGLShapeSource.h b/platform/darwin/src/MGLShapeSource.h index 995abadda7..0ab3861aa9 100644 --- a/platform/darwin/src/MGLShapeSource.h +++ b/platform/darwin/src/MGLShapeSource.h @@ -118,7 +118,7 @@ extern const MGLShapeSourceOption MGLShapeSourceOptionSimplificationTolerance; 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 + @param url An HTTP(S) URL, absolute file URL, or local file URL relative to the current application’s resource bundle. @param options An `NSDictionary` of options for this source. @return An initialized shape source. -- cgit v1.2.1 From 7684bc2125a020bf44e2a99cbd49f7b3618ba52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Tue, 24 Jan 2017 13:07:34 -0800 Subject: [ios, macos] Testify MGLMapView gesture recognizer example --- platform/darwin/scripts/update-examples.js | 4 ++-- .../darwin/test/MGLDocumentationExampleTests.swift | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'platform/darwin') diff --git a/platform/darwin/scripts/update-examples.js b/platform/darwin/scripts/update-examples.js index 6291326068..e6b747a460 100644 --- a/platform/darwin/scripts/update-examples.js +++ b/platform/darwin/scripts/update-examples.js @@ -108,10 +108,10 @@ function completeExamples(os) { } // Resolve conditional compilation blocks. - example = example.replace(/^(\s*)#if\s+os\((iOS|macOS)\)\n([^]*?)(?:^\1#else\n([^]*?))?^\1#endif\n/gm, + example = example.replace(/^(\s*)#if\s+os\((iOS|macOS)\)\n([^]*?)(?:^\1#else\n([^]*?))?^\1#endif\b\n?/gm, function (m, indentation, ifOs, ifCase, elseCase) { return (os === ifOs ? ifCase : elseCase).replace(new RegExp('^ ', 'gm'), ''); - }); + }).replace(/\n$/, ''); // Insert the test method contents into the documentation comment just // above the substructure. diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift index d796b4e708..9336db7e49 100644 --- a/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/darwin/test/MGLDocumentationExampleTests.swift @@ -217,4 +217,25 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "contour")) } + + func testMGLMapView() { + //#-example-code + #if os(macOS) + class MapClickGestureRecognizer: NSClickGestureRecognizer { + override func shouldRequireFailure(of otherGestureRecognizer: NSGestureRecognizer) -> Bool { + return otherGestureRecognizer is NSClickGestureRecognizer + } + } + #else + let mapTapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(myCustomFunction)) + for recognizer in mapView.gestureRecognizers! where recognizer is UITapGestureRecognizer { + mapTapGestureRecognizer.require(toFail: recognizer) + } + mapView.addGestureRecognizer(mapTapGestureRecognizer) + #endif + //#-end-example-code + } + + // For testMGLMapView(). + func myCustomFunction() {} } -- cgit v1.2.1 From 0a8cfdd593dc22fc0d48386608347d531971ff39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Tue, 24 Jan 2017 13:08:56 -0800 Subject: [macos] Refer to Night Shift in style compatibility guide --- platform/darwin/docs/guides/For Style Authors.md.ejs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'platform/darwin') diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index ee13aa1130..254a7cf219 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -42,9 +42,10 @@ underneath. The user location annotation view, the attribution button, any buttons in callout views, and any items in the navigation bar are influenced by your application’s tint color, so choose a tint color that constrasts well with your -map style. If you intend your style to be used in the dark, consider the impact -that Night Shift may have on your style’s colors. +map style. <% } -%> +If you intend your style to be used in the dark, consider the impact that Night +Shift may have on your style’s colors. ### Typography and graphics -- cgit v1.2.1 From 8ac99759415a8d89fc8b49b702eedc6867e4e4a5 Mon Sep 17 00:00:00 2001 From: fabian-guerra Date: Wed, 25 Jan 2017 22:38:53 -0500 Subject: [ios, macos] Deprecate style class API (#7785) --- platform/darwin/src/MGLStyle.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'platform/darwin') diff --git a/platform/darwin/src/MGLStyle.h b/platform/darwin/src/MGLStyle.h index fcb464a303..8c30b069b8 100644 --- a/platform/darwin/src/MGLStyle.h +++ b/platform/darwin/src/MGLStyle.h @@ -361,7 +361,7 @@ static const NSInteger MGLStyleDefaultVersion = 9; /** Currently active style classes, represented as an array of string identifiers. */ -@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses; +@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((deprecated("This property will be removed in a future release."))); /** Returns a Boolean value indicating whether the style class with the given @@ -370,14 +370,14 @@ static const NSInteger MGLStyleDefaultVersion = 9; @param styleClass The style class to query for. @return Whether the style class is currently active. */ -- (BOOL)hasStyleClass:(NSString *)styleClass; +- (BOOL)hasStyleClass:(NSString *)styleClass __attribute__((deprecated("This method will be removed in a future release."))); /** Activates the style class with the given identifier. @param styleClass The style class to activate. */ -- (void)addStyleClass:(NSString *)styleClass; +- (void)addStyleClass:(NSString *)styleClass __attribute__((deprecated("This method will be removed in a future release."))); /** Deactivates the style class with the given identifier. @@ -392,7 +392,7 @@ static const NSInteger MGLStyleDefaultVersion = 9; @param styleClass The style class to deactivate. */ -- (void)removeStyleClass:(NSString *)styleClass; +- (void)removeStyleClass:(NSString *)styleClass __attribute__((deprecated("This method will be removed in a future release."))); #pragma mark Managing a Style’s Images -- cgit v1.2.1