Commit Graph

5812 Commits

Author SHA1 Message Date
John Firebaugh
66c415a267 Don't abandon a null texture 2015-06-17 17:07:17 -07:00
John Firebaugh
fd58861fcd Change StyleBucket::source to indirect reference
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.
2015-06-17 17:07:16 -07:00
Thiago Marcos P. Santos
0581df8787 Do not hold a reference to the Style at the [Live|Vector]TileData
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.
2015-06-17 17:07:16 -07:00
Thiago Marcos P. Santos
4f3fc3c2c9 Support shape annotations on GLFWView
Add different random triangles count by using the keys 7, 8, 9 or 0.
Q will clear all the annotations.
W will remove one annotation.
2015-06-17 17:07:16 -07:00
Minh Nguyễn
bf6a100801 Avoid null-change KVO notifications
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.
2015-06-17 16:49:12 -07:00
Justin R. Miller
dcbb5b2e4e manually handle GeoJSONVT for OS X 2015-06-17 15:52:00 -07:00
Minh Nguyễn
91641ffb01 Lightweight generics
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/.
2015-06-17 15:33:00 -07:00
Justin R. Miller
4806f7f0a5 fixes #1650: default to no symbols for release builds, but build both 2015-06-17 12:55:10 -07:00
Minh Nguyễn
e3e73220c1 Audited shape annotation classes for nullability
Audited various classes to match MapKit. Also, `-[MGLAnnotation title]` is nullable because titles are optional for shape annotations.
2015-06-17 12:55:05 -07:00
Minh Nguyễn
07d4075abb Defer to MGLMultiPoint for overlayBounds implementation
Fixes #1730.
2015-06-17 12:54:57 -07:00
Minh Nguyễn
f50a27bc8a Corrected bundledStyleURLs doc comment
Per f46328655e (commitcomment-11695358).
2015-06-17 12:54:48 -07:00
Justin R. Miller
73737445ec fixes #1650: default to no symbols for release builds, but build both 2015-06-17 12:48:11 -07:00
Mike Morris
27fc2f18e3 clarify C++14 runtime support and external dependencies to build from source 2015-06-17 14:23:29 -04:00
Mike Morris
6d17467dbc Update CHANGELOG.md 2015-06-17 12:15:50 -04:00
Minh Nguyễn
0686807a21 Audited shape annotation classes for nullability
Audited various classes to match MapKit. Also, `-[MGLAnnotation title]` is nullable because titles are optional for shape annotations.
2015-06-16 16:32:57 -07:00
Mike Morris
6081f15237 v1.1.1 [publish binary] 2015-06-16 15:37:02 -04:00
Mike Morris
7315212cb8 Merge pull request #136 from mapbox/mbgl-v0.3.5
bump mbgl to v0.3.5
2015-06-16 15:35:19 -04:00
Mike Morris
a25fa2e076 bump mbgl to v0.3.5
add geojsonvt dependency in Makefile

update changelog
2015-06-16 14:21:27 -04:00
Minh Nguyễn
416928f824 Defer to MGLMultiPoint for overlayBounds implementation
Fixes #1730.
2015-06-16 11:06:46 -07:00
Mike Morris
254a437051 Merge pull request #135 from mapbox/travis-publish
fix clang CXX matching
2015-06-16 13:35:57 -04:00
Mike Morris
7be5f15e50 fix clang CXX matching [publish binary]
explicitly set CXX on OS X
2015-06-16 12:54:00 -04:00
Minh Nguyễn
df6ab1dc00 Corrected bundledStyleURLs doc comment
Per f46328655e (commitcomment-11695358).
2015-06-16 09:45:10 -07:00
Thiago Marcos P. Santos
4623baa1a5 Add tests for renderStill() misuse 2015-06-16 14:09:51 +03:00
Thiago Marcos P. Santos
57c34747a2 Report errors for renderStill() misuse using the callback
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.
2015-06-16 14:06:29 +03:00
Justin R. Miller
556938e8bb [publish ios-v0.3.5] 2015-06-15 22:20:52 -07:00
Justin R. Miller
d9f09596fb bump podspec version 2015-06-15 22:20:16 -07:00
Justin R. Miller
8dbf2bf8da refs #1483: move to simple tagging scheme, but preserve platform in publish command 2015-06-15 22:19:34 -07:00
Justin R. Miller
bd0bf294bf squash of #1655: shape annotations support for core & iOS 2015-06-15 18:30:39 -07:00
Jason Wray
e75e538ddb Add location tests for iOS
- 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.
2015-06-15 16:42:32 -07:00
John Firebaugh
69cf6ed3d2 Reenable iOS tests, default hardware/iOS version only for now
Use of the -destination argument to either xcodebuild or xctool
fails on Travis.

Refs #1452
2015-06-15 16:12:14 -07:00
Minh Nguyễn
714b68f7b3 Revert "use array of structs rather than parallel arrays for annotations"
This reverts commit 2435c1ad26 (#1710), which needs to be revisited in light of #1655, which is a much higher priority at the moment.
2015-06-15 15:58:22 -07:00
Mike Morris
b8c45b6273 match all clang++ versions [publish binary] 2015-06-15 17:56:22 -04:00
Justin R. Miller
a08bcb6d0e update README for debug info on test app 2015-06-15 14:35:57 -07:00
Mike Morris
6f4e727654 add npm badge [skip ci] 2015-06-15 17:15:58 -04:00
Mike Morris
5c8107ee3b v1.1.0 [publish binary] 2015-06-15 17:04:53 -04:00
Mike Morris
a29c7c34dc Merge pull request #130 from mapbox/changelog
update changelog and readme
2015-06-15 16:57:47 -04:00
Mike Morris
73abfc3d08 update changelog and readme [skip ci]
- 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.
2015-06-15 16:53:40 -04:00
Mike Morris
e2c56742a8 Merge pull request #129 from mapbox/129-pending_requests_hanging
Map destruction hanging with pending requests
2015-06-15 16:47:53 -04:00
Mike Morris
e06bf232f4 request coalescing fixes #114 2015-06-15 14:52:35 -04:00
Thiago Marcos P. Santos
a6ea979ec5 Add test case for the request coalescing 2015-06-15 13:54:20 +03:00
Thiago Marcos P. Santos
0d2543675f Update the tests
Reflect the changes on the previous MBGL version bump and
unskip tests that should pass now.
2015-06-15 13:54:20 +03:00
Thiago Marcos P. Santos
b602835626 Fix invalid NodeRequest reference
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.
2015-06-15 13:54:20 +03:00
Thiago Marcos P. Santos
34ef7ac003 Implement request coalescing and synchronous request cancellation
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.
2015-06-15 01:52:15 +03:00
hanchao
b8c251592a fix roundabout not closed #1450 2015-06-14 07:56:31 +02:00
Minh Nguyễn
450a6beae0 Restored nullability compatibility shim
This reverts commit a425df0f95f5f0088444b8ebc67708756ff962aa for compatibility with Xcode 6.1.
2015-06-13 19:58:59 -07:00
Minh Nguyễn
4176d21d1c Namespaced reachability notification constant
Fixes #1717.
2015-06-12 11:54:46 -07:00
Thiago Marcos P. Santos
d515f8d77d Bump Mapbox GL Native to v0.3.3 2015-06-12 13:51:52 +03:00
Ansis Brammanis
7dc880080e update test suite to reenable symbol tests 2015-06-11 18:48:07 -04:00
Konstantin Käfer
2435c1ad26 use array of structs rather than parallel arrays for annotations 2015-06-11 17:26:37 -04:00
Minh Nguyễn
f46328655e Audited headers for nullability
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.
2015-06-11 11:37:23 -07:00