Added aliases for std::chrono typedefs (eg. 'Seconds' for
std::chrono::seconds). These aliases are used together with templated
helper functions to replace time_t with std::chrono::seconds for most
cases, in particular for 'modified' and 'expires' values in Response.
It's a premultiplied image. This implies that we were misusing encodePNG
in most cases, as we were passing premultiplied pixels which were then
interpreted as unmultiplied. I changed encodePNG to accept premultipled
pixels, and unpremultiply in the implementations.
Added transition frame and finish functions to CameraOptions. Added Objective-C equivalents to the three main entry points to easeTo() in MGLMapView.
Fixes#1581.
The previous fix resulted in annotations sometimes never being added.
This would happen if, during the execution of MapContext::update where
Update::Annotations was set, the style itself was loaded but some of
its subresources (sprite or sources) were not.
#3082 is a follow up issue to make MapContext::update less error-prone.
ConstrainMode gives flexibility to our engine to choose between
constraining both vertically and horizontally, or just vertically
(default behavior).
Constrain in both axis means we can no longer pan the map beyond the map
boundaries. This fixes an issue where e.g. annotations disappear upon
crossing the map boundaries.
LatLngBounds southwest and northeast coordinate points were inverted, so
they could be extended via LatLngBounds::extend(). However, this looks
confusing and error-prone.
A static LatLngBounds::getExtendable() is added to address cases when we
want to extend LatLngBounds.
In MapContext thread, TransformState gets updated from main thread to
MapContext and Painter can safely reference MapContext's TransformState
instead of copying it upon each Painter::render call.
The doubly nested lambda that's responsible for executing the callback
needs to check the cancellation flag on *both* threads. See comment for
details.
Only the WorkTask mutex needs to be recusive because
the WorkQueue will run a WorkTask that will pop
itself from the WorkQueue causing it to get cancelled.
Make use of PrecisionPoint's operator functionalities inherited from
vec2<> and reduced overhead eg. offset_y is always 0 so no need to add
this to calculation inside the if.
This change fixes a bug introduced in 4d5c6333be for #2727. 1 << 32 would exceed the size of int64_t. The static analyzer reported undefined behavior here because std::min() might or might not return 32.
Corrected Transform::_setScale() after the refactoring in 5a24ac605b for #2994. This change also addresses two dead store warnings from the static analyzer.
Pass-by-const-ref is not always possible because CameraOptions gets its
members modified along the way.
Also fixes a case in Map::jumpTo where Update::Zoom should be called if
zoom is affected.
The final frame is self-destructing – it destroys the frame and finish functions – so technically we’re no longer inTransition(). Yet there still needs to be an update after that final frame.
Also, avoid a redundant change notification on the last frame. (It would come too late, after the DidChange notification, anyhow.)
Fixes#2946.
We shouldn't overload transition duration to mean the duration of the
cross-fade when moving between stops. If we want to allow styles to
override the default 300ms fade duration, it should be a dedicated
property like raster-fade-duration.
I don't think any styles use this functionality -- if they did, they
were broken for MapMode::Still rendering.