This eliminates a reference loop: VectorTileData holds StyleLayers which
hold StyleBuckets which held Sources which hold VectorTileDatas. This
breaks the StyleBucket -> Source link in favor of manually resolving the
reference where necessary.
Layers are added and removed dynamically on the Map thread when we use shape
annotations and we are iterating style.layers on the Worker thread without
any lock.
Now when we create a [Live|Vector]TileData at the Map thread we give it
a layers list (instead of the Style) and [Live|Vector]TileData will ultimately
make a copy of this list (on the Map thread, so no concurrency with
adding shape annotations).
The copy should be relatively cheap because we are using a shared pointer
for storing the layers on the list.
If no access token is set in the Info.plist, avoid triggering a KVO notification about the access token changing. By the same token (heh), avoid pulling a C string out of the change dictionary if the access token is being nilled out.
Added lightweight generics annotations to collection-typed method and protocol signatures to streamline usage of these members in Swift. Lightweight generic type specifiers are wrapped in conditionally-compiled macros for compatibility with Xcode 6.x.
Manually preprocess the NS_*_OF() macros in a temporary copy of each header before appledoc sees the headers. Also removed the --ignore flag because we no longer have a private headers folder under include/mbgl/ios/.
Use the callback provided for reporting the errors instead of throwing
an exception. The problem with the exception is it will happen on the
Map thread which makes it impossible to the user of our API to catch,
ultimately resulting in a crash.
In the scenario of not providing a callback, we just print an error.
- Adds testDelegatesStartStopLocatingUser: Tests mapViewWillStartLocatingUser and mapViewDidStopLocatingUser delegate methods
- Adds testUserTrackingModeFollow
- Adds testUserTrackingModeFollowWithHeading (disabled because of library bug)
Fakes user location via swizzled CLLocationManager and hard-coded mock coordinates and heading.
- Document Node.js v0.12.x and io.js support
- Document map.release functionality.
- Add notes on garbage collection and request handling.
- Update binary platforms and build instructions.
- Document API token FileSource implementation from
https://github.com/mapbox/mapbox-gl-native/pull/1607
- Update Kind enum values.
On the code path built with node v0.12.4, we are storing
an invalid reference to NodeRequest on the "pending" list. It will
crash when we need to access it like we do when canceling a request.
Ideally we should just have a "std::unordered_map<mbgl::Resource,
v8::UniquePersistent>" but that is not possible because the move
semantics are not fully implemented until V8 v4.3.22. It can be used
on a std::vector but not on a std::map.
See: https://code.google.com/p/v8/issues/detail?id=3669
The solution for keep using C++11 move semantics is to declare the
v8::CopyablePersistentTraits shenanigans and explicitly clear the
v8::Persistent (like we do already for node v0.10).
When Node gets V8 v4.3.22+ we can go back to v8::UniquePersistent
with a more clear implementation.
When requests are made to the FileSource, we now group them by
resource, similarly to what is done on the native implementation. The
file source will reuse the same Response for all the requests on the
observer list.
The NodeRequest no longer holds a reference to the mbgl::Request, so
we can cancel it synchronously. This is needed to avoid a deadlock
when releasing the NodeMap resources with pending requests.
Before:
- Main thread | NodeMap::release()
- Main thread | mbgl::~Map()
- Main thread | Blocks waiting for the Map thread to join
- Map thread | mbgl::Request::cancel()
- Map thread | NodeFileSource posts the "cancel" message to main thread
- *deadlock* | Map thread cannot join because mbgl::Request holds a
reference to the Map thread main loop. Main thread is
blocked, never gets the "cancel" message.
Now:
- Main thread | NodeMap::release()
- Main thread | mbgl::~Map()
- Main thread | Blocks waiting for the Map thread to join
- Map thread | Request::cancel()
- Map thread | NodeFileSource::cancel(), destroys the mbgl::Request
synchronously, mutex guarded access. We also send
a notification to cancel the NodeRequest on the main
thread.
- Map thread | Map thread joins.
- Main thread | NodeMap::release() returns
- Main thread | NodeRequest gets canceled. If NodeRequest replies
before it gets the "cancel" message, nothing happens,
notification gets discarded.
Added some nullability qualifiers in method implementation selectors for consistency with declarations.
The user dot view now has a non-zero size. Previously only its layer was sized properly. Also resolved some pedantic warnings about missing designated initializer overrides.
Xcode 6.3 or above is now required for building this project.