Commit Graph

688 Commits

Author SHA1 Message Date
John Firebaugh
2f9e6f4e94 [core] Allow the use of special characters in property field names
Fixes #4336
2016-03-23 17:15:18 -07:00
Thiago Marcos P. Santos
f854368f29 [tests] Mark some tests as requiring server
Otherwise they will fail on iOS with connection error.

Fixex #4434
2016-03-23 09:53:08 -07:00
Jason Wray
8bdfca53ae [tests] fix make iproj copy phase for unit text fixtures 2016-03-22 17:06:33 -07:00
John Firebaugh
220a57b36f [tests] Tweak offline tests to work on iOS 2016-03-22 11:56:01 -07:00
Konstantin Käfer
c587eefbb1 [ios] make unit tests work on iOS and iOS Simulator 2016-03-22 11:56:01 -07:00
Konstantin Käfer
db5ac4785f [test] rearrange test files so they're not in the fixtures folder 2016-03-22 11:56:01 -07:00
Konstantin Käfer
1dd81d9776 [test] remove crc64 and compare images
boost's crc64 breaks on iOS
2016-03-22 11:56:01 -07:00
Thiago Marcos P. Santos
0e201eb23d [tests] Add utest to make sure prior expiration time is being respected 2016-03-17 23:57:28 -03:00
Bruno de Oliveira Abinader
cd1a06c2dc [core] Get rid of MapData::{get,set}animationTime 2016-03-18 01:27:48 +02:00
Bruno de Oliveira Abinader
01edd4503c [core] Move class handling to Style 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
ac70ada2d3 [core] Check for NaNs in mbgl::util::{min,max,clamp} 2016-03-18 00:53:14 +02:00
Bruno de Oliveira Abinader
fc0a0ef98a [core] Always return wrapped coordinates
This fixes an issue in both iOS and Android when e.g. adding a marker on
both sides of the dateline border in Taveuni island, the marker in one
of the sides would have an out-of-bounds longitude.
2016-03-14 12:16:55 +02:00
Bruno de Oliveira Abinader
b5bb48edaa [core] Simplify LatLng::unwrapForShortestPath usage
Simplify LatLng::{wrap,unwrapForShortestPath} code, avoiding duplicated
code between Transform::{latLngToScreenCoordinate,easeTo,flyTo}.

Added unit tests for camera usage in Transform to detect cases like e.g.
crossing the antimeridian as a shortest path between two coordinates.

Transform::flyTo precision loss to be handled in #4298.
2016-03-14 11:45:31 +02:00
Bruno de Oliveira Abinader
fe7e208b42 [core] Implement LatLng::null() 2016-03-13 21:38:20 +02:00
Bruno de Oliveira Abinader
8e30a4a080 [core] Harden Transform anchor & padding usage
Use optional values for anchor & padding in Map and Transform functions
instead of NaNs. Added unit tests to stress some edge cases.
2016-03-13 21:38:20 +02:00
Minh Nguyễn
4748973c04 [core] Deactivate offline region upon completion 2016-03-11 11:43:32 -08:00
Bruno de Oliveira Abinader
694a064cdd [core] Fix non-anchored Transform::setAngle
This reverts a line change from b33b2f15, because we explicitely want
the anchor to be invalid.
2016-03-11 16:53:36 +02:00
Bruno de Oliveira Abinader
f73beb5913 [core] Fix screen coordinates when crossing the antimeridian (#2)
Added missing case. Really fixes #4155 this time.
2016-03-11 12:34:21 +02:00
Bruno de Oliveira Abinader
3879bc6a4e [core] Make vec{2,3,4} operator bool explicit 2016-03-11 02:24:09 +02:00
Bruno de Oliveira Abinader
1a4b8f3e2f [core] Fix screen coordinates when crossing the antimeridian
If the center and point coordinates are not in the same side of the
antimeridian, we need to unwrap the point longitude to make sure
it can still be seen from the visible side of the antimeridian that is
opposite to the center side.

Fixes #4155.
2016-03-10 14:00:42 +02:00
Bruno de Oliveira Abinader
b33b2f1515 [core] Check for NaNs in EdgeInsets 2016-03-10 03:36:46 +02:00
Bruno de Oliveira Abinader
026b6d4c01 [core] Coordinate wrapping fixes
- Make returning LatLngs unwrapped by default.
- PointAnnotation and ShapeAnnotation are always wrapped so they can be
  selected via intersection from the visible tile boundaries.
- Fixes LatLng::wrap() calculation.
- Fixes LatLng::unwrapForShortestPath() calculation.

The new unwrapForShortestPath algorithm unwraps the start coordinate
either forwards or backwards depending on the end coordinate value, so
we can always cross the antimeridian when needed and still obtain a
wrapped end coordinate in the end.

Fixes #4214.
2016-03-10 03:36:45 +02:00
John Firebaugh
7cceca4b45 [core] Deactivate OfflineDownload when the tile count limit is hit
This is a better behavior than sending hundreds or thousands of tileCountLimitExceeded notifications.
2016-03-09 13:40:00 -08:00
John Firebaugh
e49c1e3da3 [core] Fix offline status reporting regressions
The core of the change is ensuring that ensureResource doesn't release Zalgo: it should be consistently async, rather than async in the case that the resource doesn't exist in the database, but sync if it does.

This ensures that status is reported in a more consistent sequence, regardless of the database state.
2016-03-08 10:28:33 -08:00
John Firebaugh
8fee0f33c0 [core] Fix RunLoop::run() behavior when called a second time 2016-03-08 10:28:01 -08:00
Thiago Marcos P. Santos
aaf9e8256f [tests] Add utest for NetworkStatus::Online/Offline 2016-03-08 10:31:01 -03:00
Thiago Marcos P. Santos
b8b283588f [core] Remove goOffline() from DefaultFileSource
Use the newly added NetworkStatus::Set().
2016-03-08 10:31:01 -03:00
John Firebaugh
a3791b2325 [core] Ensure OfflineRegionStatus::downloadState is accurately reported 2016-03-07 19:08:03 -08:00
Konstantin Käfer
8112ac3371 [core] explicitly initialize a few fields to null 2016-03-04 16:01:41 -08:00
John Firebaugh
eb9b463841 [core] Fix offline status reporting with pre-existing tiles (#4147) 2016-03-04 15:15:09 -08:00
Bruno de Oliveira Abinader
fde0ab98ee [core] Moved TileCoordinate to tile cover scope 2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
abe3f9ce7a [core] Moved wrapping to LatLng scope
Fixes a precision loss when converting unwrapped LatLngs.
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
Bruno de Oliveira Abinader
411a562061 [core] Enforce constants usage
Use 'LATITUDE_MAX', 'LONGITUDE_MAX', 'DEG2RAD' and 'RAD2DEG' whenever
possible.
2016-03-01 20:58:54 +00:00
Thiago Marcos P. Santos
c8b7066d2e [tests] Unit tests for clock skew retry timeout 2016-02-26 03:52:02 +02:00
Thiago Marcos P. Santos
c20b99f9a4 [tests] Add a test for the retry delay on expired response 2016-02-26 03:20:51 +02:00
John Firebaugh
065cda83fa [core] Limit total number of offline Mapbox tiles 2016-02-24 13:38:14 -08:00
John Firebaugh
5cefaeb857 [core] Enforce foreign key constraints in the offline database 2016-02-24 13:38:14 -08:00
John Firebaugh
1bdeddab2c [core] Fix subtle bug in OfflineDatabase with updated resources
SQLite REPLACE is *not* UPSERT. If a conflict occurs, it first deletes the existing row, then inserts a new row. This means that AUTOINCREMENT primary keys change. This will break foreign keys to that value, which we use.

Instead we must try an UPDATE, and fall back to an INSERT if the UPDATE changes zero rows.
2016-02-24 13:38:14 -08:00
John Firebaugh
65c06e6270 [core] status.requiredResourceCountIsIndeterminate ⇢ status.requiredResourceCountIsPrecise
Change the name and reverse the sense. Naming things in the positive is better than naming them in the negative.
2016-02-24 13:38:14 -08:00
Thiago Marcos P. Santos
2b44c4b096 [tests] Add utests for HTTP 200 with no data
The implementation should return a valid empty string.
2016-02-23 00:21:57 +02:00
Thiago Marcos P. Santos
c51c0d5db2 [tests] Timer is not needed to keep the main loop alive
The loop will be alive until `.stop()` is called.
2016-02-22 09:21:51 +02:00
Bruno de Oliveira Abinader
0c57efb9a8 [gyp] Use variant compiler flags when needed 2016-02-21 17:34:15 +02:00
Bruno de Oliveira Abinader
bfd5ad3220 [gyp] Coverage only if BUILDTYPE=Debug and ENABLE_COVERAGE=1
Coverage compiler and linker flags are used only when (1) in debug build
and (2) with ENABLE_COVERAGE set to 1. Besides, because OS X's libtool
is unable to understand '--coverage', this linker flag is only used
genrating executable targets. Also, using 'link_settings' to specify
linker options and separate instructions for OSX and Linux.
2016-02-21 17:22:26 +02:00
Bruno de Oliveira Abinader
6792d78952 [tests] Use ENABLE_COVERAGE=1 envvar to enable coverage
This detaches coverage data collection from typical debug build.
2016-02-19 17:40:30 +02:00
John Firebaugh
7b39ce9521 [core] Remove ThreadContext::getFileSource; instead thread FileSource through 2016-02-18 15:15:24 -08:00
John Firebaugh
d5eb5240f8 Revert "[gl] Updated CustomLayer tests"
These tests are intended to reflect how someone using the custom layer feature might actually write their callbacks. Therefore the callbacks should not use mbgl-specific classes.

This reverts commit 69112a2a09.
2016-02-18 15:15:24 -08:00
Bruno de Oliveira Abinader
ec97264431 [osx] Enable coverage support for debug build 2016-02-18 15:01:58 +02:00
Bruno de Oliveira Abinader
69112a2a09 [gl] Updated CustomLayer tests 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
bfafc360a7 [gl] Moved TexturePool to gl namespace 2016-02-18 13:27:35 +02:00