Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[ios, macos] Add notes to APIs that rely on style and source ids #6886

Merged
merged 1 commit into from
Nov 30, 2016

Conversation

boundsj
Copy link
Contributor

@boundsj boundsj commented Nov 2, 2016

Fixes #6616 for iOS and macOS

cc @1ec5

@boundsj boundsj added iOS Mapbox Maps SDK for iOS documentation release blocker Blocks the next final release runtime styling labels Nov 2, 2016
@boundsj boundsj added this to the ios-v3.4.0 milestone Nov 2, 2016
@boundsj boundsj self-assigned this Nov 2, 2016
@mention-bot
Copy link

@boundsj, thanks for your PR! By analyzing the history of the files in this pull request, we identified @1ec5, @frederoni and @rmnblm to be potential reviewers.

@@ -177,6 +177,13 @@ static const NSInteger MGLStyleDefaultVersion = 9;
/**
Returns a layer that conforms to `MGLStyleLayer` if any layer with the given
identifier was found.

@note Layer identifiers are subject to change and are not guaranteed to exist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an awkward place to put “subject to change”. Maybe in the next sentence, say that the default style’s layers are subject to change.

@note Layer identifiers are subject to change and are not guaranteed to exist
accross styles or different versions of the same style. Applications that
use this API must set the style URL to an explicitly versioned style
using a convenience method like +[MGLStyle outdoorsStyleURLWithVersion:],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap this selector in backticks to enable autolinking in jazzy.

accross styles or different versions of the same style. Applications that
use this API must set the style URL to an explicitly versioned style
using a convenience method like +[MGLStyle outdoorsStyleURLWithVersion:],
the “Style URL” IBInspectable in `MGLMapView`, or a manually constructed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MGLMapView’s “Style URL” inspectable in Interface Builder

@1ec5
Copy link
Contributor

1ec5 commented Nov 2, 2016

Additional APIs to warn about:

  • -[MGLStyle removeLayer:]
  • -[MGLStyle removeSource:]
  • -[MGLStyle removeStyleClass:]
  • -[MGLStyle removeImageForName:]
  • -[MGLMapView visibleFeaturesInRect:inStyleLayersWithIdentifiers:]
  • -[MGLMapView visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:]
  • -[MGLMapView style] while we’re at it

@boundsj
Copy link
Contributor Author

boundsj commented Nov 3, 2016

Before I move on to #6886 (comment) I took another pass at the copy. Please let me know what you think.

@@ -177,6 +177,14 @@ static const NSInteger MGLStyleDefaultVersion = 9;
/**
Returns a layer that conforms to `MGLStyleLayer` if any layer with the given
identifier was found.

@note Layer identifiers are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must set the style
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/must/must first/

I think that could be a point of confusion for developers.

versions of the same style. Applications that use this API must 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: put NSURL in backticks (for consistency with SDK classes that would get autolinked, even if this one doesn’t get linked).

explicitly versioned style using a convenience method like
`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`'s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the macOS implementation of MGLMapView with these changes as well.

`+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`'s “Style URL”
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/layer/source/ (×2)

@boundsj
Copy link
Contributor Author

boundsj commented Nov 17, 2016

@1ec5 what do you think about this now?

@1ec5
Copy link
Contributor

1ec5 commented Nov 18, 2016

I think there’s still a typo in a couple places: #6886 (comment)

@boundsj
Copy link
Contributor Author

boundsj commented Nov 30, 2016

Corrected and rebased @1ec5

@boundsj boundsj merged commit ba77540 into release-ios-v3.4.0 Nov 30, 2016
@boundsj boundsj deleted the boundsj-warn-about-style-ids branch November 30, 2016 17:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation iOS Mapbox Maps SDK for iOS release blocker Blocks the next final release runtime styling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants