Commit Graph

1676 Commits

Author SHA1 Message Date
John Firebaugh
108792420c Check for matching source when parsing tiles (fixes #1698) 2015-07-02 15:56:02 -07:00
Thiago Marcos P. Santos
9cc986e758 Report errors when parsing raster tiles
Use the same API/pattern for parsing raster tiles as we use for vector
tiles. Forward the error as an exception that will ultimately reach the
StillImageCallback.

Also set the tile to State::obsolete on error like we do for vector
tiles.
2015-07-02 23:21:42 +03:00
John Firebaugh
c357ce540a Use unique_ptr for Source objects (fixes #904) 2015-07-02 12:55:53 -07:00
Minh Nguyễn
9361cbfd5f Fixed round-tripping between pixelForLatLng() / latLngForPixel()
Followup to cfa2eaf5c2 for #1406.
2015-07-02 10:48:01 -07: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
Ansis Brammanis
9d714dcf83 fix line tessellation, fix #1814 2015-07-02 13:18:59 +02:00
Ansis Brammanis
a8f77d23cc reduce collision box linewidth to 1
06eece43a8
2015-07-02 12:35:15 +02:00
Ansis Brammanis
45e4938f9e fix cross-tile label collisions
fix #1816
fix #1689

The missing label was the only one in it's bucket. Since the label was
outside the tile boundaries it wouldn't need to be drawn by the bucket.
Since the bucket had no features to draw, it was dropped completely.
Even if a bucket doesn't have any features that need to be rendered, it
may have features that need to impact the placement of features in other
layers.
2015-07-02 12:31:50 +02:00
John Firebaugh
c0af683f2e Reapply style layer copy technique 2015-07-01 16:12:12 -07:00
John Firebaugh
fc64e97bce Simplify RunLoop
Instead of transforming between return value and callback, pass
the wrapped callback on to the invoked function as the last argument.

This eliminates the need for multiple invokeWithArgument overloads
and permits invoked functions to be asynchronous.
2015-07-01 16:12:12 -07:00
John Firebaugh
3ab682e627 Fix name shadowing 2015-07-01 15:21:11 -07:00
John Firebaugh
db1202e8e3 Don't pass Worker& around so much 2015-07-01 15:21:11 -07:00
John Firebaugh
abdf205510 Rename workerData ⇢ tileWorker 2015-07-01 15:21:11 -07:00
Thiago Marcos P. Santos
d30fce5f7d Catch exceptions when parsing tile PBFs
Also improved the error message and updated the test case.
2015-07-01 15:21:10 -07:00
John Firebaugh
eee02425fa Single-purpose Worker functions 2015-07-01 15:21:10 -07:00
John Firebaugh
f14e4c67fd Add comment about a subtlety 2015-07-01 15:21:10 -07:00
John Firebaugh
5fadda53e5 Move WorkerTask functionality into RunLoop core
As a byproduct, this makes FileCache get requests properly
cancelable.
2015-07-01 15:21:10 -07:00
John Firebaugh
d596d9dc38 Clean up bucket creation loop 2015-07-01 15:21:09 -07:00
John Firebaugh
24f50fdd4f Remove indirection 2015-07-01 15:21:09 -07:00
Konstantin Käfer
9e0b241dde reset partialParse when starting a new parsing run 2015-07-01 15:21:09 -07:00
John Firebaugh
4676553a3e Merge TileParser into TileWorker 2015-07-01 15:21:09 -07:00
John Firebaugh
875ef979be Remove indirection 2015-07-01 15:21:09 -07:00
John Firebaugh
217c376291 Push TileMembers members down hierarchy 2015-07-01 15:21:09 -07:00
John Firebaugh
29a2cd908f Introduce TileWorker 2015-07-01 15:21:08 -07:00
John Firebaugh
7e71145a89 Make request and reparse pure virtual 2015-07-01 15:21:08 -07:00
John Firebaugh
ee46378583 Reduce number of arguments in Source::update pathway 2015-07-01 15:21:08 -07:00
John Firebaugh
4eff674c1d Revert "Do not hold a reference to the Style at the [Live|Vector]TileData"
This reverts commit 044454417b.
2015-07-01 15:21:08 -07:00
Thiago Marcos P. Santos
295ea0856b Cancel pending Style requests before making a new one
Calling setStyleURL() multiple times in a short period
of time will enqueue requests on the FileSource. The
order they get replied is not guaranteed to be the same
as the order we make the requests. The side effect was
the last style set not always being the one rendered.

Now we cancel the current request if we make a new one
(and there was no point on keeping it around anyway).
2015-07-01 15:18:37 +03:00
Ansis Brammanis
176e42cb61 show symbols at z0, fix #1279 2015-07-01 13:16:16 +02:00
John Firebaugh
6532438fe4 Rationalize *RenderingMap notifications 2015-06-30 10:13:24 -07:00
John Firebaugh
37117dae00 Eliminate MapData::get/setFullyLoaded 2015-06-30 10:13:23 -07:00
Thiago Marcos P. Santos
dc9a88629b Check if the style was loaded before rendering
We now drive rendering from the main thread calling renderSync(),
but if we do it just after we set the style URL it will assert
because renderSync() expects the style to be fully loaded.
2015-06-30 15:39:41 +03:00
John Firebaugh
42c06e7039 Use array of structs rather than parallel arrays for annotations 2015-06-29 10:54:17 -07:00
Konstantin Käfer
45d0cbb4c7 add assert_always() macro for release build assertions 2015-06-29 11:32:19 +02:00
Minh Nguyễn
ac2ad993a5 Fit to coordinates
Whoever determined the boundaries of the District of Columbia did not have fit-to-bounds implementations in mind. With this change, shapes that are not unrotated rectangles fit much, much better.
2015-06-26 21:46:15 -07:00
John Firebaugh
95351dd906 Send MapChangeRegionIsChanging notifications 2015-06-26 10:32:07 -07:00
John Firebaugh
d193083513 Remove duration argument from View::notifyMapChange
Fixes #1026
2015-06-26 10:32:07 -07:00
John Firebaugh
e6a576f6eb currentState() ⇢ getState() 2015-06-26 10:32:07 -07:00
John Firebaugh
07a6d2ef64 Move Transform from MapData to Map
Pass current state to MapContext where needed. Remove mutex from
Transform.
2015-06-26 10:32:07 -07:00
John Firebaugh
e87a36444f Move getMin/MaxZoom to TransformState 2015-06-26 10:32:07 -07:00
John Firebaugh
874aa69efb Inline updateTiles and recalculateStyle 2015-06-26 10:32:07 -07:00
Konstantin Käfer
84e2ea886d drive map rendering from main thread 2015-06-26 10:32:06 -07:00
Konstantin Käfer
740281cc89 remove unused renderAsync() function 2015-06-26 10:32:06 -07:00
Minh Nguyễn
bcbb56c188 Maintain rotation when fitting to bounds
Also fit to the rotated bounds. A little more verbose than necessary due to <http://stackoverflow.com/a/2357688/4585461>.

ref mapbox/mapbox-gl-js#1338
2015-06-25 21:54:57 -07:00
Minh Nguyễn
68e404c522 Fit to bounds with padding
Each side of the bounding box is specified independently, allowing more flexibility than the offset + padding construct supported in mapbox/mapbox-gl-js’ Camera.
2015-06-25 21:54:57 -07:00
Minh Nguyễn
c57799f26c Reimplemented fit to bounds
The new implementation is now public and takes advantage of MGLCoordinateBounds. It is re-ported from `Camera.prototype.fitBounds()` in mapbox/mapbox-gl-js to ensure correct behavior. A new function, MGLCoordinateBoundsMake(), makes it easier to create an MGLCoordinateBounds for use with this method.
2015-06-25 21:54:53 -07:00
Thiago Marcos P. Santos
07086981fe Get rid of Environment et al.
mbgl::Environment is not used anymore and can
removed.
2015-06-25 16:26:22 +03:00
Thiago Marcos P. Santos
e32b0b7e20 Introduce GLObjectStore
Make a class for keeping GL objects ids and attach it
to the ThreadContext instead of hanging it on the Environment.
2015-06-25 16:26:21 +03:00