-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
Annotations are now accessible, but it requires more work to find a visible annotation by its unique ID than I’d like. Given how many times |
This is gonna be great. Once we hit #352 at get a |
To my knowledge, Apple Maps' VoiceOver support when simply viewing the map is limited to POIs. But it'd be awesome if we could use pick out road labels to deliver more comprehensible location readouts at high zoom levels ("near the corner of Broad and High Streets, facing Central Park"), instead of prosaic coordinates and compass directions, without requiring separate calls to a geocoder. |
Nah, they do all places visible + roads by default. Here's an example: https://dl.dropboxusercontent.com/u/575564/voiceover.mp4 Sorry about the annoying speed I went through it — wasn't hearing the audio when recording so wasn't sure it was working. |
Oh cool, although it must be really annoying to have to sift through all the road labels just to get to a POI. Our developers are mostly presenting maps where the annotations matter much more than the base map, so once feature picking gets us granular accessibility elements, we’ll need to make the level of detail configurable. |
e213194
to
cb34703
Compare
I split out and cleaned up the display string formatting in #4802. |
f535755
to
d63401f
Compare
Enabled direct interaction with `MGLMapView`, allowing for panning and so forth. Defined an accessibility value that announces the current center coordinate. Inset the map view accessibility frame to exclude ornaments from the interactive element.
Made the compass behave like a button when visible. Added accessibility values and hints. The compass’s accessibility value uses the compass direction formatter. Turned off direct interaction with the map because it obscures the ornaments. The user dot now reports the current coordinates. Its accessibility label now reflects its annotation’s title instead of the hardcoded label “User location”. (It’d be weird to address the VoiceOver user as “user”.)
Lazily create and cache accessibility elements for visible annotations as UIAccessibility asks about them. Sort the annotations’ accessibility elements by the annotations’ distance from the logical center (the center after accounting for padding, or the user dot when user tracking mode is on). Updated the changelog. Fixes #1493.
Put the user dot back into rotation as an accessible element.
Via nfarina/calloutview#84, SMCalloutView is now accessible. Activating a focused annotation now shows its callout view and focuses its left accessory view, if present, or the title view. There is a “return to map” accessibility element for dismissing the callout view and restoring focus to the annotation on the map.
Fixed an issue where the “return to map” accessibility element lacked a label. Always update the title and subtitle of an annotation accessibility element, in case the title or subtitle changes from one showing to the next. Added a hint for annotations. Use declarative rather than imperative for hints. Marked the map view and its annotations as adjustable so that swiping up and down with VoiceOver zooms out and in, respectively. Added accessibility values to toolbar buttons in iosapp.
@boundsj, these changes shouldn’t conflict too badly with what you’re working on in #4801, but you’ll want to update some of this logic for annotation views. For example, a view-based annotation’s accessibility frame should be the view’s frame instead of the return value of |
The changes in this PR are intended to reach
parity with MapKitbasic user expectations in terms of VoiceOver accessibility.By comparison, MapKit has pretty good accessibility, while Google Maps is largely inaccessible on iOS.
There are also architectural improvements in this PR:
This was split out into Refactored iOS annotation selection #3261.MGLMapView
now maps annotation IDs to annotation contexts, which contain the annotations themselves (Annotation tap gesture recognizer queries hard-coded region, ignoring image sizes #1504). Previously, annotations were mapped to annotation IDs. The new approach reduces the number of places we need to iterate over the entire mapping and will make it a bit easier to implement another kinds of annotations (merge GeoJSON vector tiles work #893).