Commit Graph

118 Commits

Author SHA1 Message Date
John Firebaugh
d238e00d9b [core] Remove RapidJSON and GeoJSONVT dependencies from SourceInfo
It's going to be exposed in the public core API as part of #3374.
2015-12-23 14:48:41 -08:00
John Firebaugh
16de579d7c [core] Rationalize error handling for resource loading
* Standardize on std::exception_ptr as the error representation
  (fixes #2854).
* Don't format textual strings at the error source; pass on the
  constituent data via observer method parameters instead.
* Use the null object pattern to simplify observer notification code.
* Further refactoring for ResourceLoading tests.
2015-12-23 12:50:42 -08:00
Bruno de Oliveira Abinader
93725e062a [core] Load sources only if there is at least one visible layer 2015-12-17 16:53:37 -08:00
Bruno de Oliveira Abinader
5a63ce5576 [core] Avoid loading source if a source request is currently ongoing 2015-12-17 16:53:37 -08:00
Konstantin Käfer
95cef66e22 [core] change RapidJSON usage to use CrtAllocator and bump GeoJSON VT 2015-12-14 16:43:35 -08:00
Konstantin Käfer
8d711e9c80 [test] update test suite to include more comprehensive GeoJSON tests 2015-12-11 16:23:43 -08:00
Konstantin Käfer
0f9922cff5 [core] create GeoJSON tiles from inline GeoJSON in sources 2015-12-11 16:23:42 -08:00
Konstantin Käfer
2f973d0a7e [core] parse GeoJSON source type 2015-12-11 16:23:42 -08:00
Konstantin Käfer
2b9f20461a [core] move SourceInfo to its own file 2015-12-11 15:25:12 -08:00
Konstantin Käfer
d5fb535058 [core] add namespace comment to closing brace 2015-12-03 15:38:36 +01:00
John Firebaugh
40ebf5d0d0 [core] Introduce StyleUpdateParameters 2015-12-01 09:07:03 -08:00
John Firebaugh
f27c28b6c4 Partially revert "[core] Source should receive a ref to MapData just once"
This partially reverts commit d55aa7929c.
2015-12-01 09:07:03 -08:00
Bruno de Oliveira Abinader
92856f394c [core] Collision debug is now MapDebugOptions::Collision 2015-11-27 17:47:02 +02:00
Bruno de Oliveira Abinader
d55aa7929c [core] Source should receive a ref to MapData just once 2015-11-27 17:47:02 +02:00
Bruno de Oliveira Abinader
591e0dde2f [core] Added modified, expires information to TileData 2015-11-27 17:47:02 +02:00
John Firebaugh
1caf89c32b [core] Pass a value to response callback, not a reference 2015-11-16 12:25:47 -08:00
Thiago Marcos P. Santos
36581f3d30 [core] Do not pass uv_loop_t around
This should be abstracted by util::RunLoop
2015-11-16 12:25:47 -08:00
Konstantin Käfer
7b8b2b1790 Revert "[core] only update the render order array when there are changes to tiles"
This reverts commit ec1a58d8ef and 177372b836.
2015-11-09 11:18:10 -08:00
Konstantin Käfer
177372b836 [core] only update the render order array when there are changes to tiles 2015-11-05 10:33:21 +01:00
Konstantin Käfer
4d5c6333be [core] move retry logic to DefaultFileSource 2015-11-02 17:24:40 +01:00
John Firebaugh
7669e02062 [core] Monitor annotation tiles, rather than completely invalidating them
Fixes #1688
2015-10-30 11:17:01 -07:00
John Firebaugh
e2dc956eb6 [core] Merge LiveTileData into VectorTileData
To encapsulate the differences, this introduces an abstract
GeometryTileMonitor class, with concrete VectorTileMonitor and
AnnotationTileMonitor implementations, and makes pbf parsing for
VectorTile data happen lazily in getLayer, since we want that to
happen on the worker thread, rather than when VectorTile is created.

Fixes #2792
2015-10-29 12:05:40 -07:00
John Firebaugh
014b517820 [node] Output debug logs when a render test times out 2015-10-28 15:54:34 -07:00
Konstantin Käfer
75dec6ffac [core] always reparse with the freshest possible placement config
Fixes an issue where updates to stale tiles would remove labels altogether until the map was rotated.
2015-10-26 16:44:55 +01:00
Konstantin Käfer
c0c554e36f [core] reparse tiles when new data arrives
We're now reparsing tiles when they expire. We're also swapping out buckets atomically to avoid flickering data; i.e. we're displaying the old data as long as we don't have a new parsed bucket for that layer yet. The parsed buckets now live in the *TileData objects rather than in the TileWorker; only partially parsed == pending buckets will remain in the TileWorker. Once they're parsed, they're moved to the *TileData object.
2015-10-26 15:54:27 +01:00
Konstantin Käfer
5173bf1bb8 [core] Make response data shared to avoid excessive copying 2015-10-26 15:54:27 +01:00
Konstantin Käfer
6a7334b882 [core] add support for stale responses
We're now returning stale responses from cache. Those responses will have the `stale` flag set to true. Currently, all requesters in the core code discard stale responses, and cancel the request immediately after they got a non-stale response.
2015-10-26 15:54:27 +01:00
Konstantin Käfer
096a3edf39 [core] use RAII-style lifetime tracking of Request objects 2015-10-26 15:54:27 +01:00
Konstantin Käfer
94a5ac857f [core] all requests have to be canceled explicitly now
By not automatically destroying Request objects after the result has been delivered, we are making sure that we can potentially fire the callback multiple times without adverse effects. This means that you have to hold on to the result of fs->request(), can explicitly cancel it if you don't want to be notified of data changes anymore. Not doing so will monitor the request indefinitely and will prevent the app from exiting.
2015-10-26 15:54:27 +01:00
John Firebaugh
c5b95032a5 [core] Annotation refactor 2015-10-20 13:54:19 -07:00
John Firebaugh
2066295e35 Install RapidJSON from mason 2015-10-01 11:40:47 -07:00
John Firebaugh
af392b9434 Rewrite annotation invalidation strategy
First, move style mutation code out of StyleParser and into AnnotationManager,
coalescing it with the mutation code for shape layers.

Second, allow AnnotationManager to keep track of stale tiles entirely
internally. There's no reason to pass sets of TileIDs around.

Third, correct the logic for invalidating the shape source. Since
AnnotationManager does not track shape invalidations on a tile-by-tile basis,
don't try to invalidate the shape source tile-by-tile.

Fixes #1675
Fixes #2322
Fixes #2095
2015-09-28 14:10:23 -07:00
John Firebaugh
028abaab00 Ensure that LiveTileData can be reparsed
Annotation tiles may become partially parsed just like regular tiles,
for example if a point annotation is added to the map before the style's
sprite has been loaded. In such cases, they need to be reparsed or the
annotation will not be rendered. Previously, the code path for reparsing
would be short-circuited by a dynamic_cast<VectorTileData*> followed by
a null check. This commit removes that case and adds (back) a virtual
reparse method to the TileData interface.
2015-09-28 14:10:00 -07:00
Minh Nguyễn
0e456940b9 Merge branch 'master' into perspective-without-y-flip 2015-08-25 14:13:16 -07:00
Bruno de Oliveira Abinader
765c4695d8 Revert "only update the render order array when there are changes to tiles"
This reverts commit fd98607c5f.

Fixes #2163.
2015-08-25 11:36:10 -07:00
Ansis Brammanis
51c93867ae fix LatLng --> point for perspective views 2015-08-24 18:41:51 -04:00
Ansis Brammanis
0d68c4fedf load correct covering tiles in perspective view
port pointCoordinate from -js to convert screen points to tile
coordinates correctly in perspective view.
2015-08-24 18:41:51 -04:00
Ansis Brammanis
bc92c2de39 fix symbol collision detection in perspective view 2015-08-24 18:41:50 -04:00
Konstantin Käfer
fd98607c5f only update the render order array when there are changes to tiles 2015-08-20 16:13:46 -04:00
Konstantin Käfer
bb0ae37c25 disable debugging groups in non-debug builds
Use a macro to completely remove all instantiations of mbgl::gl::debugging::group so that we aren't executing the code to generate the arguments to the object instantiation
2015-08-19 18:21:12 -04:00
Minh Nguyễn
bea457697a Ignore tile URL sharding
The source returns sharded tile URLs, but sharding doesn’t buy us anything on native platforms, so always grab the first.

ref mapbox/mapbox-gl-native#2007
2015-08-06 10:37:46 -07:00
Konstantin Käfer
78ec33320f don't use certain STL functions
some functions defined in <cmath>, as well as std::to_string aren't available on GNU's STL for some platforms, e.g. Android
2015-08-04 14:08:19 +02:00
Bruno de Oliveira Abinader
58b93553c1 Replace size() with empty() whenever possible
Before C++11, std::list's implementation of size was O(n). It should be
all O(1) now, but it is probably still a good idea to use empty() to
emphasize the intend.
2015-07-29 11:03:47 +03:00
Thiago Marcos P. Santos
c6e58515fc Keep updating until all the tiles are State::parsed
This is needed because of a race that can occur now that we
requests Glyphs from the Map Thread:

The glyph might arrive at the moment a tile is being parsed
and they won't be notified again of any new data, remaining
forever at the partial state.
2015-07-16 19:38:38 +03:00
Konstantin Käfer
675ddddee7 Make pixelRatio constant across a Map object lifetime
also moves framebuffer size out of TransformState into its own object
2015-07-08 10:40:05 +02:00
Minh Nguyễn
4c1f325bf6 Moved raster zoom threshold to the .5’s
Fixes #963.
2015-07-07 12:14:26 -07:00
Thiago Marcos P. Santos
f6b8dd4be9 Add simple static method to retrieve the current loop
In the lines of how we do for getting information of the
current thread.
2015-07-06 15:54:51 +03:00
John Firebaugh
f5f19d0eb0 External synchronization for AnnotationManager 2015-07-02 10:12:04 -07:00
John Firebaugh
117322d349 Don't inherit for code reuse 2015-07-02 10:12:04 -07:00
John Firebaugh
1da2c3f840 Remove unnecessary virtual methods from TileData 2015-07-02 10:12:03 -07:00