Commit Graph

1905 Commits

Author SHA1 Message Date
Ansis Brammanis
750c72f324 improve gestures in perspective view
The location under your finger stays under your finger as you pan.
The location you double tap to zoom stays at the same point.
The location at the center of a pinch zoom stays at the center.
The location at the center of a rotation stays at the center.
2015-10-26 12:48:03 -07:00
John Firebaugh
bb6241844a [core] Extract PaintPropertiesMap 2015-10-26 12:00:11 -07:00
Thiago Marcos P. Santos
c65f809651 [core] Move parseCacheControl() up in the class hierarchy
Avoid duplicating it on all the ports.
2015-10-26 18:37:51 +02: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
4e3503ea6c [core] do not use std::atomic_* with shared_ptrs
It's not implemented in GCC 4.9.2's stdlib (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57250). Instead, we're now always using a mutex to protect access; we previously created a mutex only on cancelation, but since we're always canceling now, it makes sense to allocate it right away.
2015-10-26 15:54:27 +01:00
Konstantin Käfer
9bbd9aba3a [core] set a timer and auto-refresh requests when they expire
When we get a request with an explicit expiration time, we're now starting a timer, and will trigger a refresh once the data expires. This gives requesters a chance to update their data.
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
Thiago Marcos P. Santos
1007dc9754 [core] Initialize attributes before using them
Spotted by valgrind.
2015-10-26 10:41:16 +02:00
John Firebaugh
8d79c25765 [core] Remove MapData dependency from StyleParser
MapData was needed for two things: getting the default transition and
fade durations, and detecting still rendering vs. continuous.

The first is avoided by making transition durations optional, and
supplying the default fallback value at evaluation time. The second did
not fix the still rendering issue, and will be followed up with a
different approach in a later commit.
2015-10-23 13:56:55 -07:00
John Firebaugh
0665b64590 [core] Introduce StyleCalculationParameters
This makes subsequent changes to the the parameter list less intrusive.
2015-10-23 13:56:55 -07:00
John Firebaugh
7a03d734fd [core] Respect source layer z-order for style-sourced annotations 2015-10-23 13:27:14 -07:00
Bruno de Oliveira Abinader
46e2f13e68 [core] Fix integer overflow for high maximum zoom levels 2015-10-23 11:00:52 -07:00
John Firebaugh
1f4144c65a [core] Remove StyleLayer::isBackground() 2015-10-22 17:53:16 -07:00
Bruno de Oliveira Abinader
54858dae8c [core] Added save/restore capabilities to GL config 2015-10-22 16:02:39 -07:00
Bruno de Oliveira Abinader
a1c53d92e5 [core] Added stencilOp, depthFunc and blendFunc to GL config
All GL values are now reset upon Painter setup.
2015-10-22 16:02:39 -07:00
Bruno de Oliveira Abinader
5fa144647d [core] Added GLContextMode to MapData
Adding new mbgl::GLContextMode enum to mbgl::Map ctor, which gets stored
in MapData. In shared GL context environments, we cannot assume that the
GL state that has been left since the last draw is the same, so we reset
the GL configurations to their default values.
2015-10-22 16:02:39 -07:00
John Firebaugh
c46a8254c4 [core] Style-sourced shape annotation properties
This introduces the possibility to source the type and style properties
of a shape annotation from a designated layer in the style.
2015-10-22 15:27:53 -07:00
John Firebaugh
3afc8b4a29 [core] Introduce StyleLayer subclasses 2015-10-22 09:34:40 -07:00
John Firebaugh
df89de5cc5 [core] Rationalize style property classes: <type>{Paint,Layout}Properties 2015-10-22 09:21:30 -07:00
Bruno de Oliveira Abinader
ead4ca599a [core] Fix transition to default style when no classes are applied
Some property transitions were being set to their fallback values when
no classes are being used. This issue is particularly perceived when the
default transition duration is not zero (animated transitions).
2015-10-21 14:02:08 -07:00
Bruno de Oliveira Abinader
6824a24acd [core] Removed time param from Painter::render
Animation time can be obtained directly from MapData.
2015-10-21 11:20:45 -07:00
Bruno de Oliveira Abinader
0045eef00a [core] Moved Painter::setup() to Painter ctor 2015-10-21 11:20:39 -07:00
Bruno de Oliveira Abinader
ad3078e73d [core] Remove redundant setDebug() from Painter
This information can be obtained directly from MapData.
2015-10-21 11:20:20 -07:00
Bruno de Oliveira Abinader
5db4670d78 [core] Added more transform state getters
Some platforms requires specific information that was previously not
available in public API, but stored internally in TransformState object.
2015-10-21 11:06:51 -07:00
Jason Wray
e5aab73b60 [core] only check for mapbox:// at the start of the failed request's URL 2015-10-21 11:38:01 -04:00
Jason Wray
ae5a345cc4 [core] Improve error message when style is not found or is incompatible
Attempting to use a Mapbox-hosted incompatible raster map/style with GL
would throw a simple 404, without any indication of the real issue.

Fix #1724, ref #1841
2015-10-21 11:38:01 -04:00
John Firebaugh
00a1c2343a [core] Remove shape layers from the style (fixes #2405) 2015-10-20 13:54:20 -07:00
John Firebaugh
c5b95032a5 [core] Annotation refactor 2015-10-20 13:54:19 -07:00
John Firebaugh
597b2b4851 [core] Pull annotation typedefs to own header; add AnnotationID 2015-10-20 13:54:19 -07:00
John Firebaugh
8baa804a44 [core] Fix swapped lat/lon in geo.cpp 2015-10-20 13:54:19 -07:00
Bruno de Oliveira Abinader
6a1b9b31a6 [core] MapContext setStyle{URL,JSON} should ignore redundant calls
Our engine should be robust enough to ignore redundant calls and avoid
triggering a whole style update if the style URL and/or JSON are the
same.
2015-10-16 13:16:02 +11:00
Leith Bade
2ee7b02189 [core] [android] Fix InfoWindow topOffsetPixels adjustment when switching styles
Fixes #2599
Make getTopOffsetPixelsForAnnotationSymbol private
Also implements MapChangeWillStartLoadingMap, MapChangeDidFinishLoadingMap
Paritally implements #630
2015-10-16 13:06:49 +11:00
Bruno de Oliveira Abinader
074d61a55e [core] MapContext setStyle{URL,JSON} should ignore redundant calls
Our engine should be robust enough to ignore redundant calls and avoid
triggering a whole style update if the style URL and/or JSON are the
same.
2015-10-14 22:44:00 -07:00
Bruno de Oliveira Abinader
9a97333e85 [core] Set fade/transition duration to 0 if map mode is still 2015-10-14 11:49:18 -07:00
Mike Morris
62595a9b39 [core] bump libuv to 1.7.5 across all platforms
UV_ASYNC_PARAMS and UV_TIMER_PARAMS for libuv <= 0.10 compatibility

use st_mtim.tv_sec in libuv > 0.10.x
2015-10-14 11:36:28 -04:00
Minh Nguyễn
59799947c7 Break lines on com­mon­ly un­spaced punc­tu­a­tion
Par­ti­cu­lar­ly hy­phens and soft hy­phens.

Fixes #2595.
2015-10-13 09:54:36 -07:00
Konstantin Käfer
e3d9fb1715 [core] only show parent XOR child tiles
Since label rendering isn't clipped, having a parent tile, and only a handful of child tiles loaded may result in some labels being rendered twice (from the parent tile, and the up to three child tiles that necessitate the parent tile remaining in the list). This patch makes sure that in one location, it only ever renders one set of labels, by favoring the parent tile until all required child tiles have been loaded.
2015-10-12 14:46:47 +02:00
Leith Bade
154e27968f [core] Protect MapData.pause with a lock
Fixes #2522
2015-10-08 11:36:22 +11:00
Minh Nguyễn
9482649ae5 [core] Look the other way when placing icon at start of line
When an anchor is at the beginning of a line, its segment’s coordinates match its own coordinates, resulting in an angle of 0°. When the segment’s coordinates match the anchor’s coordinates, consider the next segment instead.

Fixes #2474.
2015-10-07 14:57:58 -07:00
Adam Hunter
1179096dd8 VAO and extension tracking code. 2015-10-06 13:54:36 -07:00
Bruno de Oliveira Abinader
402819e1ad Fix for style properties transition updates 2015-10-06 12:25:46 -07:00
Vladimir Agafonkin
453fd4c0b0 fix layer minZoom being ignored if not less than source maxZoom
This condition led to layers with high minzoom like oneway street
arrows (z15) get parsed and placed regardless of minzoom (e.g. z11+),
wasting a lot of worker CPU time.

It became unnecessary after we added reparsing tiles when overscaling,
and even before that it should have probably been <= rather than <.
2015-10-06 14:25:00 +03:00
Leith Bade
b869771992 Correctly handle spurious wake-ups in Map::pause()
Fixes #2522
2015-10-06 14:10:32 +11:00
Justin R. Miller
999b0d2c75 refs #2527, fixes #774: properly unbind VAO 2015-10-05 16:23:13 -07:00
Konstantin Käfer
3d834b5c40 give every bucket its own set of buffers
This allows changing individual buckets without having leftover data
2015-10-02 15:05:19 +02:00
Konstantin Käfer
6a78a4763d [iOS] fix benchmarking app and update to style v8 2015-10-02 14:57:26 +02:00