Commit Graph

54 Commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
7b3e24d74a [core] Cleanup TransformState::getIntegerZoom 2016-10-31 16:53:07 +02:00
Konstantin Käfer
62b56b799a [core] change std::array<uint16_t, 2> to mbgl::Size 2016-10-27 18:30:58 -07:00
Konstantin Käfer
91272992f3 [core] don't load tiles from sources that aren't used 2016-10-27 16:15:36 -07:00
Konstantin Käfer
a4d259c33f [core] move gl::Context to Backend and refactor View 2016-10-25 13:52:36 -07:00
Konstantin Käfer
5cc390d694 [core] separate Backend from View for headless rendering 2016-10-25 13:52:36 -07:00
Mike Morris
817c26111a [core] [node] pass thread pool impl to Map constructor
Updates mbgl::Map constructor usage everywhere

Adds NodeThreadPool implementation using AsyncQueue to call
Nan::AsyncQueueWorker from main thread
2016-10-20 14:37:36 -04:00
Bruno de Oliveira Abinader
3b8b68d028 [core] Fix Map::setLatLng behavior
We were erroneously assigning a value to optional<ScreenCoordinate>
(null island), causing it to be a valid anchor for Transform::easeTo.
2016-10-07 17:23:17 +03:00
Konstantin Käfer
3f3fc7b772 [test] add .test.cpp suffix to test case files 2016-09-28 16:34:22 +02:00
Thiago Marcos P. Santos
4d3356dc1e [tests] Add tests for Map::[add|remove]Image 2016-09-22 17:43:28 +03:00
Konstantin Käfer
1e8f9c75ca [core] do not render layers that are outside their zoom range
So far, we didn't properly disable layers that are outside the zoom range. This means that we rendered layers that should not have been rendered, albeit we didn't make any attempt to load tiles for those layers. However, when zooming in/out, existing tiles might already have been loaded in the source which continued to be rendered. In most cases they weren't actually visible because either the matrices weren't updated, or the clip IDs weren't set so that they would be "rendered" off-screen and clipped completely. In any case, we did way too much work.
2016-09-20 14:10:38 +02:00
Ivo van Dongen
f3b38df91d [core] add MapChangeDidFinishLoadingStyle signal (#6371) 2016-09-20 09:55:53 +02:00
Bruno de Oliveira Abinader
22fc8cdc1a [test] Added Map class accessors tests 2016-09-13 12:38:59 +03:00
Thiago Marcos P. Santos
1d7a5b0fe0 [tests] Add unit test for style loading failures 2016-08-24 20:02:39 +03:00
Thiago Marcos P. Santos
c98f4f476b [core] Emit MapChangeDidFailLoadingMap when the style cannot be loaded or parsed
Currently this signal is never emitted, which can cause the Still mode
to starve in case of an invalid style or failed request.
2016-08-24 20:02:31 +03:00
John Firebaugh
eb9fe89612 [tests] Test that style mutations due to annotations don't cancel style revalidation 2016-08-23 09:55:32 -07:00
John Firebaugh
86cccc4d24 [core] Don't allow style mutations to be overwritten by revalidation
* Once we get a fresh style, stop revalidating.
* If the style is mutated, stop revalidating and preserve the existing mutations.
2016-08-23 09:55:32 -07:00
John Firebaugh
6bbb2e4c2b [tests] Merge single test in set_style.cpp with other Map tests 2016-08-23 09:55:32 -07:00
Konstantin Käfer
18176605f6 [core] support "scheme": "tms" in TileJSON files 2016-08-16 11:04:30 +02:00
Young Hahn
24b66bc8cd Color class (#5361)
* Color class

* Switch to list initialization
2016-06-15 11:38:22 -04:00
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
ba4a8a9731 [tests] Add basic tests for Map::{add,remove}Layer 2016-06-02 14:51:39 -07:00
Bruno de Oliveira Abinader
f751d2c465 [core] Avoid NaNs in TransformState unit conversions
Fix cases where e.g. state has either zero width or height, causing the
unit convertion functions would return NaNs.
2016-05-20 16:18:07 +03:00
Konstantin Käfer
002393bdea [core] remove MockView and View dependency in Transform 2016-05-18 12:07:21 +02:00
Konstantin Käfer
cd65a43855 [core] move from microsecond precision timestamp to integer second precision 2016-05-13 17:24:22 +02:00
Bruno de Oliveira Abinader
c13dd32242 [core] Added Viewport mode
Satisfies embedding platforms that requires the viewport coordinate
systems to be set according to its standards e.g. viewport mirrored
vertically.
2016-05-11 15:48:51 +03:00
Konstantin Käfer
7332ae0073 [core] retain tiles differently and remove old TileID class 2016-05-10 14:50:56 +02:00
John Firebaugh
9330d674a9 [core] Use geometry.hpp's point 2016-05-05 11:30:53 -07:00
John Firebaugh
e916cc811c [tests] Rationalize test fixtures (#4834)
Place them in a directory corresponding to the test .cpp file name.
2016-04-25 14:51:27 -07:00
John Firebaugh
5939dd5b41 [core] Use the proper type for font stacks 2016-04-22 15:53:18 -07:00
John Firebaugh
ce4270b01c [core] Convert MapContext to Map::Impl; eliminate indirection 2016-04-15 09:56:18 -07:00
John Firebaugh
6e78eabfff [core] Clean up ThreadContext vestiges 2016-04-15 09:56:18 -07:00
John Firebaugh
b55692132a [tests] Use StubFileSource where a real FileSource is not required 2016-04-14 14:18:19 -07:00
John Firebaugh
6d88a23a60 [core] Remove internal threading from OnlineFileRequest
There's no need to do the work that OnlineFileRequest does on a separate thread from the DefaultFileSource thread, and having AsyncTasks proxy to other tasks across a thread boundary adds needless complexity.
2016-04-14 14:18:19 -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
John Firebaugh
1c7c5af69d [ios] Run core unit tests in CI 2016-04-11 11:00:34 -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
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
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
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
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