Commit Graph

16 Commits

Author SHA1 Message Date
Fabian Guerra Soto
a938c3ef68 [ios, macos] Offline regions merge. (#12791)
* [ios, macos] Add offline regions merge.

* [ios, macos] Update changelogs.

* [ios, macos] Fix refreshing the offline packs after new content is added.

* [ios, macos] Update MGLOfflineStorage's add contents of file documentation.

* [ios, macos] Add MGLOfflineStorage test cases for adding file contents.

* [ios, macos] Add offline merge test database.

* [ios, macos] Add packs parameter to MGLBatchedOfflinePackAdditionCompletionHandler.

* [core] Fix a query mege duplication.

* [ios, macos] Remove unnecessary pack iteration.

* [ios, macos] Fix packs update KVO notifications.

* [ios, macos] Add localization strings.

* [core] Fix query readability.

* [ios, macos] Fix MGLOfflineStorageTest, cleanup the cache database after the test.

* [ios, macos] Fix offline packs, updating triggers a crash.
2018-09-17 15:31:43 -07:00
Minh Nguyễn
9c1dfe46cf [ios, macos] Cleaned up base localization files
Localizable strings in Darwin classes need to specify “Foundation” as the table so that NSBundle consults the right .strings files. Reran make genstrings to add some missing strings to the base localizations and undo some manual edits to the base localizations that contained errors.
2017-12-18 11:41:56 -08:00
Jordan Kiley
f89afa0b27 [ios, macos] Rename the iOS and macOS SDKs (#10610) 2017-12-06 10:13:17 -05:00
Fabian Guerra
5eb050dc35 [ios, macos] Update the attribution format for small snapshots. 2017-11-17 16:40:12 -05:00
Minh Nguyễn
2955fb594c Make places and roads accessible to VoiceOver (#9950)
* [ios] Summarize places, roads after zooming with VoiceOver

After zooming, MGLMapView’s accessibility value now indicates the number of visible roads and lists out a few places visible in the current viewport, starting with the features at the highest z-index (not necessarily the largest or the closest to the center of the view). Avoid saying that no annotations are visible.

* [ios] Allow VoiceOver to navigate among place features

Split out a separate header for the various accessibility elements tied to MGLMapView. Wrap place features in accessibility elements and insert them into the narration order after the visible annotations but before the attribution button. Refactored MGLMapView’s accessibility code to rely on ranges to avoid off-by-one errors.

* [ios] Post layout change notification when fully rendered

Post a layout change notification when fully finishing a map render.

* [ios, macos] Moved MGLVectorSource+MGLAdditions to more specific group

* [ios] Localize accessibility feature names

* [ios] Find place feature accessibility elements by identifier

* [ios] Refactored accessibility traits

Also created a new MGLPlaceFeatureAccessibilityElement class.

* [ios] Sort accessibility elements by screen distance from center

Sort annotation accessibility elements by screen distance, not the hypotenuse of coordinates, which can yield incorrect results when the map is rotated or tilted or when the user is located at high latitudes. Sort place feature accessibility elements by screen distance as well.

* [ios] Create a place feature accessibility element, not an abstract feature accessibility element

* [ios] Only query for visible place features once per camera

Improved accessibility performance after changing the map camera. MGLMapView no longer queries the map for place features once per place feature.

* [ios] Made roads accessible

Wrap visible road features in accessibility elements described by the road name, route number, and general direction of travel.

* [ios] Cleaned up radian conversions

* [ios] Thickened road accessibility elements

* [ios] Made unioned roads accessible

* [ios] Consistently sort accessibility elements

Also fixed an issue causing road feature accessibility elements to get treated like place feature accessibility elements.

* [ios] Announce direction of divided roads

Announce the direction of a divided road based on the direction of its first polyline.

* [ios] Refined announced elevation units

* [ios] Romanize feature names

* [ios] Updated changelog

* [ios] Delay zoom announcement

A 100-millisecond delay is enough for the post-zooming announcement to reflect the new zoom level rather than the previous zoom level.

* [ios] Consolidated geometry functions

Adopted MGLGeometry_Private.h in the accessibility code, forcing a conversion to Objective-C++. Avoid inlining some of the more complex geometric functions.

* [ios] Fixed feature name romanization in accessibility labels

NSLocale.scriptCode is only set when the locale identifier explicitly specifies a script. Use NSOrthography to identify the dominant orthography regardless of locale.

Also added a unit test of feature accessibility element labels.

* [ios] Added tests for place, road accessibility values

* [ios] Announce one-way roads

A road feature’s accessibility value now indicates whether the road is a one-way road.
2017-11-03 12:17:45 -07:00
Minh Nguyễn
003caddbc0 [ios] Localized map view proxy accessibility hint 2017-03-30 11:47:09 -07:00
John Firebaugh
e488ca702e Merge branch 'release-ios-v3.5.0-android-v5.0.0' 2017-03-21 12:04:20 -07:00
Minh Nguyễn
f846205eb6 [ios, macos] Fix map load error descriptions (#8466)
* [ios, macos] Corrected map load error descriptions

Ensured the uniqueness of localizable string IDs. Ran make genstrings to add the -[MGLMapViewDelegate mapViewDidFailToLoad:withError:] error description strings to the base localization.

* [ios, macos] Moved failure error changelog entry to new release
2017-03-18 14:59:11 -07:00
Jason Wray
5e36743ef7 [ios] Add SDK version update checking/notification 2017-03-07 10:43:08 -08:00
Minh Nguyễn
fe53af7de0 [ios, macos] Source-driven attribution (#5999)
* [ios, macos] Source-driven attribution

Refactored MGLSource initialization. Implemented a new private class, MGLAttributionInfo, that parses an HTML attribution string from TileJSON and stores the resulting structured data. Added methods to MGLTileSet and MGLStyle to aggregate MGLAttributionInfos.

On macOS, update the attribution view as soon as the source attribution changes. On iOS, fetch the current attribution information when displaying the action sheet.

Removed hard-coded attribution strings.

* [macos] Respect inline formatting in attribution HTML

Apply a default font and color to attribution HTML as it is imported into an attributed string. Pass the attributed string into MGLAttributionButton as is, without stripping formatting. Avoid overriding the font and color after importing the HTML, in case these attributes are explicitly specified rather than intrinsic to a hyperlink.

Constrain the top of the attribution view to all the attribution buttons, in case one of them needs additional headspace.

* [ios, macos] Display unlinked attribution strings

Unlinked attribution strings are represented on macOS as buttons that have the default cursor and do nothing when clicked. On iOS, they are action sheet buttons that do nothing but dismiss the action sheet.

* [macos] Fixed random Auto Layout exception

Auto Layout randomly finds itself unable to satisfy constraints when updating attribution, due to some spurious constraints between attribution buttons. Regenerate the entire attribution view every time the source attribution changes.

* [ios, macos] Thoroughly dedupe attribution infos

Also added a test to verify parity with the GL JS implementation. This implementation avoids sorting.

* [ios, macos] Trim whitespace from attribution strings

Also added parsing tests.

* [ios, macos] Added attribution parsing tests for styles

Included an emoji test to ensure that attribution strings are interpreted as UTF-8, to avoid mojibake. Included a test of removing the underline from a leading copyright symbol.

* [ios, macos] Derive feedback link from source

MGLAttributionInfo now detects feedback links in the attribution HTML code, and it is responsible for tailoring the feedback URL to the current viewport.

Removed the hard-coded feedback action from the attribution sheet on iOS in favor of a source-derived feedback title and URL. Moved the feedback action from macosapp to MGLMapView; applications are now expected to hook an Improve This Map menu item to an MGLMapView action.
2016-12-08 17:43:17 -08:00
Minh Nguyễn
51cd97861c [ios] Announce zoom level, visible annotations after zooming
Announce the zoom level and number of visible annotations after zooming using VoiceOver’s swipe up or swipe down gesture.

Works toward #4821.
2016-04-26 16:47:04 -07:00
Minh Nguyễn
193a843013 [ios] Fixed ℹ️, user dot accessibility
The user location annotation view is created lazily, so if the user dot isn’t within view at launch, it doesn’t exist by the time UIKit first queries MGLMapView for child accessibility elements. This caused console spew about missing accessibility elements and prevented the ℹ️ from being visible to XCUITest.
2016-04-26 14:19:05 -07:00
Minh Nguyễn
d9a2a845de [ios] Added accessibility labels, hints, gestures
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.
2016-04-25 00:24:35 -07:00
Minh Nguyễn
893a777a2f [ios] Made compass and user dot accessible
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”.)
2016-04-25 00:16:28 -07:00
Minh Nguyễn
f1200d47db [ios, osx] Made localizable strings unique; unlocalized iosapp
Assigned unique IDs to localizable English strings in code.

Made iosapp non-localizable. For the time being, it isn’t worth the trouble to localize more strings for this demo application than for the SDK itself.
2016-04-24 16:17:43 -07:00
Minh Nguyễn
6c9ca4be50 [ios] Made SDK and iosapp localizable
Made storyboards and strings throughout the SDK and iosapp localizable. Replaced the compass image with an unlabeled image. Draw a localizable string atop it at runtime.

Redefined NSLocalizedString() and NSLocalizedStringFromTable() macros to look at the SDK bundle rather than the main application bundle. This redefinition has no effect on the host application, because it’s in an internal header. That header must be included in all files that contain localizable strings. See NSBundle+MGLAdditions.h for a full explanation.

Added a make rule that runs genstrings and ensures UTF-8 output (since genstrings insists on UTF-16).

Use MGLCoordinateFormatter in iosapp for dropped pin callouts. Rely on subclasses of MGLPointAnnotation instead of annotation titles to distinguish between different kinds of point annotations.
2016-04-24 16:13:08 -07:00