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

[ornaments] Refactor visibility options for the logo and attribution button #326

Merged
merged 8 commits into from
May 7, 2021

Conversation

jmkiley
Copy link
Contributor

@jmkiley jmkiley commented May 6, 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

The _isVisible property on the logo view and attribution button's ornament options is now visibility. This adds consistency with the compass and scale bar's visibility property.

Refactor OrnamentOptions so that there is one BaseOrnamentOptions struct, rather than individual structs for each ornament.

This PR also adds an Log.error that is shown when the logo or attribution button is hidden.

User impact (optional)

@jmkiley jmkiley added the breaking change ⚠️ If your pull request introduces a breaking change and updates are required when version is published label May 6, 2021
@jmkiley jmkiley requested a review from neelmistry94 May 6, 2021 18:15
@jmkiley jmkiley self-assigned this May 6, 2021
Copy link
Contributor

@julianrex julianrex left a comment

Choose a reason for hiding this comment

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

Looks good - question about visibility vs _visibility

Sources/MapboxMaps/Foundation/LogoView.swift Outdated Show resolved Hide resolved
Sources/MapboxMaps/Ornaments/OrnamentsManager.swift Outdated Show resolved Hide resolved
public override var isHidden: Bool {
didSet {
if isHidden {
Log.warning(forMessage: "Attribution must be enabled if you use data from sources that require it. See https://docs.mapbox.com/help/getting-started/attribution/ for more details.", category: "Ornaments")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming this language was checked by @sbma44

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jmkiley jmkiley merged commit 4f0ea47 into main May 7, 2021
@jmkiley jmkiley deleted the jk/ornament-visibility branch May 7, 2021 15:18
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.

3 participants