Commit Graph

388 Commits

Author SHA1 Message Date
Minh Nguyễn
807d87f0f5 Ignore redundant initial reachability notification on iOS 9
Fixes #1911.
2015-07-28 21:21:31 -07:00
Minh Nguyễn
3a310c916b Update the user dot when the user moves
Rolled back part of ed04e6d9f7 for #1852.

Fixes #1933.
2015-07-27 14:23:59 -07:00
Bruno de Oliveira Abinader
5e2f3b1323 Avoid nudging transitions if a gesture is in progress #2
Following the same steps from #1548 and #1912 for GLFW and iOS ports.
Also removed a redundant check if transform state is changing since
we're already dealing with that.
2015-07-27 21:57:51 +03:00
Minh Nguyễn
32c7805740 Ignore invalid location updates
Avoid passing invalid locations along to the map view delegate or user location annotation.

Also, If the user wants to visit the Prime Meridian or Equator, that’s their prerogative. Mapbox GL should show them where they’re at. Null Island is a different story.

Fixes #1912.
2015-07-24 15:53:10 -07:00
Bruno de Oliveira Abinader
784eb35512 Revert "Revert "split renderSync and transition nudging to allow client view syncing""
This reverts commit 263f9fad30.
2015-07-20 21:59:13 +03:00
Justin R. Miller
fad241f8cf Merge pull request #1831 from mapbox/set-collision-debug-too
Set collision debug with -[MGLMapView setDebugActive:], too
2015-07-20 11:21:17 -07:00
Bruno de Oliveira Abinader
263f9fad30 Revert "split renderSync and transition nudging to allow client view syncing"
This reverts commit b8388168dd.

It seems 'nudgeTransitions()' is no longer necessary as #1548 has fixed the update issues.
2015-07-20 17:07:55 +03:00
Minh Nguyễn
1f78d28516 Merge branch 'release-v0.5.0' 2015-07-14 10:49:52 -07:00
Minh Nguyễn
f96fef8292 Create GLKView before binding it and resuming
Or: don’t resume the map until the application has entered the foreground.

UIApplicationWillEnterForegroundNotification is posted before UIApplicationDidBecomeActiveNotification, while the application is still in the background. That caused -createGLView to bail but did not cause the rest of -wakeGL: to bail. We would create the GLKView only after attempting to bind it (a no-op), resulting in a black view.

Fixes #1855.
2015-07-11 15:38:59 -07:00
Minh Nguyễn
06fd6d5c1e Cherry-picked part of 987d961e5b to fix the build 2015-07-10 11:42:46 -07:00
Justin R. Miller
2df80af3d3 Revert "Defer initialization until app enters foreground"
This reverts commit 0fd9fe78db.
2015-07-09 13:41:42 -07:00
Justin R. Miller
00f9a477b7 abbreviate syntax for unused parameters 2015-07-08 22:58:50 -07:00
Minh Nguyễn
0fd9fe78db 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 15:40:15 -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
49fe6df0db Assert if -mapView:symbolNameForAnnotation: is implemented
Fixes #1851.
2015-07-08 14:39:27 -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
a67e80219f 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:55:39 -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
b8388168dd split renderSync and transition nudging to allow client view syncing 2015-07-08 12:10:12 -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
2bb1812ae4 Add collision check to isDebugActive 2015-07-02 22:41:26 -04:00
Jason Wray
505d1cdbf7 Set collision debug with setDebugActive:
Forgot this when collision was added to toggleDebug. isDebugActive still relies soley on plain getDebug().
2015-07-02 22:25:30 -04: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