Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move options for ornaments into individual structs #318

Merged
merged 9 commits into from
May 5, 2021

Conversation

jmkiley
Copy link
Contributor

@jmkiley jmkiley commented May 5, 2021

PRs must be submitted under the terms of our Contributor License Agreement CLA.

Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Add example if relevant.
  • Document any changes to public APIs.
  • Apply changelog label ('breaking change', 'bug 🪲', 'build', 'docs', 'feature 🍏', 'performance ⚡', 'testing 💯') or use the label 'skip changelog'
  • Add an entry inside this element for inclusion in the mapbox-maps-ios changelog: <changelog></changelog>.
  • Update the migration guide, API Docs, Markdown files - Readme, Developing, etc

Summary of changes

This PR breaks the different ornament options into separate structs, which are then accessed via properties on OrnamentOptions. Therefore, OrnamentOptions.scaleBarVisibility becomes OrnamentOptions.scaleBar.visibility.

User impact (optional)

nishant-karajgikar and others added 8 commits May 5, 2021 10:23
…#307)

* Expose computed vars for operators + arguments of expressions

* Support string based arrays as valid expression argument

* Refactor ExpressionBuilder

* review comment

* cleanup

Remove check for iOS 11

Update LogoView to make class and properties internal

Update OrnamentsManager.options documentation

Updated the changelog

Remove options parameter from MapConfig.setupOrnaments()

Updated changelog to note that MapView.update no longer used for ornaments
@jmkiley jmkiley added the breaking change ⚠️ If your pull request introduces a breaking change and updates are required when version is published label May 5, 2021
@jmkiley jmkiley self-assigned this May 5, 2021
/// The default value for this property is `CGPoint(x: 8.0, y: 8.0)`.
public var margins: CGPoint = defaultOrnamentsMargin
/// The default value for this property is `.adaptive`.
public var visibility: OrnamentVisibility = .adaptive
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like visibility is consistent as a property, we should add that as part of the BaseOrnamentOptions protocol

/// The default value for this property is `CGPoint(x: 8.0, y: 8.0)`.
public var margins: CGPoint = defaultOrnamentsMargin
/// The default value for this property is `true`.
public var _isVisible: Bool = true
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we use OrnamentVisibility here and make it conform to BaseOrnamentOptions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we originally used a BOOL here because these two ornaments wouldn't ever have .adaptive visibility.

Copy link
Contributor

Choose a reason for hiding this comment

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

But we can control that right? Should the user not be allowed to change that configuration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we can label that as tailwork, since it may require more discussion.

/// The default value for this property is `CGPoint(x: 8.0, y: 8.0)`.
public var margins: CGPoint = defaultOrnamentsMargin
/// The default value for this property is `true`.
public var _isVisible: Bool = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as AttributionButtonOptions

Copy link
Contributor

@neelmistry94 neelmistry94 left a comment

Choose a reason for hiding this comment

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

Please make a follow up ticket for tailwork

@jmkiley jmkiley merged commit 9a61707 into main May 5, 2021
@jmkiley jmkiley deleted the jk/ornament-options-refactor branch May 5, 2021 18:07
OdNairy pushed a commit that referenced this pull request Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change ⚠️ If your pull request introduces a breaking change and updates are required when version is published
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants