Commit Graph

89 Commits

Author SHA1 Message Date
John Firebaugh
e802aedb8c [core, node, android] Remove used "base" parameter from setStyleJSON 2016-06-02 16:33:56 -07:00
John Firebaugh
c902f9098b [core] Rationalize naming for style-related code 2016-06-02 14:51:39 -07:00
John Firebaugh
d7e1ecd19e [core] Generalize Map::{add,remove}CustomLayer 2016-06-02 14:51:39 -07:00
John Firebaugh
0fba70d5a8 [all] Rationalize annotation API 2016-06-01 17:37:01 -07:00
John Firebaugh
8985b1311b [core] Use geometry.hpp types for shape annotations 2016-06-01 17:36:50 -07:00
John Firebaugh
efaf6461aa [android] Basic cleanups in annotation JNI code 2016-06-01 17:36:50 -07:00
John Firebaugh
555c9ed863 [android] Simplify the JNI definitions for annotation methods
Instead of providing both singleton and List-based implementations:

* Define everything in terms of arrays
* Do singleton ⇢ array and List ⇢ array conversions in Java
2016-06-01 17:36:50 -07:00
Tobrun Van Nuland
bd0f0d3a21 [android] #3629 - smooth MyLocationView animation when tracking the user location, introducing a new easeTo method with a linear interpolator 2016-05-26 15:35:03 +02:00
Konstantin Käfer
e2bcea90fc [core] use #pragma once instead of ifdef include guards 2016-05-25 21:35:37 +02:00
Konstantin Käfer
cd65a43855 [core] move from microsecond precision timestamp to integer second precision 2016-05-13 17:24:22 +02:00
Tobrun
7d0d09e7dc [android] - fix black screen issue 2016-05-09 16:44:49 +02:00
Antonio Zugaldia
7d1a4c5ec1 [android] Create a new local reference frame to avoid a local reference table overflow
Fixes #4706
2016-05-03 13:10:37 -04:00
John Firebaugh
b4b693e09f [android] Add completedTile{Count,Size} bindings 2016-04-27 13:41:29 -07:00
Thiago Marcos P. Santos
7d80690f91 [android] Restore prior GLContext if exists
Apparently some versions of Android, notable 4.4.4 running
on my Nexus 5, creates a GLContext on the Android UIThread
which is the one we are now using for rendering after #2909.

If the context is not restored, nothing gets rendered (or
sometimes partially, or artifacts) because Android will try
to do GL stuff on the context used by Mapbox GL and mess things up.
2016-04-18 18:57:20 +03:00
John Firebaugh
6e78eabfff [core] Clean up ThreadContext vestiges 2016-04-15 09:56:18 -07:00
John Firebaugh
3af3e72bb3 [all] Replace HTTPContextBase/HTTPRequestBase with FileSource 2016-04-14 14:18:19 -07:00
Thiago Marcos P. Santos
ba3125142e [android] Make the correct GL context current 2016-04-14 13:51:27 -07:00
Thiago Marcos P. Santos
7b3c61f619 [android] Do not attach/detach to threads
Not needed as everything is now running on the same thread.
2016-04-14 13:51:27 -07:00
Thiago Marcos P. Santos
02db7fa852 [android] Create a RunLoop for the main thread 2016-04-14 13:51:27 -07:00
Thiago Marcos P. Santos
40e590b681 [android] Use ALooper_addFd() and callbacks to wake up
This is needed for plugging into an existing Looper because
we won't call ::run() on the main thread (this is called
on the Java side of the application automatically by Android).

But we still need to wake up and process the events. For that
we create a pipe and write to the pipe to wake up the main
loop and we process events on the callback of the fd handler.

Fixes #4682
2016-04-14 13:44:08 -07:00
John Firebaugh
204c7fee03 [core] Render from the main thread
Do not create a thread for the MapContext anymore.
2016-04-14 13:44:08 -07:00
Brad Leege
9a3e8ae571 [android] #4619 - Creating standalone CustomLayerActivity example 2016-04-06 14:44:52 -05:00
Thiago Marcos P. Santos
10b503eabf [android] Attach thread on the RunLoop
Needed because Looper could be used by Java and it would crash
complaining that we didn't detach otherwise.
2016-04-06 04:52:51 -03:00
Thiago Marcos P. Santos
74a1d3c164 [android] Introduce RunLoop based on Looper
Also implement a Timer and AsyncTask based on Android's Looper.
2016-04-06 04:52:51 -03:00
John Firebaugh
5eda74a514 Merge branch 'release-ios-3.2.0-android-4.0.0' 2016-03-30 17:43:37 -07:00
Brad Leege
335e346ed1 [android] #4475 - Introducing LatLng.wrap() and removing usage of wrap() in JNI's nativeLatLngForPixel() 2016-03-25 16:55:07 -05:00
Brad Leege
6a29e7e624 [android] #4444 - Wrapping all LatLng from nativeLatLngForPixel() to solve problem and mirror Android Google Maps API 2016-03-24 16:59:47 -05:00
John Firebaugh
169755e89a [core] Unify FileRequest and WorkRequest 2016-03-24 10:54:32 -07:00
Antonio Zugaldia
682b404bf6 [android] Unify cache and offline databases
See #4362
2016-03-21 10:55:54 -07:00
John Firebaugh
1593b962ed [android] Throw C++ exceptions by value, not by pointer
Refs #4385
2016-03-18 16:29:22 -07:00
Bruno de Oliveira Abinader
15621b066c [android] Remove default transition duration 2016-03-18 01:26:22 +02:00
Tobrun
20c3706536 [android] #4240 - add flag to resize only when needed. 2016-03-08 08:06:55 -05:00
Tobrun
e9b7cd724f [android] #3631 - resize fix issue 2016-03-07 21:47:40 -05:00
Tobrun
46986c665e [android] #2996 - test workaround for device not sharing context 2016-03-07 21:46:11 -05:00
Thiago Marcos P. Santos
fe811bd38e [android] Do not reach native if the HTTPContext was invalidated
Native will get destroyed before the Java HTTPRequest and asynchronous
requests might still get answered.

If the request gets canceled, we now clear the reference to the native
code and it will never reach it.

Lock is needed because OkHTTP replies on its own thread, so we need to
guard the access to the variable we use for checking if the Request was
canceled. In the future we could remove the lock and use Runnable when
we move Android main loop to Looper instead of libuv.

Like the other implementations of HTTPRequest on Mapbox GL Native, the
request is destroyed synchronously on ::cancel().
2016-03-07 19:13:56 -03:00
John Firebaugh
b318903ab9 [android] Don't crash if someone tries to use OfflineRegion after delete 2016-03-07 09:31:16 -08:00
John Firebaugh
c8b100ffe4 [android] Remove redundant arguments from offline native methods
`this` is automatically provided as the first argument to a native method.
2016-03-07 09:31:16 -08:00
John Firebaugh
6aa8be56f6 [android] destroyOfflineRegion must not delete an already-deleted peer 2016-03-07 09:31:16 -08:00
John Firebaugh
0386aeea22 [android] Don't call util::toString() on a null exception_ptr 2016-03-07 09:31:16 -08:00
John Firebaugh
cce49c147d [android] Don't leak global references to OfflineRegionObservers 2016-03-04 18:45:38 -08:00
John Firebaugh
dbffe1dfab [android] Use jni.hpp low-level wrappers 2016-03-04 15:33:32 -08:00
John Firebaugh
068998cf8a [android] Remove JNI_OnUnload; it is in practice never called
http://bleaklow.com/2006/02/18/jni_onunload_mostly_useless.html
2016-03-04 15:33:32 -08:00
John Firebaugh
edbd4284f2 [android] Remove JNICALL; it's a no-op macro 2016-03-04 15:33:32 -08:00
John Firebaugh
f321bf2514 [android] Remove unnecessary declarations from jni.hpp 2016-03-04 15:33:32 -08:00
John Firebaugh
235f4ee6f6 [android] Use jni.hpp in http_request_android.cpp 2016-03-04 15:33:32 -08:00
Antonio Zugaldia
ee12824c83 [android] Make listOfflineRegions include definitions
Fixes #4165
2016-03-03 13:14:56 -05:00
Tobrun
bc63d75227 [android] #3867 - performance improvement for invalidating the camera 2016-03-03 13:28:01 +01:00
Bruno de Oliveira Abinader
c17e954983 [android|ios|osx] Fix return type for pixelForLatLng 2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
4994b3dc57 [core] PrecisionPoint is now ScreenCoordinate 2016-03-01 20:58:54 +00:00
Antonio Zugaldia
55cacfafd4 [android] Simplify offline metadata API on Android
Fixes #4139
2016-02-29 13:45:08 -05:00