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

Simplify style property enumeration names - #6589

Merged
1ec5 merged 2 commits into
masterfrom
1ec5-style-enum-trim-6577
Oct 11, 2016
Merged

1ec5 merged 2 commits into
masterfrom
1ec5-style-enum-trim-6577

Conversation

@1ec5

@1ec5 1ec5 commented Oct 5, 2016

Copy link
Copy Markdown
Contributor

The name and values of each enumeration type no longer refers to the layer type that uses the type. Instead, the specific class and property that uses the type is mentioned in the documentation comment, to be cross-linked in the jazzy-generated documentation.

Fixes #6540, fixes #6577.

/cc @incanus

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS refactor macOS Mapbox Maps SDK for macOS documentation runtime styling labels Oct 5, 2016
@1ec5 1ec5 added this to the ios-v3.4.0 milestone Oct 5, 2016
@1ec5 1ec5 self-assigned this Oct 5, 2016
@mention-bot

Copy link
Copy Markdown

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

@1ec5

1ec5 commented Oct 5, 2016

Copy link
Copy Markdown
Contributor Author

One consequence of this change is that, going forward, the style specification shouldn’t allow any two layer types to have identically named properties.

@1ec5
1ec5 force-pushed the 1ec5-style-enum-trim-6577 branch from fa12fb5 to ea80423 Compare October 6, 2016 23:29

@incanus incanus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One consequence of this change is that, going forward, the style specification shouldn’t allow any two layer types to have identically named properties.

Shouldn't be a problem though, given that properties still have a prefix of the layer type (e.g. MGLCircle...?

@1ec5

1ec5 commented Oct 7, 2016 •

Copy link
Copy Markdown
Contributor Author

One consequence of this change is that, going forward, the style specification shouldn’t allow any two layer types to have identically named properties.

Shouldn't be a problem though, given that properties still have a prefix of the layer type (e.g. MGLCircle...?

Theoretically, the style specification could be extended so that the circle layer type has a icon-rotation property just like the symbol layer type does today. That would break this assumption, because Objective-C has no namespacing: both properties would be typed as MGLIconRotation, potentially with different allowed values.

@incanus

incanus commented Oct 7, 2016

Copy link
Copy Markdown
Contributor

Theoretically, the style specification could be extended so that the circle layer type has a icon-rotation property just like the symbol layer type does today.

Wait, why wouldn't we have MGLCircleIconRotation and MGLSymbolIconRotation?

This PR has both layer-less properties like MGLIconRotationAlignment as well as layered ones like MGLSymbolPlacement. Why is MGLIconRotationAlignment not MGLSymbolIconRotationAlignment?

@incanus

incanus commented Oct 7, 2016

Copy link
Copy Markdown
Contributor

Actually, scratch that—I get it, those properties just happen to refer to the layer type in their name. Never mind.

/cc @jfirebaugh on this for some 👀. It's less invasive than what was initially proposed in #6577 (and which I agree with @jfirebaugh on about accepting some redundancy).

@1ec5

1ec5 commented Oct 7, 2016

Copy link
Copy Markdown
Contributor Author

This PR has both layer-less properties like MGLIconRotationAlignment as well as layered ones like MGLSymbolPlacement. Why is MGLIconRotationAlignment not MGLSymbolIconRotationAlignment?

Because the properties are called icon-rotation-alignment and symbol-placement in the style specification. In #6577, I had originally proposed that we drop redundant words from the style properties wherever possible, so that we’d end up with MGLSymbolIconRotationAlignment and MGLSymbolPlacement, but that idea didn’t fly.

@1ec5
1ec5 force-pushed the 1ec5-style-enum-trim-6577 branch from ea80423 to 24c02d5 Compare October 11, 2016 21:36
1ec5 added 2 commits October 11, 2016 15:30
The name of each enumeration type no longer refers to the layer type that uses it.
@1ec5
1ec5 force-pushed the 1ec5-style-enum-trim-6577 branch from 24c02d5 to 3c22b14 Compare October 11, 2016 22:30
@1ec5
1ec5 merged commit 3c22b14 into master Oct 11, 2016
@1ec5
1ec5 deleted the 1ec5-style-enum-trim-6577 branch October 11, 2016 22:52
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 macOS Mapbox Maps SDK for macOS refactor runtime styling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style attribute enumerations redundantly include layer class names cross-reference Darwin enum docs to properties that use them

3 participants