Commit Graph

93 Commits

Author SHA1 Message Date
Justin R. Miller
190709c6b1 fixes #1157, #1255: cache parsed tiles in memory 2015-04-16 01:15:41 -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
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
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
Minh Nguyễn
760c0f0f19 Merge pull request #1214 from mapbox/1ec5-classes
Expose style class API publicly
2015-04-06 14:36:10 -07:00
Minh Nguyễn
af09fd599a Expose style class API publicly
Also added some convenience methods to match the underlying C++ API.
2015-04-06 12:26:26 -07:00
Minh Nguyễn
a406f9121f Accept nil access token 2015-04-06 11:28:30 -07:00
Minh Nguyễn
d1fb43e371 Inspectable toggles
Added inspectables for toggling zooming, panning, rotating, and showing the user location for parity with `MKMapView`.
2015-04-03 12:41:38 -07:00
Justin R. Miller
6eb79338f3 allow setting nil mapID for default style 2015-04-03 12:41:37 -07:00
Justin R. Miller
2916ae2735 formatting & docs changes
Ran this through `./ios/docs/install_docs.sh` to double-check things.

 * Less-specific initializers above more-specific per Apple convention.
 * Shores up `accessToken` docs as property, not a method.
 * Edited comments for consistency and/or to keep them out of the docs.
2015-04-03 12:40:51 -07:00
Minh Nguyễn
836de8bc1c Made lat/lon/zoom inspectable
Declared these IB-specific inspectables in a separate category that developers are not expected to import. Currently these inspectables are order-dependent due to #1181.

Ref #929
2015-04-03 12:34:36 -07:00
Minh Nguyễn
da13225a81 Made MGLMapView designable in IB
When an access token is set in the Attributes inspector (or as a user-defined runtime attribute), we draw some lovely Mapbox branding so the view shows up. (Manipulating invisible rectangles is a frustrating exercise, I’m told.) In the absence of an access token, the view displays a helpful message with directions for obtaining and setting the access token.

Along the way, completely opt out of `MGLMapboxEvents` when targeting Interface Builder, because touching Core Location throws an exception in that environment and it doesn’t make sense to record any metrics when designing on the Interface Builder canvas. Also, don’t start `mbgl::Map` at all (and don’t update it) because none of the runtime drawing code should ever be run in the designable. Normally these chunks of code would be excluded in IB using the TARGET_INTERFACE_BUILDER preprocessor macro. However, Mapbox GL is being packaged as a static library, so the macro is only evaluated when the library is prebuilt, even if the library eventually makes its way into the CocoaPods-generated framework. Instead, we detect that we’re being run by the IBDesignablesAgentCocoaTouch process.

Overrode `-[MGLMapView initWithFrame:]` to call `-commonInit`. We’ve marked this initializer unavailable in the header, but IB still calls it regardless.

Fixes #929.
2015-04-03 12:16:00 -07:00
Minh Nguyễn
e18e4b0de5 Removed redundant initializers and setters
This change removes most of the ways you used to be able to apply a style to the map. Building on #1163, `styleURL` (HTTP(S), mapbox:, asset:) is the canonical way to apply a style, and `mapID` is a convenient shorthand for Mapbox-hosted styles. A relative style URL is interpreted as a path relative to the app’s main bundle. We now construct asset: URLs in lieu of “bundled style names”.
2015-04-03 12:14:51 -07:00
Minh Nguyễn
6a1e7d5707 Fixed race condition after setting access token
`Map` should be able to deal with having no access token or JSON even while it’s running. Most of `Map` accounts for this situation, but `reloadStyle()` incorrectly assumes that one or the other is set. This change corrects the assumption in `reloadStyle()`.

Also expose the access token and style name to clients as ordinary KVO-compliant properties. Actually, they’re not so ordinary because they’re inspectable!

Ref #1070, #1147
2015-04-03 12:07:53 -07:00
Justin R. Miller
c253232473 account for GL-level min zoom 2015-04-03 09:06:20 -07:00
Justin R. Miller
0a736c3a76 fixes #1181: fix lat/lng & zoom ordering problems 2015-04-02 19:56:47 -07:00
John Firebaugh
12c07b916b Rework easing transition code
This brings the easing transition code a bit closer to how easings work
in gl-js. Instead of having an array of individual transitions for scale,
rotate, and pan, there is a single transition function that does all the
required calculations. This permits us to:

* Eliminate the "timeout" transition. (Fixes #126)
* Replace start/stopPanning() et al with setGestureInProgress(). Apps or
  SDKs are expected to make paired calls to setGestureInProgress(). This
  state will be ORed with the active easing state to determine when to
  use texture interpolation. (Fixes #79)
* Run style recalculations only when an ease transition that affects the
  zoom is in progress. (Fixes #1155)
2015-04-02 16:12:29 -07:00
Justin R. Miller
33f14328c4 move to actual NSURL type 2015-03-30 22:30:06 -07:00
Justin R. Miller
2782a8ce5b refs #892: Cocoa support for map ID style URLs 2015-03-30 22:09:47 -07:00
Justin R. Miller
a8833c34d4 fixes #892: support mapbox:// style URLs 2015-03-30 15:33:02 -07:00
Minh Nguyễn
3ed1e7a695 Merge pull request #1149 from mapbox/1ec5-subview
Child GLKView should be bottommost child
2015-03-30 10:52:15 -07:00
Justin R. Miller
ac3ba85120 refs #1125: user dot improvements
* more quickly unhide dot when nearing viewport
* improvements to maintaining user tracking mode during tap zooms
* removed a redundant layer hide
* better at ignoring bad location data
* be sure to use existing coordinate utilities
2015-03-27 19:45:58 -07:00
Brad Leege
a325cb98b5 #1134 - Removing enabled.email metric and supporting infrastructure 2015-03-27 19:25:59 -05:00
Minh Nguyễn
653724e68d Child GLKView should be bottommost child
Otherwise, any subviews added to an MGLMapView in a XIB or storyboard are completely obscured by the GLKView.
2015-03-27 16:34:11 -07:00
Justin R. Miller
215a7c4b2b only recognize the end state of single taps 2015-03-27 11:12:50 -07:00
Justin R. Miller
2822dd5b62 track metrics for gestures once upon begin 2015-03-27 11:06:04 -07:00
Justin R. Miller
2066e201ea Merge remote-tracking branch 'origin/master' into 1128-convert-booleans 2015-03-27 09:00:07 -07:00
Justin R. Miller
1a8d6445d1 convert metrics BOOLs to strings internally 2015-03-27 00:17:42 -07:00
Justin R. Miller
bf3c87b17f more metrics magic strings removals 2015-03-26 23:31:08 -07:00
Justin R. Miller
83f083c7b5 fixes #1116: metrics stability & performance refactor 2015-03-26 21:27:56 -07:00
Minh Nguyễn
32aa865f14 Merge branch 'ios-unused'
Left in MGLTypes.h, which is now a platform-neutral (iOS + OS X) place for MGLUserTrackingMode.
2015-03-26 15:12:15 -07:00
Justin R. Miller
c5eaa325ca Merge pull request #1112 from mapbox/1109-ui-blocking
avoid bogging down UI thread with metrics
2015-03-25 21:45:28 -07:00
Brad Leege
dc838a9fc6 #1109 - Changing priority queue for map.load event. Fixing pushEvent call misplacement. 2015-03-25 20:42:50 -05:00
Brad Leege
4408f4260b #1109 - Wrapping gesture event logic in background queue 2015-03-25 20:35:51 -05:00
Justin R. Miller
4cff2bad85 deselect user dot during location moves (for now) 2015-03-25 18:16:39 -07:00
Justin R. Miller
f3058dbc9a closes #1082, refs #756: user dot on map in iOS 2015-03-25 17:48:22 -07:00
Minh Nguyễn
c7b8cb1477 Assume UTF-8–encoded symbol name
Followup to 00245a92be (#1107).
2015-03-25 15:44:37 -07:00
Minh Nguyễn
00245a92be Merge branch '1068-encoding' 2015-03-25 15:40:40 -07:00
Justin R. Miller
10a30daed6 refs #894, fixes #1074: callout views for iOS 2015-03-24 18:43:24 -07:00
Brad Leege
88398b2545 Merge branch 'master' of github.com:mapbox/mapbox-gl-native into 1033-metrics
Conflicts:
	platform/ios/MGLMapView.mm
2015-03-24 15:15:27 -05:00
Brad Leege
3e062d0e20 #1033 - Flush all events to server when app enters background 2015-03-24 10:02:13 -05:00
Justin R. Miller
b184a54434 don't stop/start map in related to style changes anymore since safe 2015-03-23 21:56:39 -07:00
Justin R. Miller
c5597ad6f1 annotations perf improvements & iOS app testing
squash of #1061
2015-03-23 20:49:02 -07:00
Brad Leege
99049dc6b5 #1033 - Moving map.load to background thread. Moving enabled.push to map.load event. Adding enabled.email check. 2015-03-23 19:32:34 -05:00
Brad Leege
91cae4f44d #1033 - Renaming LongPress to QuickZoom for gesture event 2015-03-23 17:36:36 -05:00
Brad Leege
26a3ef3c71 #1033 - Adding Push Enabled attribute 2015-03-23 17:31:30 -05:00
Brad Leege
9b6ea52722 #1033 - Adding map.dragend event 2015-03-23 17:13:47 -05:00
Brad Leege
a4332736f7 #1033 - Adding Gesture tracking for all 7 supported gestures. DRYing out code. 2015-03-23 16:42:01 -05:00