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

Attribute Mapbox and OpenStreetMap in-app - #1497

Merged
1ec5 merged 6 commits into
masterfrom
1ec5-info-menu
May 11, 2015
Merged

1ec5 merged 6 commits into
masterfrom
1ec5-info-menu

Conversation

@1ec5

@1ec5 1ec5 commented May 10, 2015

Copy link
Copy Markdown
Contributor

With this change, ℹ️ pops up an action sheet with the required attribution and a direct link to the Map Feedback tool. Eventually we’ll tackle something more along the lines of #1265 (comment), but this should be sufficient for beta 1.

/cc @lxbarth @incanus

ℹ️ now pops up an action sheet with explicit attribution and a direct link to the Map Feedback tool.
@1ec5 1ec5 added the iOS Mapbox Maps SDK for iOS label May 10, 2015
@1ec5 1ec5 added this to the iOS Beta 1 milestone May 10, 2015
@1ec5 1ec5 self-assigned this May 10, 2015
@friedbunny

Copy link
Copy Markdown
Contributor

Much improved over the Safari hyperlink. Seeing an action sheet popup from an ℹ️ button feels jarring, though, maybe because only one of the three items is immediately obvious as being actionable. But it feels good enough for now, methinks.

Eventually doing something cool with a modal view and real text will be a good opportunity to subtly show off. 😏

@incanus

incanus commented May 11, 2015

Copy link
Copy Markdown
Contributor

Seeing an action sheet popup from an ℹ️ button feels jarring

Apple does it in Maps, though it's in an app toolbar, not on the map. I think it's fine.

anigif-1431312253

iPad popover seems to work well, too:

screen shot 2015-05-10 at 7 58 50 pm

Except for post-rotation:

anigif-1431313288

Maybe this is ameliorated by iOS 8's UIAlertController? Is it iOS 7-safe?

@friedbunny

Copy link
Copy Markdown
Contributor

UIAlertController is iOS 8+, not sure if it would fix this.

That Apple Maps alert-ish view is crazy, hah. Segmented buttons, and the data attribution button is different than the actions. I think my perception of weirdness is more to do with the non-actionable action items — it's not immediately clear that "© OpenStreetMap" is a thing you can do.

But yeah, a little temporary weirdness (that I can't think of a good way to fix/reword, anyway) isn't the end of the world.

@1ec5

1ec5 commented May 11, 2015

Copy link
Copy Markdown
Contributor Author

Originally, with 965f90c, I stuck the copyright notices in the alert title and called the first button “About This Map”, which sounds more actionable. But @lxbarth and I were concerned that this style wouldn’t technically meet Mapbox’s attribution requirements, which requires a hyperlinked copyright notice. Plus, a direct link to OpenStreetMap will be welcome on the OSM talk list, I’m sure. 😃

@1ec5

1ec5 commented May 11, 2015

Copy link
Copy Markdown
Contributor Author

Except for post-rotation

Indeed, a constraint to the popover has to be broken when the device is rotated:

Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSLayoutConstraint:0x7aee1510 H:[UIView:0x7ea28ee0(304)]>",
    "<NSLayoutConstraint:0x7ef1ec70 UIView:0x7ef1e970.width == _UIAlertControllerView:0x7ea15640'Mapbox GL for iOS'.width>",
    "<NSAutoresizingMaskLayoutConstraint:0x7ec72640 h=--& v=--& H:[UIView:0x7ef1e970(0)]>",
    "<NSLayoutConstraint:0x7ea2ca00 _UIAlertControllerView:0x7ea15640'Mapbox GL for iOS'.width >= UIView:0x7ea28ee0.width>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7aee1510 H:[UIView:0x7ea28ee0(304)]>

It looks like a UIKit bug that probably wouldn’t affect UIAlertController. Even in the original orientation in the iPad Simulator, the popover’s pointer appears slightly off:

pointer

I think it’s because the center of the ℹ️ is a bit closer to the right edge than the center of a bottom bar button would be.

@friedbunny

Copy link
Copy Markdown
Contributor

Here's a quick go at UIAlertController. Using the same sourceRect approach still doesn't work with rotation, but I'm sure that can be fixed one way or another.

UIAlertController does do this for iPad popovers, though:

ios simulator screen shot may 10 2015 10 52 40 pm

@incanus I'm not sure what you mean by "safe" — it definitely won't run in iOS 7, but it can be checked against. I think I'm being dense here. 😢

@friedbunny

Copy link
Copy Markdown
Contributor

Hah, jinx @1ec5.

1ec5 added 3 commits May 10, 2015 23:22
Constraints go invalid when rotating an iPad while the popover is visible and anchored to the ℹ️.
The Map Feedback tool is still using mapbox.js, so it doesn’t support fractional zoom levels yet.
@1ec5

1ec5 commented May 11, 2015

Copy link
Copy Markdown
Contributor Author

With 7da7f65, the popover is dismissed when the device is rotated (and presumably whenever the map resizes), before the constraints can go invalid.

1ec5 added a commit that referenced this pull request May 11, 2015
Attribute Mapbox and OpenStreetMap in-app
@1ec5
1ec5 merged commit e7ba65c into master May 11, 2015
@1ec5
1ec5 deleted the 1ec5-info-menu branch May 11, 2015 07:27
1ec5 added a commit that referenced this pull request May 12, 2015
Also updated accessibility information for the ℹ️ to reflect changes in #1497.
@1ec5

1ec5 commented Apr 2, 2017

Copy link
Copy Markdown
Contributor Author

Here's a quick go at UIAlertController.

This code landed with a few modifications in #8373.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

iOS Mapbox Maps SDK for iOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants