Commit Graph

371 Commits

Author SHA1 Message Date
Justin R. Miller
00f9a477b7 abbreviate syntax for unused parameters 2015-07-08 22:58:50 -07:00
Minh Nguyễn
1a3ae88786 Defer initialization until app enters foreground
Defer the creation of EAGLEContext and GLKView and the loading of OpenGL ES extensions. It is GLKView that drives the background crash, and Apple documentation specifically warns not to initialize an EAGLContext in the background. All the while, it should be safe for client code to avail itself of any public methods on MGLMapView.

Fixes #1460.
2015-07-08 14:53:11 -07:00
Minh Nguyễn
b3ea068e5d Assert if -mapView:symbolNameForAnnotation: is implemented
Fixes #1851.
2015-07-08 13:49:02 -07:00
Justin R. Miller
ed04e6d9f7 refs #1125, 1813: update user dot tracking in one place
Now that we have cleanup around the map viewport change notifications,
this only needs to happen in one place: the GL frame draw loop.
2015-07-08 12:21:40 -07:00
Justin R. Miller
fb230dda51 clean up remainder of sprite removal for now 2015-07-08 19:46:04 +02:00
Justin R. Miller
c7011345c9 remove logging 2015-07-08 19:46:04 +02:00
Justin R. Miller
e0da13dbfd fixes for runtime Cocoa imagery 2015-07-08 19:46:04 +02:00
Justin R. Miller
5f9e675ee0 stub annotation symbol cleanup 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
Konstantin Käfer
675ddddee7 Make pixelRatio constant across a Map object lifetime
also moves framebuffer size out of TransformState into its own object
2015-07-08 10:40:05 +02:00
Minh Nguyễn
a22efd4e80 Fixed compass overspinning
Rely on mbgl to drive compass rotation for simplicity. Eliminated fall-through from mbgl::MapChangeRegionIsChanging to mbgl::MapChangeRegionDidChange, because is-changing should not cause did-change to be fired.
2015-07-06 13:08:50 -07:00
Minh Nguyễn
78126f3b6b Refactored -[MGLMapView direction]
Fixed a bug in which -[MGLMapView direction] could return 360 instead of 0. Switched to mbgl::util::wrap() for clarity. -updateCompass now relies on -direction to avoid code duplication.
2015-07-06 13:07:34 -07:00
Minh Nguyễn
ec93fba84a Fixed crash on launch on iOS 7
In #1793, I conflated the compass container’s constraints to its parent view with the compass container’s content size constraints, but only in the iOS 7 code path. The result was a crash on launch due to an unprepared view hierarchy.

Fixes #1818.
2015-07-05 01:35:04 -07:00
Jason Wray
dba1e44f55 Add collision box debugging to the global debug toggle 2015-07-02 10:10:32 -07:00
Justin R. Miller
424629d7fc Merge pull request #1815 from mapbox/expose-ios-subviews
fixes #1770: rename & expose compass, logo, and attribution
2015-07-01 12:30:23 -04:00
Justin R. Miller
76333dfc0c fixes #1770: rename & expose compass, logo, and attribution 2015-07-01 12:09:33 -04:00
Jason Wray
81d88755df Remove tracking mode reset from resetNorthAnimated 2015-07-01 11:16:43 -04:00
Minh Nguyễn
b6a0450ef6 Go dormant before termination
Speculative fix for #1460 per https://github.com/mapbox/mapbox-gl-native/issues/1460#issuecomment-99959434.
2015-06-30 15:35:04 -07:00
John Firebaugh
6532438fe4 Rationalize *RenderingMap notifications 2015-06-30 10:13:24 -07:00
John Firebaugh
8c4a03acb4 Eliminate unnecessary NSNumber* wrapping 2015-06-30 10:13:23 -07:00
John Firebaugh
42c06e7039 Use array of structs rather than parallel arrays for annotations 2015-06-29 10:54:17 -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
5ea41a5583 Avoid removing content size constraints
Also, on iOS 8.0+, use `+[NSLayoutConstraint activateConstraints:]` and `+deactivateConstraints:` to efficiently prevent redundant constraints from lingering.

Fixes #1779.
2015-06-26 14:54:53 -07:00
John Firebaugh
ea5c56d2bf Don't send MapChangeRegionIsChanging on every render 2015-06-26 10:32:08 -07:00
John Firebaugh
d193083513 Remove duration argument from View::notifyMapChange
Fixes #1026
2015-06-26 10:32:07 -07:00
Konstantin Käfer
84e2ea886d drive map rendering from main thread 2015-06-26 10:32:06 -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
Jason Wray
f5c1e2630e Remove redundant didChangeAuthorizationStatus: in favor of didFailWithError:
Listening to both `locationManager:didChangeAuthorizationStatus:` and `locationManager:didFailWithError:` delegate methods is unnecessary. Setting `showsUserLocation = NO` in the first means that the second never gets called and our `mapView:didFailToLocateUserWithError:` delegate method never gets called.
2015-06-25 16:02:55 -07:00
Brent Whitman
64c05d02e2 Fix typo which caused MGLMultiPoint to return longitude as latitude of bounds. 2015-06-25 15:00:21 -07:00
Minh Nguyễn
fc209e31c5 Reversed direction to be clockwise
For consistency with MapKit, the Google Maps SDK, and these methods’ own documentation.

Fixes #1780.
2015-06-25 10:20:48 -07:00
Minh Nguyễn
0e3270cb15 Replaced user-facing assertions with exceptions
Errors caused by client code should be communicated through NSExceptions. NSAsserts are intended for internal usage; because they include helpful information like the absolute path to the file containing the assertion, stripping the build (#1650) also strips assertion messages. Also replaced hardcoded references to methods in these messages with __PRETTY_FUNCTION__, which avoids future copy-pasta and handles cases in which the MGL class has been subclassed.
2015-06-18 10:59:12 -07:00
Minh Nguyễn
bf6a100801 Avoid null-change KVO notifications
If no access token is set in the Info.plist, avoid triggering a KVO notification about the access token changing. By the same token (heh), avoid pulling a C string out of the change dictionary if the access token is being nilled out.
2015-06-17 16:49:12 -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
416928f824 Defer to MGLMultiPoint for overlayBounds implementation
Fixes #1730.
2015-06-16 11:06:46 -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
714b68f7b3 Revert "use array of structs rather than parallel arrays for annotations"
This reverts commit 2435c1ad26 (#1710), which needs to be revisited in light of #1655, which is a much higher priority at the moment.
2015-06-15 15:58:22 -07:00
Minh Nguyễn
4176d21d1c Namespaced reachability notification constant
Fixes #1717.
2015-06-12 11:54:46 -07:00
Konstantin Käfer
2435c1ad26 use array of structs rather than parallel arrays for annotations 2015-06-11 17:26:37 -04: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
Brad Leege
70acae7941 #1659 - Converting true to YES, false to NO to match Objective C standards 2015-06-01 15:06:32 -05:00
Brad Leege
ebe1e2158c #1659 - Converting usingTestServer to atomic property 2015-06-01 15:05:01 -05:00
Brad Leege
d44450ac7b #1659 - Adding tile stream certificate and ssl pin check for test server. 2015-05-28 15:51:50 -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
a2986b2019 Return nil upon failure to initialize 2015-05-27 12:36:52 -07:00
Brad Leege
d0864d719b #1641 - Changing version to a static constant instead of a property 2015-05-26 14:24:02 -07:00
Brad Leege
ad0a2af6b5 #1641 - Adding version and instance to Turnstile event and keeping them DRY for general events processing 2015-05-26 13:50:01 -07:00
John Firebaugh
87b1da7611 DefaultFileSource has responsibility for handling mapbox:// URLs 2015-05-26 12:14:10 +02:00