Commit Graph

130 Commits

Author SHA1 Message Date
Minh Nguyễn
557b8afb7c [core][iOS] Source iOS styles from default_styles
Moved mbgl::util::default_styles to a more appropriate location, where iOS platform code can also find it. Moved -[MGLMapView bundledStyleURLs] (which is now deprecated) and the style switcher in iosapp to default_styles.

Added a collection of convenience methods for getting style URLs. It makes little sense to layer an enum atop this, as MapKit does, because MGLMapView styles aren’t limited to this set. A good analogy is UIColor. This also makes for a good entry point for future runtime styling APIs.

Introduced independent constants for each default style, because it’s more common to need access to a particular style than to iterate over them. This fact is apparent in the MGLStyle class, which now uses macros and assertions to ensure that it’s kept up-to-date with changes in default_styles.

/ref #1462
2015-10-30 13:09:37 -07:00
Minh Nguyễn
1e9cf71b5a IB inspectable for allowing tilt 2015-10-23 10:09:27 -07:00
Minh Nguyễn
4f509288b7 [iOS] Removed long-unavailable APIs 2015-10-22 14:27:58 -07:00
Minh Nguyễn
e3934df8d4 [iOS] Replaced styleID property with styleURL__ inspectable
The new styleURL__ inspectable property is carefully named to masquerade as a URL property in Interface Builder, even though IB supports no such thing.

If the user enters an invalid URL into the “Style URL” inspectable, throw an error instead of silently setting the style to the default. This check is not required in -setStyleURL:, which takes a real NSURL.
2015-10-22 14:27:39 -07:00
Justin R. Miller
24aa375cd1 [ios] tweaks to match code style for 1a5c452 callout tap handler 2015-10-12 11:02:04 -07:00
Maciej Swic
1a5c452fe3 Forwards the SMCalloutView tap delegate 2015-10-12 10:54:53 -07:00
Jason Wray
b406c942df [ios] update MGLMapView inline docs for v8 styles
Fixes #2503
2015-10-02 19:43:04 -04:00
Jason Wray
29da7bb26d [ios] describe radians↔degrees functions 2015-10-02 18:54:53 -04:00
Jason Wray
e565808de0 [ios] fix unintentional omission of delegate sections & methods from docs
Adds these delegate methods that were missing:
  - `mapView:annotation:calloutAccessoryControlTapped:`
  - `mapView:didSelectAnnotation:`
  - `mapView:didDeselectAnnotation:`

Adds these section headers that were missing:
  - Responding to Map Position Changes
  - Managing Annotations
  - Selecting Annotations

Also reorders the sections by priority and grouping.

Fixes #2514
2015-10-02 18:48:26 -04:00
Justin R. Miller
8cc3b12f1e [ios] fixes #2490: add annotation image enabled property 2015-10-02 11:50:53 -07:00
Justin R. Miller
7087a4c55a [ios] fixes #2491: document MGLAnnotationImage 2015-10-01 16:20:05 -07:00
Eric Horacek
50ad8ac54d Remove implicit conversion from double → float
Occurs when targeting a 32-bit architecture
2015-09-19 12:44:41 -07:00
Jason Wray
d9c7fdc565 [iOS] Fix MGLPolyline documentation typo 2015-09-11 16:34:10 -04:00
Jason Wray
c34d62aca2 [iOS] Move radians/degrees conversion functions to MGLGeometry.h 2015-09-11 11:36:32 -07:00
Minh Nguyễn
0a172a21fd CameraOptions
Plumbed camera options all the way through to MGLMapView. Added a method that lets you specify a direction in addition to center point and zoom level.

Added Map::jumpTo() for parity with mapbox-gl-js. Replaced usage of Map::setLatLng() and Map::setLatLngZoom() with Map::jumpTo() or Map::easeTo() within MGLMapView. Replaced MGLMapView.pitch with MGLMapCamera for setting all supported degrees of freedom simultaneously. Simultaneously move and rotate with course.

Support customizable timing functions on iOS.

iosapp now persists an archived MGLMapCamera instead of separate viewpoint properties and also synchronizes user defaults on termination. This change implements persistence entirely in Objective-C, eliminating the use of the Objective-C++ implementation.

Fixes #1643, fixes #1834. Ref #1581.
2015-09-07 09:22:52 -07:00
Justin R. Miller
163022f9a3 fix missing docs parameter 2015-09-04 09:16:26 -07:00
Justin R. Miller
790e8a345c refs #2039: add passthroughs for adding/removing overlays 2015-09-04 09:16:26 -07:00
Jason Wray
42dc5336db iOS perspective gesture support
Drag two fingers upward to tilt the map.

Implements #2116
2015-08-26 11:23:03 -07:00
Justin R. Miller
3f99f5e712 GL is the library, SDK is the product 2015-08-21 11:01:07 -07:00
Minh Nguyễn
dfeb479011 MGLUserTrackingModeFollowWithCourse
Added course-tracking. However, rotation has to happen atomically without animation until #1834 is fixed.

Fixes #1605.
2015-08-14 10:09:43 -07:00
Justin R. Miller
772238a229 fixes #2044: add -showAnnotations:animated: 2015-08-12 14:45:37 -07:00
Jason Wray
aa202f7e08 Add more mapView! 2015-07-31 16:18:43 -04:00
Jason Wray
57f0d6535c Document iOS region change delegate methods
With #1026 the region delegate methods work reliably and as expected. This commit adds `mapView:regionWillChangeAnimated:`, `mapViewRegionIsChanging:`, and `mapView:regionDidChangeAnimated:` to the official documentation.
2015-07-31 15:59:57 -04:00
Minh Nguyễn
8a971458a4 Removed documentation for unavailable method
So it doesn’t show up in the generated docset.
2015-07-08 13:49:07 -07:00
Justin R. Miller
e0384a98f7 explicitly bring in header 2015-07-08 19:46:04 +02:00
Justin R. Miller
445d3afa4f fix nullability 2015-07-08 19:46:04 +02:00
Justin R. Miller
e3b823b11b nullability for MGLAnnotationImage 2015-07-08 19:46:03 +02:00
Justin R. Miller
5ab58deb44 Cocoa custom marker imagery API 2015-07-08 19:46:03 +02:00
Justin R. Miller
76333dfc0c fixes #1770: rename & expose compass, logo, and attribution 2015-07-01 12:09:33 -04:00
John Firebaugh
6532438fe4 Rationalize *RenderingMap notifications 2015-06-30 10:13:24 -07:00
Minh Nguyễn
ac2ad993a5 Fit to coordinates
Whoever determined the boundaries of the District of Columbia did not have fit-to-bounds implementations in mind. With this change, shapes that are not unrotated rectangles fit much, much better.
2015-06-26 21:46:15 -07:00
Minh Nguyễn
29fd554c32 Implemented -setVisibleCoordinateBounds:
Followup to #1783: Implemented the non-animated version of fit to bounds and makes it a KVO-compliant property.
2015-06-25 22:26:35 -07:00
Minh Nguyễn
1d11624efd Test fit to bounds; added MGLCoordinateBounds functions
Added a bunch of functions to work with MGLCoordinateBounds in a separate header analogous to MKGeometry.h. Added resolution-independent tests for common fit to bounds scenarios.
2015-06-25 21:54:57 -07:00
Minh Nguyễn
68e404c522 Fit to bounds with padding
Each side of the bounding box is specified independently, allowing more flexibility than the offset + padding construct supported in mapbox/mapbox-gl-js’ Camera.
2015-06-25 21:54:57 -07:00
Minh Nguyễn
c57799f26c Reimplemented fit to bounds
The new implementation is now public and takes advantage of MGLCoordinateBounds. It is re-ported from `Camera.prototype.fitBounds()` in mapbox/mapbox-gl-js to ensure correct behavior. A new function, MGLCoordinateBoundsMake(), makes it easier to create an MGLCoordinateBounds for use with this method.
2015-06-25 21:54:53 -07:00
Justin R. Miller
0955dfc19f Merge branch 'release-v0.4.0' 2015-06-19 15:56:53 -07:00
Justin R. Miller
afb7095ecc refs #1759: remove header docs for now-unavailable API 2015-06-19 11:07:24 -07:00
Minh Nguyễn
91641ffb01 Lightweight generics
Added lightweight generics annotations to collection-typed method and protocol signatures to streamline usage of these members in Swift. Lightweight generic type specifiers are wrapped in conditionally-compiled macros for compatibility with Xcode 6.x.

Manually preprocess the NS_*_OF() macros in a temporary copy of each header before appledoc sees the headers. Also removed the --ignore flag because we no longer have a private headers folder under include/mbgl/ios/.
2015-06-17 15:33:00 -07:00
Minh Nguyễn
e3e73220c1 Audited shape annotation classes for nullability
Audited various classes to match MapKit. Also, `-[MGLAnnotation title]` is nullable because titles are optional for shape annotations.
2015-06-17 12:55:05 -07:00
Minh Nguyễn
f50a27bc8a Corrected bundledStyleURLs doc comment
Per f46328655e (commitcomment-11695358).
2015-06-17 12:54:48 -07:00
Minh Nguyễn
0686807a21 Audited shape annotation classes for nullability
Audited various classes to match MapKit. Also, `-[MGLAnnotation title]` is nullable because titles are optional for shape annotations.
2015-06-16 16:32:57 -07:00
Minh Nguyễn
df6ab1dc00 Corrected bundledStyleURLs doc comment
Per f46328655e (commitcomment-11695358).
2015-06-16 09:45:10 -07:00
Justin R. Miller
bd0bf294bf squash of #1655: shape annotations support for core & iOS 2015-06-15 18:30:39 -07:00
Minh Nguyễn
450a6beae0 Restored nullability compatibility shim
This reverts commit a425df0f95f5f0088444b8ebc67708756ff962aa for compatibility with Xcode 6.1.
2015-06-13 19:58:59 -07:00
Minh Nguyễn
f46328655e Audited headers for nullability
Added some nullability qualifiers in method implementation selectors for consistency with declarations.

The user dot view now has a non-zero size. Previously only its layer was sized properly. Also resolved some pedantic warnings about missing designated initializer overrides.

Xcode 6.3 or above is now required for building this project.
2015-06-11 11:37:23 -07:00
Minh Nguyễn
86dd0e99bc Defailablize init methods
If an OpenGL context couldn’t be created, there’s just no point to soldiering on. Things are going to fall apart pretty quickly anyways. Assert and be done with it.
2015-05-27 12:51:30 -07:00
Minh Nguyễn
0689ad693e Merge pull request #1561 from 1ec5-style-id-1500
mapID → styleID
2015-05-21 15:28:27 -07:00
Minh Nguyễn
c718d2ea66 Made accessToken uninspectable 2015-05-21 01:51:18 -07:00
Minh Nguyễn
256b748458 Merge branch '1ec5-plist-1535' 2015-05-20 14:38:36 -07:00
Minh Nguyễn
9a57464f82 Removed accessToken from MGLMapView public API
With helpful instructions for migrating to Info.plist or the `MGLAccountManager` API.
2015-05-20 10:45:26 -07:00