Commit Graph

2256 Commits

Author SHA1 Message Date
Konstantin Käfer
3f5d02ee65 [core] use stale raster tiles 2016-01-15 12:48:23 +01:00
Konstantin Käfer
180b3f125f [core] don't mark tiles with failed requests as obsolete
Otherwise, this will remove them from the map and overwrite the old data. This could happen e.g. when we have connection trouble and a tile needs to be refreshed, or we're displaying stale information and the connection is down.
2016-01-15 12:48:23 +01:00
Konstantin Käfer
8a964fb931 [core] use stale and refreshing TileJSON/GeoJSON data
We're now supporting using stale TileJSON and GeoJSON data. When we receive a new answer with an updated TileJSON file, we're replacing the Source's metadata with the new one and trigger updates to make sure we're loading the correct tiles. Similarly, GeoJSON data will be reparsed.
2016-01-15 12:48:23 +01:00
Konstantin Käfer
21e4029acf [core] use stale styles
This adds support for using cached styles that are stale. They're treated like changing styles; when the refreshed style changed compared to the one we've already had, we're swapping out the entire style, which might cause a slight flicker.
2016-01-15 11:59:26 +01:00
Konstantin Käfer
957415823a [core] Support multiple paths in SQLiteCache::getShared()
If you use many different caches, expired weak_ptrs will pile up in the unordered_map, but that is an edge case, and you probably shouldn't do that anyway.
2016-01-15 10:44:16 +01:00
Konstantin Käfer
8939a7b706 [core] move SharedSQLiteCache::get to SQLiteCache::getShared 2016-01-15 10:38:09 +01:00
Ansis Brammanis
e44db93f1c [core] place symbol layers in correct order
Previously, the placement of symbols depended on the order in which the
glyphs they need were loaded. The placement order should be based on the
style.

To fix this, symbol layers are placed in `placementPending` after they
are parsed. After all layers are parsed, symbol layers (stored in
`placementPending`) are placed and returned.
2016-01-14 17:51:29 -08:00
John Firebaugh
0066637e58 [core] Let SQLiteCache decide when store or refresh responses 2016-01-14 13:46:03 -08:00
John Firebaugh
1c887ff728 [core] Use notModified rather than storing the previous response body 2016-01-14 13:46:03 -08:00
John Firebaugh
2aafdbc1b8 [core] Add an explicit "not modified" indicator to Response 2016-01-14 13:46:03 -08:00
John Firebaugh
2ee1fe4178 [core] std::shared_ptr<const Response> ⇢ const Response& 2016-01-14 13:46:03 -08:00
John Firebaugh
7fb5e973ed [core] Eliminate FileCache interface
There is only one implementation and we're unlikely to add more.
2016-01-14 13:46:03 -08:00
Thiago Marcos P. Santos
f9574e350c [core] Fix crash on transitionFrameFn callback
This is a tricky one:

We are storing a lambda at the member variable `transitionFrameFn` and
capturing `this` at this lambda function.

At some point when running the callback, we set `transitionFrameFn` to
`nullptr`, effectively destroying the callback that is being executed.

After this point, `this` is no longer valid, as the memory gets
cleared and it might point to the correct location (or not). That
is why it works on some compilers but not on g++ 5.3.1. Touching
any `this->[smth]` is undefined after that.

The fix is just move `transitionFrameFn = nullptr` to the last
thing we do on the callback. This behaves similarly to calling
`delete this` on a class method.
2016-01-14 18:59:38 +02:00
Minh Nguyễn
4f08ef150d [core] Fixed build error in Xcode 7.3
Removed std::move() call per Xcode fix-it suggestion.
2016-01-14 10:52:13 +01:00
Minh Nguyễn
ff8b014c5b [core] Consolidated easeTo and flyTo
Pushed much of easeTo() and flyTo() into startTransition() to avoid code duplication.
2016-01-14 00:40:46 -08:00
Minh Nguyễn
02d00662fb [core] Moved camera methods next to each other 2016-01-14 00:40:45 -08:00
Minh Nguyễn
8bad15bf87 [core] Consolidated zoom and angle anchor logic
Made anchor a CameraOption for easeTo().
2016-01-14 00:40:03 -08:00
Minh Nguyễn
ac4b1b7479 [core] Standardize transform origin
All Transform methods that take a PrecisionPoint now assume a “flipped” origin at the upper-left corner of the view. Previously, some methods assumed an origin at the lower-left corner.
2016-01-14 00:39:56 -08:00
Minh Nguyễn
d26b956a48 [core] Cleaned up Transform
Eliminated many redundant methods on Transform. Minimized usage of TransformState::x and TransformState::y. Added convenient constructors for AnimationOptions. When scaling, passing in view’s origin as the anchor no longer anchors the scaling operation at the view’s center. To specify no anchor, use NaN.

Increased precision of worldSize(), now that it’s used much more heavily in transform methods.
2016-01-14 00:39:18 -08:00
Minh Nguyễn
27b308a234 [core] Separated AnimationOptions from CameraOptions 2016-01-14 00:39:12 -08:00
Ansis Brammanis
5119ce8155 [core] fix overscaled line patterns and re-enable render tests
fix #3489
fix #2648
2016-01-13 16:39:02 -08:00
Ansis Brammanis
f7acc91d21 [core] set u_texture uniform value
fix #1685
2016-01-13 16:01:41 -08:00
Ansis Brammanis
e577354567 [core] remove bilinear, nearest scaling, fix #3164 2016-01-13 15:02:41 -08:00
Ansis Brammanis
bdfa1277a5 [core] match icon rendering with -js
port https://github.com/mapbox/mapbox-gl-js/pull/1919/files
2016-01-13 14:48:07 -08:00
John Firebaugh
86c8446d3a [core] Simplify asset:// implementation
* Move asset:// URL handling to DefaultFileSource.
* AssetFileSource implements FileSource interface and follows familiar implementation patterns.
* Move default implementation to platform/default, zip implementation to platform/android.
* Don't bother with modified / expires / etag -- assets are not cached so it doesn't matter.
* Don't bother with interleaving individual IO calls on the implementation thread. That adds a lot of complexity for very little benefit.
2016-01-13 13:40:31 -08:00
Konstantin Käfer
e8705d535d [core] move SourceInfo parsing to StyleParser 2016-01-13 13:04:59 -08:00
Konstantin Käfer
cef05b9017 [core] move invariant Source ID from SourceInfo to Source 2016-01-13 13:04:59 -08:00
Konstantin Käfer
8cca5c89b2 [core] rename "id" to "tileID" to avoid naming conflicts 2016-01-13 13:04:59 -08:00
Konstantin Käfer
f00a6a997b [core] move invariant SourceType from SourceInfo to Source 2016-01-13 13:04:59 -08:00
Konstantin Käfer
62973f9e5a [core] move raster tile URL normalization to source parsing 2016-01-13 13:04:59 -08:00
Konstantin Käfer
1ff317c1cd [core] remove SourceInfo dependency from *TileData 2016-01-13 13:04:59 -08:00
kelvinabrokwa
73be3558d7 [core] seamless fill-pattern
seamless across dateline

upgrade test-suite version
2016-01-12 16:18:24 -08:00
Thiago Marcos P. Santos
d7fdcc73bf [core] Get rid of ::unref() for Timer and AsyncTask
Not need, legacy from libuv. The RunLoop keep the main
loop running until is explicitly no longer needed.
2016-01-09 01:26:29 +02:00
John Firebaugh
e7b0b31d58 [core] Privatize SQLiteCache 2016-01-08 12:31:13 -08:00
Konstantin Käfer
bc309d84d7 [core] unify URL prefix detection (asset:// and mapbox://) 2016-01-08 12:14:39 +01:00
kelvinabrokwa
52844d4746 [core] fix text-offset bug
fixes #3469
2016-01-07 16:44:44 -08:00
Mike Morris
1dd1543905 [core] clip labels to tiles in MapMode::Still 2016-01-06 15:17:03 -08:00
Mike Morris
dc1630f50d [core] always add labels to buffers in MapMode::Still
To minimize label clipping.
2016-01-06 14:10:23 -08:00
Minh Nguyễn
07cf1824d0 [core] Constrain minimum zoom level 2015-12-24 16:24:45 -08:00
Minh Nguyễn
63820d1b4f [core] Always constrain width for zoom level
Even if the map supports wrapping the world, it isn’t necessary to show more than one full revolution of the world at a time. Removed a redundant zoom level clamp.
2015-12-24 16:24:45 -08:00
Minh Nguyễn
58264408c8 [core] Always return valid source zoom level
If for whatever reason a source doesn’t cover all the zoom levels allowed by the style – for instance, if different sources have different zoom ranges – use the nearest available zoom level.
2015-12-24 16:24:45 -08:00
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
c972a251da [core] Remove Resource dependency from low-level classes
These classes should not be coupled to domain-specific resource types.
2015-12-23 14:30:20 -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
John Firebaugh
1a5eab785c Eliminate boolean return code 2015-12-22 14:54:35 -08:00
John Firebaugh
ab0efe5d00 [core] Move OnlineFileSource to platform
Preparation for OfflineFileSource which depends on SQLite
2015-12-22 12:09:14 -08:00
John Firebaugh
913f49c701 [core] Prepare for OfflineFileSource
* Rename existing DefaultFileSource to OnlineFileSource
* Restore a DefaultFileSource that's a passthrough to OnlineFileSource
2015-12-21 11:35:00 -08:00
Minh Nguyễn
d668c0fa84 [ios, osx] Better zoom level–altitude conversion
Greatly simplified conversions between zoom level and altitude. Adjusted field of view to more closely match MapKit. Conversions are now well within the same order of magnitude as MapKit at all latitudes.

Fixes #2266.
2015-12-20 03:57:28 -08:00
Minh Nguyễn
a5230f3e11 [core] Clamp pitch in easeTo(), flyTo()
Also factored out the maximum pitch into a constant.
2015-12-19 23:14:01 -08:00
Minh Nguyễn
0a9b6a82e4 [core] Reformulated flyTo options
The speed and curve fields in CameraOptions have been replaced with velocity and minZoom fields, which expressed in screen units. Scaling and easing make it difficult to derive options that are expressed in physical units.
2015-12-19 20:33:18 -08:00