Commit Graph

1007 Commits

Author SHA1 Message Date
Minh Nguyễn
67fdfbadb3 Merge pull request #1357 from mapbox/1ec5-view-controller
Automatically find view controller for layout guides
2015-04-27 22:28:06 -07:00
Minh Nguyễn
5ffa52cab5 Automatically find view controller for layout guides
Find the managing view controller by traversing the responder chain.
2015-04-27 15:52:30 -07:00
Brad Leege
16bcdb10b8 #1352 - Adding visit event with data attributes 2015-04-27 18:00:31 -04:00
Brad Leege
5092d72599 #1352 - Adding start / stop visit monitoring infrastructure and integrating it with pause / resume metrics api 2015-04-27 17:37:39 -04:00
Brad Leege
e4ebee4a8a Merge pull request #1347 from mapbox/1345-ua-build-number
Build Number To User Agent
2015-04-27 13:27:45 -04:00
Brad Leege
50fecb916d #1345 - Adding app build number to user agent. Updating gl test app build number to be different from build version. 2015-04-27 11:43:23 -04:00
Ansis Brammanis
af1537ca79 port LineBucket::addLine from -js 2015-04-27 11:44:49 +02:00
Brad Leege
1a43b773af #1166 - Initial conversion from NSURLConnection to NSURLSession 2015-04-21 17:13:23 -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
Konstantin Käfer
2831073f85 Merge pull request #1295 from mapbox/1199-whee
Ensure correct spin direction
2015-04-20 12:01:46 +02:00
Minh Nguyễn
8b44cfeb76 Ensure correct spin direction
Ported mapbox/mapbox-gl-js#821 as well as `util.wrap()` from mapbox-gl-js.

Fixes #1199.
2015-04-18 22:14:39 -07:00
Konstantin Käfer
71d127220b rename Mode::Static => Mode::Still 2015-04-17 17:55:24 +02:00
Konstantin Käfer
9072df709d make the request header public as the node module requires it 2015-04-17 15:23:36 +02: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
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
Mike Morris
5972a7d16e make environment.hpp header public 2015-04-15 17:14:36 +02:00
Brad Leege
21685caa2a #1268 - Adding horizontalAccuracy to location event 2015-04-14 18:03:59 -05: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
Konstantin Käfer
278e6bd556 use std::tuple<> to forward parameters into the Thread<> object
works around GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226
2015-04-13 12:58:47 +02:00
Konstantin Käfer
4c7132337f convert DefaultFileSource to use util::Thread<> 2015-04-10 22:37:27 +02:00
Konstantin Käfer
bd531b9e08 guarantee that Object stays around
Adds more documentation, and guarantees that the Object in the managed thread stays around until the Thread<> destructor is called. This might happen if .start() returns before .stop() is called, e.g. when a run loop in Object() terminates prematurely.
2015-04-10 15:52:02 +02:00
Konstantin Käfer
bba3d9838a add Thread<T> and RunLoop
Thread<T> is a generic thread management object that starts a thread, creates an object T in that thread and calls its .start() function. When the Thread<T> object is destructed (which must happen in the thread that created it), it'll call the object's .stop() function, and wait for thread termination. The .stop() function must somehow get the thread to terminate. Note that object T's constructor/destructor/start()/stop() must be protected/private, and Thread<T> must be declared as a friend class. All public functions may be called from any thread and are exposed through operator->().

RunLoop encapsulates a libuv runloop and has a facility of dispatching function objects to the thread. It can be used either as a worker thread class by itself, or it can be derived from. This commit converts SQLiteCache to derive from RunLoop and removes the custom code used previously for managing the cache thread.
2015-04-10 15:36:32 +02:00
Brad Leege
88ec0f1607 Merge pull request #1249 from mapbox/1247-altitude
Altitude Metric
2015-04-09 18:49:53 -05:00
Brad Leege
19e4bc7541 #1247 - Adding Altitude and Vertical Accuracy attributes to location events 2015-04-09 18:08:15 -05:00
John Firebaugh
6708959d12 Remove some uv.hpp includes 2015-04-09 15:30:58 -07:00
John Firebaugh
0c087603e6 Replace uv_messenger with AsyncQueue; rewrite remaining uv_* in C++ 2015-04-09 15:30:58 -07:00
Konstantin Käfer
b47ebba2b9 Merge pull request #1071 from mapbox/1071-sqlite-avoid-crash
Gracefully handle SQLite errors
2015-04-08 16:48:58 +02:00
Konstantin Käfer
7d58a41de5 make sqlite storage more resilient to sporadic errors
- catch SQLite exceptions and report them
- failed statements are ignored, we're really just caching here, so if it fails we're handling it gracefully elsewhere
- handle cases where the database file goes away after we opened it
- handle cases where the schema wasn't created after the database file was opened successfully
- add tests
2015-04-07 18:04:23 +02:00
Brad Leege
def309ba24 #1216 - Adding start and stop location manager update to pause and resume functions. 2015-04-06 23:15:00 -05:00
Brad Leege
4092e46982 #1216 - Add pause and resume methods with corresponding isPaused boolean flag property 2015-04-06 23:03:27 -05:00
John Firebaugh
6262172034 Merge pull request #1200 from mapbox/source
Eliminate StyleSource
2015-04-06 17:09:21 -07:00
John Firebaugh
d8411f26d2 Tile::ID ⇢ TileID
This allows making both Tile and TileID private.
2015-04-06 13:58:56 -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
John Firebaugh
7e0e55e542 Eliminate StyleSource
Fixes #695
2015-04-06 10:30:01 -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
Brad Leege
8413da0d68 #1195 - Adding speed and course attributes to location event 2015-04-03 11:10:35 -05:00
Justin R. Miller
dafce83acd Merge pull request #1192 from mapbox/location-and-docs-tweaks
improvements to iOS docs & user location framework
2015-04-02 17:50:32 -07:00
Justin R. Miller
dbd22ae61a reverting to title/subtitle setters for user location 2015-04-02 17:12:05 -07:00
Justin R. Miller
9a416c449c Improvements to docs & user location framework.
* Cleans up & documents more APIs, especially in location.
 * Moves `coordinate` internal and makes use of `location` to retrieve it.
 * Moves `title` & `subtitle` internal since part of `MGLAnnotation` protocol.
 * Enables `isUpdating` by privately associating weakly with a map view.
2015-04-02 16:58:24 -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
John Firebaugh
9e38d7cc2b Move Update to its own header file 2015-04-02 15:30:13 -07:00