SymbolLayout lives on the worker thread and contains the persistent data needed for repeated placement. SymbolBucket contains the data generated during placement, and is transferred to the main thread for rendering.
This eliminates the risky sharing of GeometryTile::buckets between the main thread and worker thread during TileWorker::redoPlacement.
While here, rationalize the names of states a SymbolLayout may be in:
* Pending: Waiting for the necessary glyphs or icons to be available.
* Prepared: The potential positions of text and icons have been determined.
* Placed: The final positions have been determined, taking into account prior layers.
In TileWorker, all SymbolLayouts are stored in a single vector. Each SymbolLayout knows what state it is in, and TileWorker can easily determine how much progress it can make toward a final result.
This reverts a previous change that used only the contentInset
when setting the center coordinate of the map view.
Instead of contentInset, edgePaddingForFollowing is used. This fixes
a regression that caused the user dot annotation to be misplaced
when the map was configured to show the annotation in any place other
than in the center of the map.
In addition, edgePaddingForFollowing is updated to account for
contentInset when it calculates its UIEdgeInsets. This fixes a bug
where the user dot would move to the center of the content frame
(when it was adjusted for content insets) but the map would not scroll
along with it yielding the effect of the user dot being misplaced.
- Ensure that sqlite3_config() is always called before db init.
- Should only be called once, now.
- Move sqliteVersionCheck into mapbox::sqlite namespace.
Previously, we declared MGLStyleLayer initializers in the MGLStyleLayer
protocol as optional methods. This made it easy to opt in and out
of initializers that did or or did not make sense for the subclass.
However, this approach was dangerous since it was easy for an
application developer to initialize an MGLStyleLayer subclass with an
init method that was actually not implemented in that class causing
an exception at runtime.
This commit moves the init methods that each subclass supports to
each subclass so xcode (and the compiler) help the developer avoid
the previously possible runtime exception.
In addition, a new init method is added that takes the source layer
and passes that on to `mbgl::style:Layer` (but only on classes
where this is possible in core). This allows an application developer
to style a specific source layer (i.e. the contour lines of the mapbox
terrain vector source).
Finally, this refactors MGLStyleLayer classes to use an MGLSource instead of a
string identifier for the source when initializing the style.