Commit Graph

835 Commits

Author SHA1 Message Date
Minh Nguyễn
27f77b6bfa [ios] Hide compass from VoiceOver when pointing north
Fixes #4820.
2016-04-26 00:16:20 -07:00
Minh Nguyễn
cf2ef5b40b [ios] Use default images for world tour destinations
Use the default red pin images for world tour destinations in iosapp instead of the two characters usually used for the “Add n Points” actions.
2016-04-25 22:02:06 -07:00
Jason Wray
8ce0fb4739 [ios] Update frame size when changing dot/puck mode
- Keeps the same center point
- `updateFrameWithSize:` does not take CGSize because there is not yet
  support for non-square user location annotations
2016-04-25 17:00:43 -04: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
7cc3928a19 [ios] Made annotation callouts accessible
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.
2016-04-25 00:18:57 -07:00
Minh Nguyễn
9d3269eaa3 [ios] Restored user dot accessibility
Put the user dot back into rotation as an accessible element.
2016-04-25 00:18:06 -07:00
Minh Nguyễn
babc43ea62 [ios] Made annotations accessible
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.
2016-04-25 00:17:02 -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
9350075812 [ios] VoiceOver support for MGLMapView
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.
2016-04-25 00:15:56 -07:00
Minh Nguyễn
c376380112 [ios] Added separate target for Settings.bundle
Added a separate target to produce the example Settings.bundle. Use the build product in iosapp instead of a folder reference.

Added the bundle and settings targets as dependencies on the dynamic and static targets instead of listing them explicitly in various schemes.
2016-04-24 17:58:05 -07:00
Minh Nguyễn
8de7a75f02 [ios] Use base localization for Settings.bundle
Also converted the bundle’s strings file from UTF-16 encoding to UTF-8 encoding for better diffability.
2016-04-24 17:39:17 -07:00
Minh Nguyễn
540bbc537e [ios] Fixed ios-test build warnings 2016-04-24 16:41:19 -07:00
Minh Nguyễn
19f4236ebb [ios, osx] Document common workflows
We have a lot of targets now, and it isn’t always clear to new contributors where files end up. Hopefully this brief guide to adding files will help.
2016-04-24 16:18:23 -07:00
Minh Nguyễn
f85f4f4105 [ios] Streamlined resource bundling
Added a target that produces Mapbox.bundle.

Replaced $BUNDLE_RESOURCES and $PLACE_RESOURCE_BUNDLES_OUTSIDE_FRAMEWORK with a single variable, $SELF_CONTAINED, that determines whether the output static framework is self-contained – that is, whether it contains Mapbox.bundle, Settings.bundle, and LICENSE.md. Eliminated the ability to produce a static framework that has the same layout as a dynamic framework. Now, resources are always in Mapbox.bundle; self-containment only determines where that bundle resides.

Added a separate source Info.plist to be placed in both the static framework and its resource bundle, but only after we give the build system a chance to expand variables within it. Now nearly all the Info.plist keys are filled in by the build system rather than using plutil in package.sh.
2016-04-24 16:18:23 -07:00
Minh Nguyễn
95613bd7dd [ios, osx] Made OS X SDK localizable
Replaced the iOS-specific ilocalize make rule with a genstrings make rule that creates iOS, OS X, and shared strings files. Moved the override English .stringsdict file under darwin/resources/. Made the default OS X callout view XIB localizable. Made some hard-coded strings in the OS X SDK source localizable.
2016-04-24 16:18:23 -07:00
Minh Nguyễn
7a1d62dc30 [ios, osx] Corrected quarter wind abbreviations 2016-04-24 16:18:23 -07:00
Minh Nguyễn
7a23270532 [ios] Parentheses for build variables 2016-04-24 16:18:23 -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
e4752912da [ios, osx] Corrected clock, coordinate formats
Long unit style isn’t intended to be spelled out, so the clock and coordinate direction formatters now use numerals for long unit style, differing from medium unit style in less drastic ways. The locale no longer needs to be exposed, since it’ll always match the overall string’s locale. Added support to the coordinate formatter for different unit styles. Made minutes and seconds of arc optional.

Maintain strings for darwin/ formatter classes in a separate Foundation strings table that can be shared between the iOS and OS X SDKs. Added an English .stringsdict override that correctly pluralizes units.

Capitalize osxapp window titles, now that they spell out the directions.
2016-04-24 16:13:54 -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
Minh Nguyễn
fd93cf969d [ios] Fixed jazzy build step
Fixed some regressions introduced in 9c9ff2d2d4 for #4802. A backslash was missing from a shell script, causing arguments to get dropped and output to go in the repo root. Paths in the jazzy configuration file needed to be updated so jazzy could find the headers.
2016-04-24 11:37:01 -07:00
Minh Nguyễn
3e22369f27 [ios, osx] Eliminated platform/{ios,osx}/include
Also updated various project references to be group-relative, so Xcode chooses the right directory by default when adding a new file.

Fixes #4770.
2016-04-23 10:35:59 -07:00
Minh Nguyễn
668405e61f [ios] Updated changelog for core changes 2016-04-22 17:38:57 -07:00
Minh Nguyễn
df0d1187da [ios, osx] Fixed direction, pitch restoration
Followup to #4790. Fixed a regression preventing the direction and pitch from being persisted across sessions.
2016-04-22 17:09:25 -07:00
Minh Nguyễn
466ed55200 [core, ios, osx] cameraThatFitsCoordinateBounds
Added an API to get a camera that you can pass into -[MGLMapView setCamera:] that fits the given coordinate bounds, by analogy with -[MKMapView regionThatFits:] or -[MKMapView mapRectThatFits:edgePadding:].

Added mbgl::Map::getCameraOptions() for getting the current camera options more conveniently.
2016-04-22 16:39:25 -07:00
Minh Nguyễn
1039f21527 [ios, osx] Fixed dangling KVO observer crash
Fixed a crash when deallocating an MGLMapView that has point annotations. Now we explicitly remove all the annotations from the view and thus remove all remaining KVO observers on those annotations.

Fixes #4805.
2016-04-22 15:43:55 -07:00
Minh Nguyễn
9c9ff2d2d4 [ios, osx] Updated build system for jazzy
Consolidated NSValue categories to work around realm/jazzy#539. Documented MGLErrorCode. Moved jazzy configuration file into platform/ios/. Removed redundant include/Mapbox.h that was only being used by jazzy, now that the static frameworks’s umbrella header is based on that of the dynamic framework. Moved framework/Mapbox.h to include/Mapbox.h for consistency.
2016-04-22 12:31:42 -07:00
Minh Nguyễn
2a1a5f0885 [ios, osx] Split MGLDirectionFormatter in two
Split MGLDirectionFormatter into MGLClockDirectionFormatter, which specializes in clock positions, and MGLCompassDirectionFormatter, which boxes the compass. This neatly avoids any confusion that might arise if the developer fails to read the documentation and thinks the original unified formatter can convert between the two types of directions.
2016-04-22 11:29:10 -07:00
Minh Nguyễn
e5c6cfde4b [ios, osx] Direction formatter
Implemented an NSFormatter for formatting CLLocationDirection values as localizable display strings. The formatter supports both absolute compass directions, such as “south”, and relative “clock” directions, such as “6 o’clock”.
2016-04-22 11:13:03 -07:00
Minh Nguyễn
91023f02f8 [ios, osx] Coordinate formatter
Added a degree-minute-second coordinate formatter for general use. Use this formatter in iosapp and osxapp.

Added unit tests for the coordinate formatter and for round-tripping geometry types through NSValue.
2016-04-22 11:13:03 -07:00
Minh Nguyễn
a852ee24fb [ios, osx] Geometry value methods
Added category methods on NSValue for converting to and from the structure types defined in MGLGeometry.h.

Fixes #4485.
2016-04-22 11:13:02 -07:00
Minh Nguyễn
aded1b145d Merge branch 'release-ios-v3.2.1' 2016-04-21 21:14:45 -07:00
Minh Nguyễn
9f72d720d9 [ios] Updated changelog for map thread removal 2016-04-21 20:34:26 -07:00
Minh Nguyễn
e404eeae1b [ios] Fixed crash on missing access token
Fixed a race condition in which the access token alert controller would fail to present because the view controller hadn’t yet entered the view hierarchy, plus a downstream crash caused by the access token being missing.
2016-04-21 17:52:16 -07:00
Minh Nguyễn
3a22033b90 [ios, osx] Constrain zoom level when selecting offline pack
When selecting an offline pack for display in iosapp or osxapp, constrain the zoom level to the pack’s minimum and maximum zoom levels.

Fixes #4787.
2016-04-21 16:50:45 -07:00
Minh Nguyễn
0dbec51401 [ios, osx] Copyedited installation documentation
Copyedited installation documentation to make sense to less experienced Xcode users, ensure consistency, remove redundant language, and reflect recent build changes.
2016-04-21 14:43:49 -07:00
Jason Wray
c625dd0f7e [ios] Update changelog URLs in the bundled readmes
[skip ci]
2016-04-21 01:38:53 -04:00
Minh Nguyễn
93e9ffea88 [ios] Corrected link to CONTRIBUTING.md 2016-04-20 14:57:43 -07:00
Minh Nguyễn
4a67491a77 [ios] Relative link to CONTRIBUTING.md 2016-04-20 14:57:17 -07:00
Minh Nguyễn
78ddcd76ee [ios] Toggle telemetry on main queue
Cherry-picked from 3c4049c796.
2016-04-20 14:44:08 -07:00
Minh Nguyễn
302f69fded [ios] Assert that defaults change is on main thread
Cherry-picked from e7ddaa9285.
2016-04-20 14:43:57 -07:00
Minh Nguyễn
e5fa7093da [ios] Fixed hang observing user defaults on background queue
Fixed a deadlock that could occur if the host application attempts to set user defaults on a background queue. Now we observer user defaults changes synchronously.

Cherry-picked from d76ef6e53b.
2016-04-20 14:43:45 -07:00
Minh Nguyễn
2aaa8b9474 [ios, osx] Ignore invalid observation context
If a subclass of MGLMapView registers itself as an observer of a non-multipoint annotation’s coordinate key path but fails to handle the change in its -observeValueForKeyPath:ofObject:change:context: implementation, the context would likely be a value other than the annotation’s tag. In that case, avoid doing anything in response to the coordinate changing. Even if the context in that case happens to match the annotation’s tag – say, because the developer passed in NULL (which is equal to 0) for the first added annotation (which would have a tag of 0) – the result would be an unnecessary but harmless update.
2016-04-20 14:23:57 -07:00
Minh Nguyễn
72086edb6e [ios, osx] Avoid observing coordinate on MGLMultiPoint
There’s no point observing the coordinate key path on MGLMultiPoint, since that property is immutable. Use the observation context instead of performing an annotation tag lookup when a coordinate has changed.
2016-04-20 14:23:57 -07:00
Minh Nguyễn
268884368a [ios, osx] Fixed crash removing multipoint or duplicate annotation
Fixed a crash removing a polyline or polygon by observing the coordinate key path on all annotations, not just non-MGLMultiPoints.

Pass in the annotation tag as the observation context. This fixes a crash when an annotation is added to the map view more than once, then removed more than once.
2016-04-20 14:23:57 -07:00
Minh Nguyễn
de0705c7ed [ios, osx] Use HTML links in documentation
Replaced Markdown syntax with HTML syntax for hyperlinks in documentation comments. HTML links work both inside Xcode (whether Objective-C or Swift) and on the Web (via jazzy).

Fixes #3961.
2016-04-20 07:41:05 -07:00
Minh Nguyễn
6069647076 [ios, osx] Override user workspace settings 2016-04-19 16:28:30 -07:00
John Firebaugh
4bc4d35c60 [ios] Build output goes to build/ios 2016-04-19 16:28:30 -07:00
John Firebaugh
2d33ae5ed7 [ios, osx] Eliminate use of main.mk 2016-04-19 16:28:30 -07:00
John Firebaugh
24a9d47944 [ios, osx] Remove some non-functional platform.gyp xcode_settings
Refs #4738
2016-04-19 16:28:30 -07:00