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.
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.
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`.
- 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.
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.
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.
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.
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.