Commit Graph

65 Commits

Author SHA1 Message Date
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
Antonio Zugaldia
11d3eff173 [android] Remove invoke to DeleteGlobalRef to avoid client crash
See #4121
2016-02-26 10:05:47 -05:00
Antonio Zugaldia
01e55f183e # This is a combination of 8 commits.
# The first commit's message is:
# This is a combination of 2 commits.
# The first commit's message is:

# This is a combination of 3 commits.
# The first commit's message is:
# This is a combination of 2 commits.
# The first commit's message is:

# This is a combination of 21 commits.
# The first commit's message is:
[android] - Implements Android bindings for offline API
Fixes #3891

# The 2nd commit message will be skipped:

#	[android] #3891 - rename OFFLINE_MAX_CACHE_SIZE to DEFAULT_MAX_CACHE_SIZE and adjust value

# The 3rd commit message will be skipped:

#	[android] #3891 - makes de documentation more relevant to the current android implementation

# The 4th commit message will be skipped:

#	[android] #3891 - rename isRequiredResourceCountIsIndeterminate() to isRequiredResourceCountPrecise()

# The 5th commit message will be skipped:

#	[android] #3891 - rename complete() to isComplete()

# The 6th commit message will be skipped:

#	[android] #3891 - rename OfflineRegionDefinition to OfflineTilePyramidRegionDefinition and make OfflineRegionDefinition an interface. Docs for corresponding classes updated.

# The 7th commit message will be skipped:

#	[android] #3891 - make reason a more idiomatic ErrorReason Android IntDef and remove unnecessary constructor

# The 8th commit message will be skipped:

#	[android] #3891 - reuse the calling object instead of creating a new manager

# The 9th commit message will be skipped:

#	[android] #3891 - location, location, location

# The 10th commit message will be skipped:

#	[android] #3891 - simpler list regions iteration

# The 11th commit message will be skipped:

#	[android] #3891 - proper indeterminate -> precise transition

# The 12th commit message will be skipped:

#	[android] #3891 - improve description for DEFAULT_MAX_CACHE_SIZE

# The 13th commit message will be skipped:

#	[android] #3891 - delete global refs for obj and listCallback

# The 14th commit message will be skipped:

#	[android] #3891 - simplify metadata conversion and fix metadata object

# The 15th commit message will be skipped:

#	[android] - Implements Android bindings for offline API
#	Fixes #3891

# The 16th commit message will be skipped:

#	[android] #3891 - avoid exposing the int reason value in the public API

# The 17th commit message will be skipped:

#	[android] #3891 - delete global refs for remaining callbacks and observer

# The 18th commit message will be skipped:

#	[android] #3891 - remove unused offlineManagerClassConstructorId together with unnecessary private java constructor

# The 19th commit message will be skipped:

#	[android] #3891 - remove non-relevant line

# The 20th commit message will be skipped:

#	[android] #3891 - handle requiredResourceCountIsIndeterminate -> requiredResourceCountIsPrecise rename

# The 21st commit message will be skipped:

#	[android] #3891 - revert map changes to allow rebase

# The 2nd commit message will be skipped:

#	[android] #3891 - avoid exposing the int reason value in the public API

# The 2nd commit message will be skipped:

#	[android] #3891 - rename complete() to isComplete()

# The 3rd commit message will be skipped:

#	[android] #3891 - rename OfflineRegionDefinition to OfflineTilePyramidRegionDefinition and make OfflineRegionDefinition an interface. Docs for corresponding classes updated.

# The 2nd commit message will be skipped:

#	[android] #3891 - location, location, location

# The 2nd commit message will be skipped:

#	[android] #3891 - improve description for DEFAULT_MAX_CACHE_SIZE

# The 3rd commit message will be skipped:

#	[android] #3891 - delete global refs for obj and listCallback

# The 4th commit message will be skipped:

#	[android] #3891 - simplify metadata conversion and fix metadata object

# The 5th commit message will be skipped:

#	[android] #3891 - delete global refs for remaining callbacks and observer

# The 6th commit message will be skipped:

#	[android] #3891 - remove unused offlineManagerClassConstructorId together with unnecessary private java constructor

# The 7th commit message will be skipped:

#	[android] #3891 - remove non-relevant line

# The 8th commit message will be skipped:

#	[android] #3891 - handle requiredResourceCountIsIndeterminate -> requiredResourceCountIsPrecise rename
2016-02-26 09:13:17 -05:00
Thiago Marcos P. Santos
18380708cd [android] Fix crash on HTTP 200 with no data 2016-02-23 00:21:57 +02:00
Gabriel Miklós
b395302990 [android] Update marker position and icon #3885 2016-02-15 11:05:29 +01:00
John Firebaugh
ff15bd51b9 [core] Throttle the number of concurrent requests to 20 2016-02-10 15:40:20 -08:00
John Firebaugh
e9302c797f [all] Don't interpret 404s on non-tile resources as "no content" 2016-02-10 15:40:20 -08:00
John Firebaugh
7eb1a91c4e [all] Do not set Response data for 404s
For AssetFileSource and the node FileSource this was already the case; this makes the other implementations consistent.
2016-02-10 15:40:20 -08:00
Jonas Bergvall
040fc09ea7 [android] Fixed error with asset URLs with URL encoded spaces. 2016-02-08 10:05:57 -08:00
Konstantin Käfer
2f06ca74e2 [core] move platform/gl.hpp to gl/gl.hpp 2016-02-08 12:50:00 +01:00
John Firebaugh
4d29c7d5ce [core] Remove Response::Error::Reason::Canceled
There is no such thing as a cancelled response, only cancelled requests. A request that is cancelled does not have its callback called with a Response.
2016-02-04 13:18:14 -08:00
Tobrun
aa05cba0df [android] #3758 - Projection / Visible Region implementation.
[android] #3758 - add VisibleRegion + unit tests, removed boundingbox, cleanup jni, cleanup test app, renamed CoordinateSpan to LatLng.
2016-02-04 12:08:39 +01:00
John Firebaugh
37c27f3a8f [core] Improve LatLngBounds API
* Use "named constructors": empty, world, hull
* Make the two-argument constructor lenient (i.e., it is a hull operation)
* Add various accessors
* Enforce a single empty representation
2016-02-02 23:04:18 -08:00
Tobrun
8ed1dc9f74 [android] #3145 - MapboxMap 2016-01-29 13:15:58 +01:00
Ansis Brammanis
ca0099b6a4 [android] getters, setters for minZoom, maxZoom
adds:
map.getMminZoom();
map.setMminZoom(double);
map.getMaxZoom();
map.setMaxZoom(double);
2016-01-28 15:10:26 -08:00
Larry Geromegnace
72ca584638 [android] Use padding to get center coordinates. 2016-01-27 10:57:38 -06:00
Larry Geromegnace
c114ed6562 [android] Add API to be able to set insets on MapView. 2016-01-27 10:57:38 -06:00
Minh Nguyễn
8a23bdcd01 [core, ios, osx] Tilt around visual center point
The tilt gesture on both iOS and OS X now respects the content insets. On iOS, in user tracking mode, it additionally respects the user dot’s position if it’s aligned to the top or bottom of the view.
2016-01-26 18:49:01 -08:00
Bruno de Oliveira Abinader
2f86467586 Cleanup std::chrono usage
Use mbgl::Duration and mbgl::{,Milli}Seconds whenever possible.
2016-01-25 15:11:18 +02:00
John Firebaugh
a877b9b192 [core] Include prior values of caching headers in Resource
This allows the FileSource interface itself to support revalidation. We could (and probably should) now rewrite HTTPContextBase implementations as FileSource implementations.
2016-01-22 18:42:53 -08:00
John Firebaugh
cef5c331fe [core] Merge rfc1123, iso8601, and parse_date into chrono.hpp and fix their API 2016-01-22 18:41:54 -08:00
John Firebaugh
fd847bca9e [android] Fix semantics in absence of response headers
Absence of response headers should result in null etag/modified/expires optionals, not present-but-0-or-"" optionals.
2016-01-21 11:22:11 -08:00
John Firebaugh
1c21d0fd4c [core] Use better types for modified / expires / etag 2016-01-21 11:22:11 -08:00
John Firebaugh
1766d7dcbf [core] Eliminate RequestBase
HTTPRequestBase can now itself be the base class.
2016-01-21 11:22:11 -08:00
Ansis Brammanis
d34f8eb674 [core][ios][osx][android] make SpriteImage accept PremultipliedImage
the SpriteImage constructor signature changes from

SpriteImage(
        uint16_t width, uint16_t height, float pixelRatio,
        std::string&& data, bool sdf = false);

to

SpriteImage(PremultipliedImage&&, float pixelRatio, bool sdf = false)
2016-01-19 18:23:21 -08:00