Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Merge branch release-ios-v3.4.0 to master (after beta 4) #7282

Merged
merged 68 commits into from
Dec 4, 2016

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Dec 2, 2016

This merges release-ios-v3.4.0 at 9eb7f88 (well after beta 4 but before beta 5) into master at 8403883. This was a challenging merge because of the many changes that were cherry-picked into the release branch, some out of order. When remerging the release branch into this branch for the second time, I had to redo 2db31be (#7279) by hand because git passed over that change completely.

/cc @boundsj @jfirebaugh @ivovandongen

boundsj and others added 30 commits November 3, 2016 18:19
…6888)

* [ios] Store annotation tags for MGLMultiPoint annotations in the map

This fixes an issue where, if a multipoint annotation was added,
native annotation view update logic would crash. Adding the annotation
tag for multipoints, too, avoids the out of range exception.

This also adds a check for MGLMultiPoint for offscreen annotations
for consistency with the onscreen case.
When annotations are removed concurrently with being updated because
of a map redraw, it is possible that mbgl will still consider an
annotation to exist depending on what part of the map lifecycle the
call update annotations happens. However, the annotation context by
tag map in MGLMapView (on the main thread) will always be up to date.
This adds a guard that uses that map to avoid considering annotations
that have actually been removed as visible.

Another issue was that adding the same annotation object twice has
always been allowed and has worked, visually. However, a recent
refactor to make the reuse queue work correctly is not tolerant of the
a single view representing two annotation instances that are the same.
The effect is that a new UIView will be generated for each (clone)
annotation that is added and only the last view will move with the map.
The other views become detached and float around in the view as the
map is panned. This commit adds a guard to make adding an annotation
instance a no-op if it has already been added before.
Define NSErrorDomain before its first use. Define NSNotificationName as a typedef instead of a #define. Guard these shims on the existence of NS_STRING_ENUM rather than another macro that’s new to Xcode 8.

Fixes #6906.
`MGLStyleLayer` was updated to support a raw pointer to the mbgl object, which is always initialized, either to the  value returned by `mbgl::Map getLayer`, or for independently created objects,  to the pointer value held in `pendingLayer`. In the latter case, this raw  pointer value stays even after ownership of the object is transferred via  `mbgl::Map addLayer`.
A previous refactor neglected to remove the unused `layer` property.
This removes that property and uses the rawLayer property that actually
points to the mbgl layer.
Optimized lookup of annotation tags by annotation from O(n) to a simple map lookup, for better performance and consistency with the iOS implementation of MGLMapView.
Streamlined -[MGLMapView annotationTagForAnnotation:] to use the mapping added in #5987. Reverted an unsafe access into that mapping that was added in #5987; returning nil is preferable when no such annotation can be found. Return the user location annotation view when given the user location annotation.
Enable OSMesa backend via WITH_OSMESA=1 envvar.

OSMesa backend uses Gallium OSMesa implementation, which uses
LLVMpipe as default driver.
When a source or layer is removed transfer ownership back to the
caller so it can (optionally) take it. Preserve the behavior that 
removing a CustomLayer triggers deinitialization.  Deinitialize all 
custom layers when a style is destroyed in case those layers are not 
explicitly removed.
)

Refactor the previous C array based implementation to use C++ std::vector. This is done to avoid potential safety and security issues with the previous approach.
Removed individual OHHTTPStubs file references from the ios-tests project. Added a reference to the OHHTTPStubs project to the workspace. Link ios-tests to its iOS framework build product.
If a source or layer is removed from the style, recapture the
unique pointer ownership. This makes it safe to add back sources
and layers after they have been removed.
NSLayoutRelationGreaterThanOrEqual meant that it either greater-than or
equal could satisify the constraint, when really all we need is equal.
In iOS 10, the top layout guide is not always returning the expected
value unless there is a constraint applied directly against it.
frederoni and others added 16 commits November 30, 2016 11:36
Update documentation to make the implications of identifiers clearer.
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.
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.
.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.
Note the support of CONTAINS and the lack of support for case and
diacritic operator modifiers.
…ng (#7246)

* 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
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.
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.
This adds notes to the methods for adding sources and layers to warn
of the hazards of using duplicate instances or identifiers.
@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Dec 2, 2016
@1ec5 1ec5 added this to the ios-v3.4.0 milestone Dec 2, 2016
@1ec5 1ec5 self-assigned this Dec 2, 2016
@mention-bot
Copy link

@1ec5, thanks for your PR! By analyzing this pull request, we identified @incanus, @boundsj and @friedbunny to be potential reviewers.

@1ec5
Copy link
Contributor Author

1ec5 commented Dec 2, 2016

For the conflicts involving platform/android/config.cmake, I mistakenly accepted the master version without realizing that the version on the release branch needed to be accepted due to dbb5206 (#7212). I’ll have to redo this merge.

@1ec5 1ec5 added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Dec 2, 2016
@1ec5 1ec5 force-pushed the 1ec5-release-ios-v3.4.0-beta.4-master branch from d0c1d93 to 3503c0e Compare December 3, 2016 23:36
@1ec5 1ec5 merged commit 3503c0e into master Dec 4, 2016
@1ec5 1ec5 deleted the 1ec5-release-ios-v3.4.0-beta.4-master branch December 4, 2016 03:22
@1ec5 1ec5 removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Dec 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.