This replaces the integration test of `addSource` when duplicate
identifiers are used in `MGLSourceTests` with a more direct unit test
in the style class's unit test file `MGLStyleTests`. Although tests of
the case where the same instance are actually integration tests where
the source instance itself throws, it is easier to test all of this
functionality in one place using the public facing MGLStyle API.
When MGLSource and MGLLayer instances are added to the style, they lose
ownership of their std::unique_ptr<T> after it is moved to the mbgl
level. Subsequent attempts to add such instances result in a C++
exception.
This adds logic in the Darwin platform to raise a NSException if the
source and layer addToMapView methods are called more than once and the
pointer is invalid. In addition, the documentation in MGLStyle for
addSource: and addLayer: has been update to warn developers to avoid
adding the same instance twice and, for that matter, instances with the
same identifier.
* Make tap gesture recognizer fail if it doesn’t do anything.
* fix typo
* Use the right nullable
* update changelog
* Make single click gesture recognizer fail if it doesn’t select an annotation
* fix changelog typo
* Remove singleTapGestureRecognizer from public header
.der files are used only by the iOS platform for SSL pinning. This
moves them out of the `platform/default/resources` directory and into
`platform/ios/resources`. The make configuration for Android is
updated so that it stops attempting to copy the files at all.
This updates the cert for the staging environment. It also adjusts the
telem implementation to send along the horizontal accuracy for each
location event and removes the previous battery level gathering logic.
This updates the code generation for style layers to add a test to check
that the style object returned from mbgl can be safely cast into the
expected type so ownership can be returned to the caller when removing
layers.
This scenario was previously possible if a layer of type T was
added before a layer of type U but both layers shared the same
identifier. In that case, if the pointer to the second layer of type U
was used to remove a layer, a runtime exception would occur since mbgl
returns the layer with type T (the first one added).
Now, an exception will still occur if layers with the same
identifier are manipulated as described above but it is done as part of
a validation check for all public style layer methods at the Darwin
platform level. The NSException attempts to warn developers about using
and reusing style identifiers to avoid this issue in the first place.
- Trim whitespace from labels before determining their max-width for alignment.
- Fix crash on labels that contain lines with only a single character of whitespace.
Even if the expectation is immediately fulfilled, we still have to wait for it to be fulfilled, because the expectation only gets unregistered after waiting. The zombie expectation was fulfilling a stricter expectation in a test method.
std::to_string() potentially uses a decimal point character different
than a dot (.), depending on the environment's locale. But since this
generated string will be part of GLSL code, there needs to be a dot and
nothing else.
This adds a ref count to guard against calling activate after it has
already been called. This can happen when a layer is added during
certain map lifecycle methods like MapChangeWillStartRenderingFrame
that also triggers activation. This also protects against issues
related to a deactivation of the context happening in an inner scope
while an outer scope is still expecting to be able to use the context.
Added a setting to macosapp to change all symbol layers in the current style to use the preferred language if available. If the setting is off, change all symbol layers to use local languages.