Commit Graph

826 Commits

Author SHA1 Message Date
Justin R. Miller
7e335cafdc tighten up compass alpha adjustments & remove dupe 2015-04-23 16:19:45 -07:00
Brad Leege
7e145780eb #1225 - Initial conversion of Mapbox GL app to set access token in AppDelegate and exposing MGLMapView.initWithFrame to support it 2015-04-23 18:15:01 -05:00
Minh Nguyễn
fec1cf0e23 RTL-friendly constraints
Use leading/trailing instead of left/right for subview constraints for eventual right-to-left flippedness.
2015-04-23 15:02:06 -07:00
Brad Leege
19b5ef367e Merge branch 'master' of github.com:mapbox/mapbox-gl-native into 1225-start-token 2015-04-23 16:14:50 -05:00
Minh Nguyễn
9b8b072d28 Cleaned up subview layout
No need to set the frames manually since we set up constraints as soon as the `MGLMapView` is added to the view hierarchy. Set proper edge insets on the logo bug rather than fudging constraint constants.
2015-04-22 15:33:56 -07:00
Brad Leege
578d48b303 #1225 - Initial setup of MapboxGL as a singleton object with access token 2015-04-22 17:19:59 -05:00
Minh Nguyễn
61d4fcc2ba Merge branch 'master' into 1ec5-strong-self 2015-04-22 13:11:26 -07:00
Minh Nguyễn
8ab22c11a2 Clip MGLMapView to its bounds
Fixes #1300.
2015-04-22 12:48:15 -07:00
Minh Nguyễn
e1cf6d1515 Refactored constraints
The existing Visual Format Language usage necessitated various ternaries and over-wide lines that made the code harder to grok. Now it’s just plain ol’ Objective-C, mostly column-80-compliant. This change also adds additional constraint relations so that the various subviews respect the `MGLView`’s frame when it’s smaller than the view controller’s root view.

Fixes #1327.
2015-04-22 12:45:09 -07:00
Minh Nguyễn
1008787745 Merge pull request #1322 from mapbox/1ec5-orientation-1313
Constrain user dot to superview margins
2015-04-22 09:10:34 -07:00
Minh Nguyễn
87409b1234 Constrain user dot to superview margins
When the screen changes orientation, the user dot should always appear at the correct location.

Fixed #1313.
2015-04-21 15:58:55 -07:00
Brad Leege
d4264edea3 #1166 - Cleaning up logs and old NSURLConnection code 2015-04-21 17:19:37 -05:00
Brad Leege
1a43b773af #1166 - Initial conversion from NSURLConnection to NSURLSession 2015-04-21 17:13:23 -05:00
Brad Leege
d4add0bfdb #1306 - Removing kSecTrustResultConfirm as it's deprecated 2015-04-21 11:15:31 -05:00
Brad Leege
a951229591 #1306 - Moving local geoTrustCert to one time setup and cache in immutable NSData object 2015-04-21 11:09:22 -05:00
Brad Leege
736bdca81e #1306 - Renaming certificate to include geotrust name for easier tracking 2015-04-20 19:59:28 -05:00
Brad Leege
6f9bcd86af #1306 - Moving api_mapbox_com.der to iOS Resources directory so that it can be accessed via GL Framework 2015-04-20 19:47:24 -05:00
Brad Leege
96a6371fa0 #1306 - Explicitly scheduling NSURLConnections in mainRunLoop so that delegates and connections stay connected. 2015-04-20 18:56:42 -05:00
Brad Leege
fbd610695a #1306 - Trying strongSelf / weakSelf pattern for delegate 2015-04-20 14:55:39 -05:00
Brad Leege
a2883dddc0 #1306 - Adding api_mapbox_com.der (public key) and nsurlconnection checking infrastructure 2015-04-20 14:28:32 -05:00
Minh Nguyễn
0aadbedecb Lower threshold for rotation drift
It’s pretty darn hard to get up to 5 rad/s with the same two fingers.
2015-04-20 11:15:29 -07:00
Minh Nguyễn
2ec09a663f Use strongSelf inside blocks
It’d be pointless to create a `strongSelf` but not use it; `weakSelf` isn’t guaranteed to exist past that point.
2015-04-20 09:58:05 -07:00
Brad Leege
e7518d56c5 #1303 - Enabling Battery Monitoring for app. Formatting battery level to int instead of float. 2015-04-20 10:59:09 -05:00
Minh Nguyễn
0bb2e05063 weakSelf needs strongSelf
The `weakSelf` dance requires the use of a `strongSelf` in non-trivial blocks. In these cases, `weakSelf` could disappear right out from under the block. A crash could potentially occur due to setting a `nil` value in an `NSMutableDictionary`.
2015-04-18 23:28:51 -07:00
Minh Nguyễn
261b6161f2 Cancel animations on touch down
Cancel any map animations as soon as a finger is set upon the screen.

Fixes #1258.
2015-04-18 23:01:42 -07:00
Minh Nguyễn
fae0c4c8b3 Simplified math for drift-rotation
fmodf() would conflict with the fix for #1199.
2015-04-18 22:02:15 -07:00
Minh Nguyễn
33aeecef22 Added drift-rotation effect after rotation gesture 2015-04-18 20:50:35 -07:00
Minh Nguyễn
41d28e7203 Added drift-zooming effect after pinch gesture
Apply a subtle animated zoom after a pinch gesture completes. Lots of magic numbers involved. Avoid drifting when the pinch is near-static, and when the scale factor would go below the minimum. There is more resistance to pinching outward than pinching inward, because it’s far easier to lose your place when you accidentally zoom out. Disabled two-finger pan, which is typically reserved for changing pitch; otherwise, it’s easy to accidentally pan while intending to pinch.
2015-04-18 19:47:52 -07:00
Minh Nguyễn
4c6987b20e Apply some friction to pan drift
When the panning velocity is low enough, ignore the pan gesture to simulate friction on the device’s glass screen.
2015-04-18 19:40:26 -07:00
Minh Nguyễn
2bc63f76a4 Made pan gestures slipperier
Replaced the complex formula for overpanning with a simple one that makes the map feel much slipperier than before. `MGLMapView` now overpans just a little more aggressively than `MKMapView` but still a lot less aggressively than Google Maps.

Fixes #1266.
2015-04-17 12:31:49 -07:00
Konstantin Käfer
46bf226910 align static render mode and still image render mode
- static rendering now also runs in a separate thread; you have to start it with map.start(Map::Mode::Static) and join the thread with map.stop() before destructing the Map object
- map.renderStill() takes a callback with will be invoked on the *map* thread, so you'll have to figure out your own method of dispatching back to the main thread.
2015-04-17 13:40:42 +02:00
Justin R. Miller
b6e2052962 refs #1285: don't use special getters for dot syntax 2015-04-16 15:16:11 -07:00
Justin R. Miller
a28bd361d8 fixes #1276: maintain snapshot in hierarchy & hide when appropriate 2015-04-16 14:04:37 -07:00
John Firebaugh
7000a4faf0 Merge pull request #1250 from mapbox/1250-separate-thread-object
Separate objects from Thread management
2015-04-16 08:50:24 -07:00
Justin R. Miller
190709c6b1 fixes #1157, #1255: cache parsed tiles in memory 2015-04-16 01:15:41 -07:00
John Firebaugh
5fa0512be2 Shorten method names 2015-04-15 20:38:25 -07:00
John Firebaugh
1eaf6b8c18 Stricter Thread<> interface
Implements a Thread<>::invoke interface that only permits calling
member functions with bound arguments.

Also introduce invokeWithResult, which accepts a callback and invokes
it, passing the result, on the invoking thread's RunLoop. This closes
the loop of two evented threads doing message passing.
2015-04-15 20:38:25 -07:00
Minh Nguyễn
ed74c6e23d Merge pull request #1254 from mapbox/1050-bg
Detach GLKView while app is in background
2015-04-15 13:22:04 -07:00
Minh Nguyễn
ec987ca434 Assert that snapshot view obscures GL view when it exists
Just in case the host app mucks around with `MGLView`’s internal view hierarchy.
2015-04-15 10:18:15 -07:00
Brad Leege
074687e732 #1271 - Changing "new" to "alloc init" 2015-04-15 09:39:00 -05:00
Minh Nguyễn
e19b6afb26 Leave GLKView in place, obscured by snapshot
Generate the snapshot using `-[UIView snapshotViewAfterScreenUpdates:]` and place it _over_ the `GLKView`. UIKit appears to be able to detect that the `GLKView` is completely obscured and avoids `-_display`ing it.
2015-04-14 22:23:13 -07:00
Brad Leege
21685caa2a #1268 - Adding horizontalAccuracy to location event 2015-04-14 18:03:59 -05:00
Konstantin Käfer
1066504008 separate SQLiteCache::Impl header from implementation file 2015-04-13 18:38:39 +02:00
Konstantin Käfer
352ff64e06 rename SQLiteCache::Thread to SQLiteCache::Impl 2015-04-13 18:32:59 +02:00
Konstantin Käfer
452d12e6e6 make implementation files private headers 2015-04-13 18:28:18 +02:00
Konstantin Käfer
16849a341b hide Thread<> and separate the Implementation object 2015-04-13 17:57:45 +02:00
Justin R. Miller
32e5196373 change default style to Streets 2015-04-10 16:38:49 -07:00
Minh Nguyễn
c5b0478e9a Detach GLKView while app is in background
Throw a static snapshot up for the app switcher. Hope you didn’t plan on moving markers around while the app is in the background.

Fixes #1050, #1186, #1203, #1243.
2015-04-10 14:29:18 -07:00
Brad Leege
22a35c23be #1252 - Merging 2 "created" attribute value setting attempts into 1 2015-04-10 15:53:07 -05:00
Konstantin Käfer
4c7132337f convert DefaultFileSource to use util::Thread<> 2015-04-10 22:37:27 +02:00