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

Geometry formatters and value methods #4802

Merged
merged 5 commits into from
Apr 22, 2016
Merged

Geometry formatters and value methods #4802

merged 5 commits into from
Apr 22, 2016

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Apr 22, 2016

Implemented a degree-minute-second coordinate formatter for general use. This formatter replaces redundant implementations in iosapp and osxapp. Implemented NSFormatters for formatting CLLocationDirection values as localizable display strings: one for compass directions, such as “south”, and one for relative clock positions, such as “6 o’clock”.

These formatters are a cleaner implementation of the format strings implemented in #1496 for VoiceOver support. They may also be useful for navigation use cases.

Added category methods on NSValue for converting to and from the structure types defined in MGLGeometry.h.

Fixes #4485.

/cc @friedbunny @boundsj

@1ec5 1ec5 self-assigned this Apr 22, 2016
@1ec5 1ec5 added feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS navigation For the Mapbox Navigation SDK for Android or iOS or navigation use cases in general labels Apr 22, 2016
@1ec5 1ec5 added this to the ios-v3.3.0 milestone Apr 22, 2016
@1ec5 1ec5 mentioned this pull request Apr 22, 2016
8 tasks
@friedbunny
Copy link
Contributor

👍

Added category methods on NSValue for converting to and from the structure types defined in MGLGeometry.h.

Fixes #4485.
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.
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”.
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.
@1ec5
Copy link
Contributor Author

1ec5 commented Apr 22, 2016

The new NSValue (MGLGeometryAdditions) category exposed realm/jazzy#539: it isn’t possible to separately document two categories of the same external class (in this case NSValue). The workaround is to unify those categories in a dedicated header. Unfortunately, that’ll prevent us from putting the category methods close to related classes under the custom_categories we’ve defined for jazzy. We’ll also have to be careful about categorizing the same class in darwin/ and in ios/ or /osx/.

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.
@1ec5 1ec5 merged commit 9c9ff2d into master Apr 22, 2016
@1ec5 1ec5 deleted the 1ec5-formatters-4485 branch April 22, 2016 19:45
@1ec5 1ec5 mentioned this pull request Apr 23, 2016
14 tasks
1ec5 added a commit that referenced this pull request Apr 24, 2016
Fixed some regressions introduced in 9c9ff2d 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.
@zugaldia
Copy link
Member

/sub

@1ec5
Copy link
Contributor Author

1ec5 commented Apr 25, 2016

#4783 and #4819 rework the coordinate and clock direction formatters to be more flexible and localizable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS navigation For the Mapbox Navigation SDK for Android or iOS or navigation use cases in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants