You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Disable animations and transitions when reduced motion accessibility setting is enabled #15187
GL JS parityFor feature parity with Mapbox GL JSMapKit parityFor feature parity with MapKit on iOS or macOSaccessibilityIntegration with screen readers and other assistive technologyarchivedArchived because of inactivityiOSMapbox Maps SDK for iOS
When the “Reduce Motion” setting is enabled in the Accessibility section of Settings on iOS, map views should perform animations and transitions instantaneously. This would ensure parity with GL JS, which added support for CSS’s prefers-reduced-motion media query in mapbox/mapbox-gl-js#8494.
The iOS map SDK can detect this setting by calling UIAccessibilityIsReduceMotionEnabled() and can detect when the setting changes by observing for UIAccessibilityReduceMotionStatusDidChangeNotification. There is a similar user setting on macOS but no corresponding notification or getter that I can find.
One wrinkle is that some developers may have baked in an assumption that an animations lasts for a certain amount of time before starting a different animation. We should recommend that developers use completion handlers to chain animations rather than hard-coding delays.
Animations and transitions can be used as eye candy, but they can also be an integral part of an application. Apple's "Reduce Motion" feature is not intended to remove essential functionality (which animations and transitions sometimes are), it should only keep the screen calmer. Turning the feature on should not prevent you from using an app as intended.
Mapbox, please, if you implement this, make it developer configurable (respect / ignore setting) or time dependent (animations with longer than x seconds duration should not be prevented).
For example this is broken if the flyTo gets replaced by a jumpTo
We should probably match how MapKit respects (or doesn’t respect) this setting with regard to simpler methods like -[MKMapView setCamera:animated:]. On the other hand, MapKit doesn’t have any precedent for longer animations; its animations are fixed to a very short length.
Explicitly making the behavior configurable per camera operation would require additional parameters, which would be unfortunate, due to unwieldiness but also due to forcing the developer to make this decision every time they change the camera. Another approach would be to always perform all animations and expect the developer to check UIAccessibilityIsReduceMotionEnabled() as needed, but I’m not confident that developers would generally heed that advice.
If the iOS/macOS map SDK could support Core Animation implicit animation (#4352), then we might have more ways to encapsulate reduced motion support without forcing developers to explicitly opt in or out every time.
GL JS parityFor feature parity with Mapbox GL JSMapKit parityFor feature parity with MapKit on iOS or macOSaccessibilityIntegration with screen readers and other assistive technologyarchivedArchived because of inactivityiOSMapbox Maps SDK for iOS
Activity
dieterdreist commentedon Sep 4, 2019
Animations and transitions can be used as eye candy, but they can also be an integral part of an application. Apple's "Reduce Motion" feature is not intended to remove essential functionality (which animations and transitions sometimes are), it should only keep the screen calmer. Turning the feature on should not prevent you from using an app as intended.
Mapbox, please, if you implement this, make it developer configurable (respect / ignore setting) or time dependent (animations with longer than x seconds duration should not be prevented).
For example this is broken if the flyTo gets replaced by a jumpTo
1ec5 commentedon Sep 10, 2019
We should probably match how MapKit respects (or doesn’t respect) this setting with regard to simpler methods like
-[MKMapView setCamera:animated:]. On the other hand, MapKit doesn’t have any precedent for longer animations; its animations are fixed to a very short length.Explicitly making the behavior configurable per camera operation would require additional parameters, which would be unfortunate, due to unwieldiness but also due to forcing the developer to make this decision every time they change the camera. Another approach would be to always perform all animations and expect the developer to check
UIAccessibilityIsReduceMotionEnabled()as needed, but I’m not confident that developers would generally heed that advice.If the iOS/macOS map SDK could support Core Animation implicit animation (#4352), then we might have more ways to encapsulate reduced motion support without forcing developers to explicitly opt in or out every time.
stale commentedon Mar 8, 2020
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.